Originally Posted by
Jorndel
Well, that's not all you need to do. First you have to call VirtualProtect and then mov the value in. In my code I made a function that did all this for me. Plus I only used pure assembly instead of all the macros MASM has like the proc declaration. Without it the function I made looks like this:
Code:
push ebp
mov ebp, esp
mov ebx, dword ptr [ebp+8]
mov edx, dword ptr [ebp+0Ch]
mov eax, dword ptr [ebp+10h]
push eax
push ebx
push edx
push offset oldProt
push 40h
push eax
push ebx
call VirtualProtect
pop edx
pop ebx
pop eax
xor ecx, ecx
patch:
mov byte ptr [ebx+ecx], dl
inc ecx
cmp ecx, eax
jne patch
push 0
push oldProt
push eax
push ebx
call VirtualProtect
mov esp, ebp
pop ebp
retn
Anyone that knows ASM can use that if they want as long as they give me credit
If anyone still doesn't believe me I could explain how the function works too.