Page 5 of 5 FirstFirst ... 345
Results 61 to 62 of 62
  1. #61
    gnm's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    My Mood
    Cynical
    I'm just going to say something relevant to the actual detour code, this will most likely crash the game, what you're doing is just reading the first 7 bytes of the function and moving them, at the end of those 7 bytes it could still be half way through an asm call. For example that last 7th byte may be a jmp and the next 4 bytes would be the address, but what you've done is moved that jmp away from the argument so as soon as it hits that in your trampoline function it will assume the next 4 bytes will be the address. Even if it did succeed and jmp'd back to the original function, it will still stuff up because the first thing it will read is the address that was the argument for the jmp, and it will assume those are opcodes and will attempt to execute them.

    There's more information about it under "Extended Code Overwriting" on this page.

  2. #62
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by gnm View Post
    I'm just going to say something relevant to the actual detour code, this will most likely crash the game, what you're doing is just reading the first 7 bytes of the function and moving them, at the end of those 7 bytes it could still be half way through an asm call. For example that last 7th byte may be a jmp and the next 4 bytes would be the address, but what you've done is moved that jmp away from the argument so as soon as it hits that in your trampoline function it will assume the next 4 bytes will be the address. Even if it did succeed and jmp'd back to the original function, it will still stuff up because the first thing it will read is the address that was the argument for the jmp, and it will assume those are opcodes and will attempt to execute them.

    There's more information about it under "Extended Code Overwriting" on this page.
    True, still all functions dont have (dont know the word) But some function finish opcode at the 7th byte :O, leaving it free with no crash
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

Page 5 of 5 FirstFirst ... 345