
Originally Posted by
jameshk67
i am not saying the websites but if you google it, its all over and its basic writeproccessmemory try learning with e-books theres some on this website if you search as hard as that source you should find

Okay, I guess I'll explain how all of it works then even though I'm pretty sure your just trolling. My function takes 3 arguments which are:
Code:
mov ebx, dword ptr [ebp+8]
mov edx, dword ptr [ebp+0Ch]
mov eax, dword ptr [ebp+10h]
[ebp+8] is the first, which is the memory address
[ebp+0Ch] is the second, which is the opcode you want to write
[ebp+10h] is the third, which is the number of bytes what you want to write
next you push eax, ebx, and edx onto the stack to preserve them because they get changed during the call to the VirtualProtect. After the call you pop them back off the stack.
Next is the loop that patches the address you chose. I wrote mine with a loop so that if for example I wanted to nop out 6 bytes I could do it in one call. The loop first uses an xor ecx, ecx to set ecx to 0, which will act as our counter for the loop. Then it uses a mov to write the opcode into the address.
Code:
mov byte ptr [ebx+ecx], dl
ebx is the address that we passed in and ecx is the counter that uses inc to increase by one every time it goes through the loop. edx is the byte we wanted to write, but because this is a 1 byte patch we need to use the 8 bit part of edx which is dl.
Next we compare ecx and eax with cmp ecx, eax. eax is the number of bytes we passed in. So, it checks if we have written enough bytes to exit our loop. If not, it jumps back up to the label called patch. If it is it restores the old protection with another call to VirtualProtect and then exits the function.
There, are you happy now?