E
E
ExistingNickname2019-01-31 16:39:55
C++ / C#
ExistingNickname, 2019-01-31 16:39:55

How to pass arguments to asm code and run it in another process?

There is a code in which you need to pass parameters, as well as get an array of bytes and its length for WriteProcessMemory:

__declspec(naked) void code1337()
{
  __asm
  {
    push ad
    mov eax (param1)
    mov ecx dword ptr (param2)
    mov edi (param3)
    ret
  }
}

What is the best way to do this? I agree on RTFM, if you tell me where to read.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2019-01-31
@jcmvbkbc

What is the best way to do this?

Write the arguments to memory along with the code, load them from memory in a new process at a known offset from the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question