sure wont work for me, but it's supposed to.
LPVOID address;
// Get the address of the dword we need to change
_asm mov dword ptr address,offset [myloop+3]
// Ask windows for permission to modify the code
result = VirtualProtect(address,4,PAGE_WRITECOPY,&oldprotect);
// Modify it in assembly.
// This is equivelelent to *(LPLONG)address = 0x87654321
_asm mov ebx,dword ptr address
_asm mov dword ptr [ebx],0x87654321
// All done
result = VirtualProtect(address,4,PAGE_EXECUTE,&oldprotect);
myloop:
_asm mov dword ptr a,0x12345678
LPVOID address;
// Get the address of the dword we need to change
_asm mov dword ptr address,offset [myloop+3]
// Ask windows for permission to modify the code
result = VirtualProtect(address,4,PAGE_WRITECOPY,&oldprotect);
// Modify it in assembly.
// This is equivelelent to *(LPLONG)address = 0x87654321
_asm mov ebx,dword ptr address
_asm mov dword ptr [ebx],0x87654321
// All done
result = VirtualProtect(address,4,PAGE_EXECUTE,&oldprotect);
myloop:
_asm mov dword ptr a,0x12345678