Help translate code from c++ to LUA :

 ReadProcessMemory(hProcess, (LPVOID)0x00706D54, &lvl, 2, 0); 

I tried in LUA :

 a = DLL.CallFunction("kernel32.dll", "ReadProcessMemory", hProcess..", 7368020, "..lvl..", 2, 0", DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL); 

where hProcess-handle , lvl variable int , but it returns 0 permanently. The whole problem in the issuance of &lvl in LUA .

ps This is the AutoPlay Media Studio syntax that runs on LUA .

    1 answer 1

    Solved a problem. Looked in Delphi before lvl is @. It means that not a variable is needed, but its memory address in which it is written. I created a variable in a specific address and gave the function its address. Everything is working!