How can I write this in inline asm? I want to write the value of packet into the memory location of cave in inline asm, how? I can do it with the WriteProcessMemory but I want to get rid of that and replace with asm
int SendToClient(BYTE *packet, int Length)
{
int cave = (int)VirtualAllocEx(hProcess, NULL, Length, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
if (WriteProcessMemory(hProcess, (void*)cave, packet, Length, NULL))
{
}
__asm
{
//how?
}
}
for example, say I wanted to read from the address senderOffset I would do:
int GetSenderID()
{
int value;
__asm
{
mov eax, senderOffset
mov value, eax
}
return *(int*)value;
}
this is doing what "ReadProcessMemory(GetCurrentProcess(), (VOID*)senderOffset, &value, 0) would do, I'm just looking for the same kinda method to "WriteProcessMemory" with inline asm.
memcpy((void*)cave, (void*)packet, length*sizeof(BYTE))- log0