Results 1 to 5 of 5

Thread: Call function by location?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Call function by location?

    well in c++ inline asm I wanna call a function based on location like.

    __asm{
    Call 0040001
    }

    instead of doing

    const int loc = 0x0040001;
    __asm{
    call loc
    }

  2. #2
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: Call function by location?

    Code:
    mov eax, 18h
    will set eax to 0x18 so im assuming if you do.....

    Code:
    Call 18h
    it should work Sorry i ain't at home so i cannot verify it but anything is worth a try!
    Last edited by Paul M; Aug 25th, 2007 at 04:58 AM.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: Call function by location?

    Quote Originally Posted by Hell-Lord
    Code:
    mov eax, 18h
    will set eax to 0x18 so im assuming if you do.....

    Code:
    Call 18h
    it should work Sorry i ain't at home so i cannot verify it but anything is worth a try!
    nope

  4. #4
    Member
    Join Date
    Oct 2006
    Posts
    53

    Re: Call function by location?

    The address can not be an immediate value.

    mov eax, 40001h
    call eax

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2005
    Posts
    1,547

    Re: Call function by location?

    Quote Originally Posted by minor28
    The address can not be an immediate value.

    mov eax, 40001h
    call eax
    When compiled it is(for some things)...

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