Thread: Help calling function is asm

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    61
    Quote Originally Posted by Salem View Post
    I still can't figure out why you're trying to call all these functions using asm?
    It seems like hard work, and you often get it wrong.

    If (and I stress "IF") you get the types right, and the address right, then there is no reason for the function pointer approach to fail.

    For example, how do you know that ZPostShotMelee begins at 00480C70 ?
    Is that address even in the same address space as your program?
    Is it in a DLL, which may relocate to another address?
    Do you have the correct calling convention. There are several on a win32 platform.

    Another question is why don't you have the source code for all of these asm functions you keep posting.

    Also, how do you know you're getting the right setup/teardown sequence? It seems to me you're just calling things at random. It's a bit like calling fread() without calling fopen() first kinda thing.

    Are you trying to hack a game to give yourself some magic powers which normal people won't have? That's what I read into the snippets you've posted so far.
    Because you can't call them without asm. And yes I'm sure the address is right.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by brietje698 View Post
    Because you can't call them without asm. And yes I'm sure the address is right.
    Why not?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    61
    Quote Originally Posted by matsp View Post
    Why not?

    --
    Mats
    Because I tried it and it didn't work.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by brietje698 View Post
    Because I tried it and it didn't work.
    Ok, so why does it then NOT work when you do it in assembler? Perhaps there is something ELSE that is wrong?

    I have used "creative use" of function pointers, like what is described in a previous post. It works. But of course, if you pass in the wrong value, or in the wrong way, then you will end up with any sort of "bad" result.

    What is the actual crash you are seeing?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    61
    Quote Originally Posted by matsp View Post
    Ok, so why does it then NOT work when you do it in assembler? Perhaps there is something ELSE that is wrong?

    I have used "creative use" of function pointers, like what is described in a previous post. It works. But of course, if you pass in the wrong value, or in the wrong way, then you will end up with any sort of "bad" result.

    What is the actual crash you are seeing?

    --
    Mats
    The game gives me an error report message.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by brietje698 View Post
    The game gives me an error report message.
    And the contents of that error report is?

    And is that different from what happens when you make the call in C or Assembler? [E.g is the address the same, same register content, etc, etc or are the values/addresses different]?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Registered User
    Join Date
    Jul 2007
    Posts
    61
    Quote Originally Posted by matsp View Post
    And the contents of that error report is?

    And is that different from what happens when you make the call in C or Assembler? [E.g is the address the same, same register content, etc, etc or are the values/addresses different]?

    --
    Mats
    The error report are strange character, and I get it by using C and Asm.
    Addresses and values are same.

  8. #8
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Quote Originally Posted by brietje698 View Post
    Because you can't call them without asm. And yes I'm sure the address is right.
    I'd be surprised if the address is right. You should be jumping to address Gunz.0x00478890 or ZPostShotSpAddress, certainly not 0x00478890.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  3. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  4. calling function in asm
    By brietje698 in forum C++ Programming
    Replies: 10
    Last Post: 11-29-2007, 02:07 PM
  5. Replies: 28
    Last Post: 07-16-2006, 11:35 PM