



Código
Option Explicit Private Type SUBROUTINE lNull As Long '// Must be 0 lPtr As Long End Type Private Declare Function GoSubReturn Lib "MSVBVM60" Alias "__vbaGosubReturn" (ByRef lpSubRoutine As Long) As Long '--------------------------------------------------------------------------------------- ' Procedure : GoToPtr ' Author : Karcrack ' Date : 08/05/2010 ' Purpose : GoTo a pointer ' Warning : It's not a JMP, is a GoTo, so the execution of the program won't continue ' where you made the GoTo... '--------------------------------------------------------------------------------------- ' Public Sub GoToPtr(ByVal lPtr As Long) Dim tSubRoutine As SUBROUTINE tSubRoutine.lPtr = lPtr Call GoSubReturn(VarPtr(tSubRoutine)) End Sub
Hay que tener mucho cuidado a que puntero llamamos, porque debido a que el Stack se deforma para hacer el salto no se puede volver al lugar desde el cual se llamo a la funcion... Mucho cuidado con esto
Es muy util para llamar a ShellCodes o para marear a la heuristica/proactiva de los AVs, yo por ejemplo lo estoy utilizando en un crypter que he hecho para el PoisonIvy



Asi que llameis al puntero que llameis teneis que acabar la ejecucion allí



Aqui teneis un ejemplo:
Código
Sub Main() Call GoToPtr(gP(AddressOf RMain)) End Sub Function gP(ByVal lPtr As Long) As Long gP = lPtr End Function Sub RMain() MsgBox "HOLA" End End Sub
Saludos

Primero posteado en:
Citar