Gracias por responder DSanchez.
Si efectivamente hubo que realizar cambios.... al parecer ya no se vale hacer un simple PUSH a la memoria, uffff.
Les comparto mi trabajo para poder ejecutar códigos ASM en VFPA, esto es util para poder llamar a dirección de procesos, muy necesario para trabajar ciertas funciones de la API de windows y otras APIS.
Luego de revisar y revisar, probar y probar esto es lo que conseguí:
*-- Main
Clear
Set Talk Off
Set Safety Off
lhModule = GetModuleHandleA("User32")
lpProcce = GetProcAddress(lhModule, "MessageBoxA")
lcProcAdd = BinToC(lpProcce,"4RS")
lchWnd = BinToC(_Screen.HWnd,"4RS")
lstrText = BinToC(GetHeapAllocPtr("Hola, este es mi mensaje desde VFPA"+Chr(0)),"4RS")
lstrTitle = BinToC(GetHeapAllocPtr("MI Titulo VFPA"+Chr(0)),"4RS")
lcuType = BinToC(4+64,"4RS")
lnHex = 16
lcLenMem = Chr(0x20)
lcCero = Strconv("00000000",lnHex)
lcASM = ""
lcASM = lcASM + Strconv("55", lnHex)
lcASM = lcASM + Strconv("48 89 E5", lnHex)
lcASM = lcASM + Strconv("48 83 EC", lnHex)+ lcLenMem
lcASM = lcASM + Strconv("49 B9", lnHex ) + lcUType + lcCero
lcASM = lcASM + Strconv("49 B8", lnHex) + lstrTitle + lcCero
lcASM = lcASM + Strconv("48 BA", lnHex) + lstrText + lcCero
lcASM = lcASM + Strconv("48 B9", lnHex) + lchWnd + lcCero
lcASM = lcASM + Strconv("48 B8", lnHex) + lcProcAdd + lcCero
lcASM = lcASM + Strconv("FF D0", lnHex)
lcASM = lcASM + Strconv("48 83 C4", lnHex)+ lcLenMem
lcASM = lcASM + Strconv("5D", lnHex)
lcASM = lcASM + Strconv("C3", lnHex)
nbp = GetHeapCreate(4096, lcASM)
? nbp
lnRet = -2
Local oError As Exception
try
lnRet = CallWindowProc( nbp, 0, 0, 0, 0 )
Catch to oError
? oError.ErrorNo, oError.Message
EndTry
? lnRet
O=NULL
Release O
Return
*--------- REGION DE FUNCIONES
Function GetModuleHandleA()
Lparameters tcModule As String
*----- Declaration API
Declare Long GetModuleHandleA In Kernel32;
String lpModuleName
*----- Obtenemos modulo
lhModulo = GetModuleHandleA(tcModule)
Clear Dlls GetModuleHandleA
Return lhModulo
EndFunc
Function GetProcAddress()
Lparameters thModule As Long, tcProcName As String
*----- Declaration API
Declare Long GetProcAddress In Kernel32;
Long hModule,;
String lpProcName
*----- Obtenemos un proceso
lhProcess = GetProcAddress(thModule, tcProcName)
Clear Dlls GetProcAddress
Return lhProcess
EndFunc
Function CallWindowProc()
Lparameters tpPrevWndFunc As Long, tnhWnd As Long, tnMsg As Long, tnwParam As Long, tplParam As Long
*----- Declaration API
Declare Long CallWindowProc In User32;
Long lpPrevWndFunc,;
String nHWnd,;
Long Msg,;
Long wParam,;
Long lParam
*----- Llamamos a un proceso
nResp = CallWindowProc(tpPrevWndFunc, tnhWnd, tnMsg, tnwParam, tplParam)
Clear Dlls CallWindowProcA
Return nResp
EndFunc
Function GetHeapCreate()
Lparameters tnLenHeap As Integer, tcStrToMemo As String
*----- Declaration API
Declare Long HeapCreate In Kernel32;
Long flOptions,;
Long dwInitialSize,;
Long dwMaximumSize
Declare Long HeapAlloc In Kernel32;
Long hHeap,;
Long dwFlags,;
Long dwBytes
Declare RtlMoveMemory In Kernel32;
Long Destination,;
String @Source,;
Long Length
*----- Cargamos dato a memoria
lhHeap = HeapCreate(0x00040000, tnLenHeap, tnLenHeap)
lpAddr = HeapAlloc(lhHeap, 0, Len(tcStrToMemo)+16)
RtlMoveMemory(lpAddr, tcStrToMemo, Len(tcStrToMemo))
Clear Dlls HeapCreate, HeapAlloc, RtlMoveMemory
Return lpAddr
EndFunc
Function GetHeapAllocPtr()
Lparameters tcStrToPtr As String, tnFlags_Opc As Integer
*----- Declaration API
Declare Long GetProcessHeap In Kernel32
Declare Long HeapAlloc In Kernel32;
Long hHeap,;
Long dwFlags,;
Long dwBytes
Declare RtlMoveMemory In Kernel32;
Long Destination,;
String @Source,;
Long Length
*----- Variables locales
Local lnFlags, lpAddressMem
lnFlags = Iif(Vartype(tnFlags_Opc)=="N", tnFlags_Opc, 0x00000008)
lnFlags = Iif(lnFlags=0, 0x00000008, lnFlags)
lpAddr = 0
*----- Creamos puntero y colocamos datos
lpAddr = HeapAlloc(GetProcessHeap(), lnFlags, Len(tcStrToPtr))
RtlMoveMemory(lpAddr, @tcStrToPtr, Len(tcStrToPtr))
Return lpAddr
EndFunc