Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,939 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,422 people online right now. Registration is fast and FREE... Join Now!




C++ jnz in Assembly

 
Reply to this topicStart new topic

C++ jnz in Assembly, Low Level functionality

Sacky
4 Jan, 2008 - 04:46 AM
Post #1

New D.I.C Head
*

Joined: 28 Dec, 2007
Posts: 26

I've been interested in code hooking recently, so right now I am testing and I managed to get my function called by the process by modifying the bytes in process. However this is the code I need to emulate:

CODE
cmp     ax, 477                        ; ZR350
jnz     loc_6ACBC7


Now is there a nice easy way to define a location in C++ instead of doing all this calculation in run time? Also is there an opcode that defines which way the jump moves (up or down?)?

At the moment I have this code:

CODE
void __declspec(naked) HookSWATVAN(void)
{
    __asm
    {
        cmp ax,477
        jnz ???
        retn
    }
}


I want to be able to cmp many values to ax rather than just the one, and emulate those features by jumping to appropriate positions in the code, the only problem is I don't know an easy way to do that.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 04:36PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month