Solved Jump to a specific address and NOP part of code

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat
Status
Not open for further replies.

petruherro

Newbie
Full Member
Mar 10, 2016
17
104
0
HI! I want to jump to a specific address in GTA:San Andreas and stop that part of code from executing.
I've found a function that jumps to a specific address but it seems like i'm using it wrong:

C++:
void PlaceJMP(BYTE *pAddress, DWORD dwJumpTo, DWORD dwLen){
	DWORD dwOldProtect, dwBkup, dwRelAddr;

     // Basic VirtualProtect... y'all should know this
     VirtualProtect(pAddress, dwLen, PAGE_EXECUTE_READWRITE, &dwOldProtect);
    
     // Calculate the "distance" we're gonna have to jump - the size of the JMP instruction
     dwRelAddr = (DWORD) (dwJumpTo - (DWORD) pAddress) - 5;    
   
     // Write the JMP opcode @ our jump position...
     *pAddress = 0xE9;

      // Write the offset to where we're gonna jump
     *((DWORD *)(pAddress + 0x1)) = dwRelAddr; 

     // Overwrite the rest of the bytes with NOPs
     for(DWORD x = 0x5; x < dwLen; x++)
          *(pAddress + x) = 0x90; 

     // Restore the default permissions
     VirtualProtect(pAddress, dwLen, dwOldProtect, &dwBkup);
}
This is the address that i want to jump to: 00B70152
That function increments the seconds that passed (the clock in the corner of the screen)
 

metrix

0x90
Meme Tier VIP
Fleep Tier Donator
Trump Tier Donator
Oct 11, 2013
209
5,828
12
Yep. Just nop at the wanted address.

Opcode for nop is \x90 ... which means you need to count the bytes and write as much nop's you need.

ex.: 90 D0 3C need to be nop'ed with \x90\x90\x90

EDIT: If I read your screen correct you will need 4 nop's
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,074
78,998
2,371
HI! I want to jump to a specific address in GTA:San Andreas and stop that part of code from executing.
I've found a function that jumps to a specific address but it seems like i'm using it wrong:
This is the address that i want to jump to: 00B70152
That function increments the seconds that passed (the clock in the corner of the screen)
I think there is some error in your thought process. Why would you jump to an address that you don't want to execute?

You can NOP the code that you don't want to execute in most cases. If you still need help supply screenshots with captions of everything so we can provide better help
 
Status
Not open for further replies.
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods