Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    ILTClient holds a value itself. In this case it's 0x377ED910, initializing it as a pointer means you can use the reference operator to either change the contents of the address it's holding or simply read it.

    Let's assume that the value of the first 4 bytes at 0x377ED910 equal to 1.
    Let's also assume that it's possible to read what ever is at the address 0x00000001, let's give it the value 10.

    ILTClient = 0x377ED910
    *ILTClient = 1
    **ILTClient = 10

    Why is much better at this... \:

  2. The Following User Says Thank You to Void For This Useful Post:

    Aqollo (10-22-2010)

  3. #17
    Aqollo's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    fasfasfas
    Posts
    44
    Reputation
    10
    Thanks
    3
    My Mood
    Breezy
    @ Kallisti: Im completely a rookie at programming. I just go off internet tutorials. The fact is they do not show examples like these. So I need to ask for help. But I do agree, I will be revisiting tutorials on pointers.

    @why06- I'd like to thank you for helping me with this entire process. I have learned so much it's increadiable. This example really helped.

    Overall- I'd like to thank all of you.

    @Void- Thank you for the information, and your time for that matter as you've helped me alot as well.

    Other then this. I have no more questions other then the Memora ones which were the last two. If someone gets a chance one day it would be great, as the weekend is coming up and I can go over them. Thank you all.

  4. #18
    Kallisti's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,019
    Reputation
    52
    Thanks
    376
    My Mood
    In Love
    *
    **
    ***
    ****
    *****
    ****
    ***
    **
    *

    So many asteriks shet!

    未来が見えなくて怖いから
    未来が見えてしまって悲しいから
    目を閉じて優しい思い出に浸ってしまう




  5. The Following User Says Thank You to Kallisti For This Useful Post:

    Aqollo (10-21-2010)

  6. #19
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Let's turn it into int just to make it more clear for you:

    int a;
    Normal int, nothing special.

    int *b = &a;
    b is a pointer, it points to a. so the value of b is the address of a, while *b gives the value of what is pointed to, thus the value of a.

    int **c = &b;
    c is a pointer to a pointer, so the value of c is the address of b, *c will give you the value of what c points to, which means it gives you the value of b, which is the address of a(does that make sense, if not ill try to rephrase it), so if you want the value of a from c, you'd have to add another star so it looks like **c, which means gimme the value of the object of the pointer i'm pointing to points to(that sounds so messed up >.<)


    so:

    c -> b -> a
    a = 5;
    b = &a;
    *b = a = 5;
    c = &b;
    *c = b = &a;
    **c = *b = a = 5;
    Ah we-a blaze the fyah, make it bun dem!

  7. The Following 2 Users Say Thank You to Hell_Demon For This Useful Post:

    Aqollo (10-22-2010),why06 (10-22-2010)

  8. #20
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by Aqollo View Post
    I'm still stumped ;l

    Code:
    cILTClient *ILTClient;
    
    ILTClient = *(cILTClient**)0x377ED910
    What are the two levels of "indirection" here, this is what I'm not getting clear. Is it that..

    You had already mentioned how ILTClient** itself is 0x377ED910 I remember that...

    So the two astrieks mean:
    initally the address 0x377.. is ILTClient** but the value it holds points to ILTClient* which points to cILTClient?
    Okay, ima have a shot too. Do tell us who's explanation you liked best xD

    Let's invent a hypothetical LTClient class:

    [php]class LTClient
    {
    bool GetGameStatus();
    int RunConsoleCommand(char *szCommand);
    }[/php]

    Now, in game, let's say I have a function that takes the LTClient as a parameter. I do not want to use a new LTClient, but whatever I do I want to modify the current LTClient. To do this, I use a pointer, which points to the real LTClient, rather than a copy of it.

    [php]
    void UpdatePlayerPositions(LTClient * client)
    {
    client->RunConsoleCommand("whatever");

    }
    [/php]

    At this point, we might get the address of the POINTER that tells us (points) where the real LTClient is. Because we've made a hack, we cannot directly access that pointer, and we do not know the address of the original LTClient.

    Therefore, we have to create a pointer to that pointer which will then tell us where the real LTClient is.

    LTClient** = points to the LTClient* that we know, which points to the LTClient whose address we do not know.

    That's why we need 2 levels of indirection. The first level is due to the game, the second is because we need to access something that we don't have direct access to.

  9. The Following 2 Users Say Thank You to freedompeace For This Useful Post:

    Aqollo (10-22-2010),why06 (10-22-2010)

  10. #21
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Basically every variable is a pointer

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  11. #22
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    excellent freedom and HD!
    And SCHIM, while everything can be pointed to not every variable is a pointer. From an ASM point of view all variables are the same, just memory addresses storing values, It's their function or high level behavior that defines them.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  12. #23
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Quote Originally Posted by why06 View Post
    excellent freedom and HD!
    And SCHIM, while everything can be pointed to not every variable is a pointer. From an ASM point of view all variables are the same, just memory addresses storing values, It's their function or high level behavior that defines them.
    That was exactly what I was referring to.
    But if you name a variable in asm: schim dd 0
    schim is just a symbol used by the programmer to reference to a certain address in memory, and thus a pointer right?

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  13. The Following User Says Thank You to .::SCHiM::. For This Useful Post:

    Aqollo (10-23-2010)

  14. #24
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by freedompeace View Post
    At this point, we might get the address of the POINTER that tells us (points) where the real LTClient is. Because we've made a hack, we cannot directly access that pointer, and we do not know the address of the original LTClient.

    Therefore, we have to create a pointer to that pointer which will then tell us where the real LTClient is.

    LTClient** = points to the LTClient* that we know, which points to the LTClient whose address we do not know.

    That's why we need 2 levels of indirection. The first level is due to the game, the second is because we need to access something that we don't have direct access to.
    We can actually ;P remember that the argument passed to the function is a pointer to the original LTClient, and since the value of a pointer is the address pointed to, you could just do something along the lines of "LTClient *pClient = client;"
    then pClient will point to the same thing as client does, thus having a direct pointer to the original LTClient instead of a pointer to a pointer.

    The only reason you might need a pointer to a pointer is if the pointer to the object itself changes as well, this may happen if the pointer is stored in a class, and that class itself gets a new location thus changing the address of the pointer.
    Ah we-a blaze the fyah, make it bun dem!

  15. The Following User Says Thank You to Hell_Demon For This Useful Post:

    Aqollo (10-23-2010)

  16. #25
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    K last but not least you asked me to explain this:
    Code:
    bool Memoria( void * pDest, char * szPatch, size_t sSize ) //Nopping Method
    Memoria is just a fancy way to use memcpy( pDest, szPatch, sSize );
    memcpy essentially will copy a string to a destination. And repeat that string to fill to the size specified.


    pDest is the address you want write over.
    szPatch is a char* or string, but it is important to understand that a c-string is the same thing as a byte array, So what usually is put here are opcodes, which are one byte inside.
    sSize is the number of bytes you want to overwrite with your opcodes you provided in szPatch.

    Using this function is a piece of cake. Using it effectively is a different story. You can patch anything with this, but it is primarily used for code hence the PAGE_EXECUTE_READWRITE you see being passed to VirtualProtect.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  17. The Following User Says Thank You to why06 For This Useful Post:

    Aqollo (10-23-2010)

  18. #26
    Aqollo's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    fasfasfas
    Posts
    44
    Reputation
    10
    Thanks
    3
    My Mood
    Breezy
    As usual more questions besides the ones I sent 2 u in a pm,


    Quote Originally Posted by why06 View Post
    Memoria is just a fancy way to use memcpy( pDest, szPatch, sSize );
    memcpy essentially will copy a string to a destination. And repeat that string to fill to the size specified.
    Just out of curiosity why do we need to fill a size specified by repeating a string?

    Also just another question,
    I'm seeing
    Code:
    bool Memoria( void * pDest, char * szPatch, size_t sSize ) //Nopping Method
    and
    Code:
    memcpy( pDest, szPatch, sSize );
    taking the same paramaters just about but why is Memoria declaring SzPatch and pDest being declared as pointers to a void type( so pointing to something that takes no value or returns no value), and char type .. Also what is size_t for in Memoria.

  19. #27
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Aqollo View Post
    Just out of curiosity why do we need to fill a size specified by repeating a string?
    You don't need to, that just the way memcpy works. It will fill as many bytes as you tell it to one way or another.

    taking the same paramaters just about but why is Memoria declaring SzPatch and pDest being declared as pointers to a void type( so pointing to something that takes no value or returns no value), and char type .. Also what is size_t for in Memoria.
    size_t is an int. YOu can follow its declaration in the Windows header file in VS.
    szpatch is just the array of bytes you want to write at the destination.
    Finally pDest is the address you want to write to. People use void* to point to memory regions of any type since they don't know what could be there. It eleminates some casting don't worry about what it is, just know that is a memory location that must be passed to Memoria.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  20. The Following User Says Thank You to why06 For This Useful Post:

    Aqollo (10-23-2010)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Help]pointers
    By kibbles18 in forum C++/C Programming
    Replies: 6
    Last Post: 12-05-2010, 03:27 PM
  2. [Help]Pointer Address
    By 258456 in forum C++/C Programming
    Replies: 6
    Last Post: 09-03-2010, 12:45 AM
  3. [HELP] Pointer help
    By Gab in forum C++/C Programming
    Replies: 6
    Last Post: 09-01-2010, 12:55 PM
  4. [Help] Pointers n' Values
    By -TM- in forum WarRock - International Hacks
    Replies: 0
    Last Post: 01-13-2008, 03:23 PM
  5. i need some help dealing with warrock pointers
    By shakib in forum Hack Requests
    Replies: 1
    Last Post: 02-11-2007, 12:37 PM