View Single Post
  #12  
Old 02-22-2023, 03:25
chessgod101's Avatar
chessgod101 chessgod101 is offline
Co-Administrator
 
Join Date: Jan 2011
Location: United States
Posts: 539
Rept. Given: 2,242
Rept. Rcvd 704 Times in 224 Posts
Thanks Given: 754
Thanks Rcvd at 1,021 Times in 191 Posts
chessgod101 Reputation: 700-899 chessgod101 Reputation: 700-899 chessgod101 Reputation: 700-899 chessgod101 Reputation: 700-899 chessgod101 Reputation: 700-899 chessgod101 Reputation: 700-899 chessgod101 Reputation: 700-899
Hi New_Tiger,
I think it would be easier for people to help you if you were to post the assembly code you were using in x64 to attempt to solve this. Since you only provided the code in 32 bit assembly, we are left only to speculate what the issue could be. Anyway, since you posted the screenshot of what you were doing, it is clear that you were using the wrong calling convention. In x64, parameters are not passed to the WINAPI using the STDCALL convention, but rather a FAST CALL convention. Your code show be something like the following:

MOV ECX, ADDRESS_OF_SECTION
MOV EDX, SIZE_OF_SECTION
MOV r8d, NEW_PROTECT_CONSTANT
MOV r9, Address of an empty dword where the old_protect is returned
CALL VirtualProtect
__________________
"As the island of our knowledge grows, so does the shore of our ignorance." John Wheeler
Reply With Quote
The Following 2 Users Say Thank You to chessgod101 For This Useful Post:
New Tiger (02-22-2023), sh3dow (03-02-2023)