CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008
    Location
    San Francisco, USA
    Posts
    24

    how to jmp to the function?

    hello:
    i am new in assembly language, and i want to test the "jmp" instruction, try to jmp to the function that i define, and failed. what's wrong with my code?
    here's the code:

    using wxDevC++, windows xp sp3
    Code:
    void ShowMessage();
    int main(int argc, char *argv[])
    {  
        
      printf("%p",ShowMessage);
      printf("\n");
     asm(
          "jmp 0x00401332;"       
       );
      //  0x00401332 is ShowMessage address 
    
    system("PAUSE");	
        return 0;
    
    }
    
    void ShowMessage()
    {
        MessageBox (0, "ShowMessage()!\n", "Hi", MB_ICONINFORMATION);
        
    }

  2. #2
    Join Date
    May 2010
    Posts
    13

    Re: how to jmp to the function?

    Did you try to include libraries for assembly operations in this language you are using? Something like asm.h maybe? Just try this link <http://hte.sourceforge.net/doxygenized-0.8.0pre1/asm_8h.html>. It might help.

  3. #3
    Join Date
    May 2010
    Posts
    13

    Re: how to jmp to the function?

    Or <stdio.h> also to be sure.

  4. #4
    Join Date
    May 2010
    Posts
    13

    Re: how to jmp to the function?

    Here's another link: <http://www.digitalmars.com/ctg/ctgInlineAsm.html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured