Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool

    A simple LOOP question... really simply

    Hi Amigos,
    i was wondering why we write "(pWeaponMgr + (4*i))". i mean that "4*i" what does it do ? Why we multiply the gun index by 4 ??? bcs the float takes 4 bytes in memory ? if yes... so why we need these 4 bytes in our hacks... ? if no explain me
    Last edited by kmanev073; 03-28-2012 at 01:21 AM.

  2. #2
    Dragon(H)ell's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    703
    Reputation
    154
    Thanks
    4,819
    My Mood
    Angelic
    if i am right cuz you will find that all weapons are *4 in olly



    Right ? @giniyat101

  3. #3
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    thats why.. they are weapon* or something
    all pointers are 4 bytes in 32bit applications so you multiply by 4


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  4. #4
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool
    yes but in my new base i get error ! and i tough that i dont know womething about this but everything is ok wiht the loop

  5. #5
    darlwis's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    228
    Reputation
    33
    Thanks
    53
    My Mood
    Inspired
    Do you get Send Error Report?
    @kmanev073

  6. #6
    ~FALLEN~'s Avatar
    Join Date
    May 2009
    Gender
    male
    Location
    devenv.exe
    Posts
    529
    Reputation
    23
    Thanks
    328
    My Mood
    Inspired
    because a pointer of any size in a 32bit app is 4 bytes, the weapon pointers are in a linked list so u can either do i*4 or go and do the whole list thing with previous current and next, either or same result just coding style preference really

  7. #7
    DaRk's Avatar
    Join Date
    Dec 2010
    Gender
    male
    Location
    MPGH
    Posts
    1,910
    Reputation
    119
    Thanks
    3,986
    My Mood
    Asleep
    yea it just short outs the code so u dont have to do it 600 hundered times
    and the pointer size is 4 bytes so that's why u do 4*i..then then the loop would go by 4 bytes 600 times
    example: 4, 8, C, 10, 14, ,18, 1C, 20

  8. #8
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool
    @DaRk we work in HEX ?????????? if yes this is the prob here i work in int
    @darlwis yes i get send error report but i dont use loops for weaponMgr and i am trying to make it work

    ---------- Post added at 10:56 AM ---------- Previous post was at 10:19 AM ----------

    @Dragon(H)ell , @giniyat101, @~FALLEN~ ,@DaRk , @darlwis and all other memebers of MPGH i made it i made a NON loop base for guns !!!!!!!

  9. #9
    darlwis's Avatar
    Join Date
    Feb 2012
    Gender
    male
    Posts
    228
    Reputation
    33
    Thanks
    53
    My Mood
    Inspired
    @kmanev073
    Use @UltraPGNoob method:
    *(WORD*) (CShell+AAC3D0-0x8);

  10. #10
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool
    Quote Originally Posted by darlwis View Post
    @kmanev073
    Use @UltraPGNoob method:
    *(WORD*) (CShell+AAC3D0-0x8);
    dudemy base works without any loop it worked

  11. #11
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    Quote Originally Posted by kmanev073 View Post
    dudemy base works without any loop it worked
    lolz , some functions can be made by modifing LTPlayerClient stuff like noreload nochange etc
    but i really suggest looping through all weapons
    alternatly you can get index of weapon in hand (LTPlayerClient+0x2DC) and modify it only


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  12. #12
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool
    Quote Originally Posted by giniyat101 View Post
    lolz , some functions can be made by modifing LTPlayerClient stuff like noreload nochange etc
    but i really suggest looping through all weapons
    alternatly you can get index of weapon in hand (LTPlayerClient+0x2DC) and modify it only
    i actally loop trough all weapons but not with a loop i use Recursion even for the feutres whit two loops... and it is undetected

  13. #13
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    Quote Originally Posted by kmanev073 View Post
    i actally loop trough all weapons but not with a loop i use Recursion even for the feutres whit two loops... and it is undetected
    whats recursion? give an example with a code (not related to hack making)


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

  14. #14
    kmanev073's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Bulgaria
    Posts
    2,400
    Reputation
    97
    Thanks
    2,537
    My Mood
    Cool
    Quote Originally Posted by giniyat101 View Post
    whats recursion? give an example with a code (not related to hack making)
    A classic example of recursion is the definition of the factorial function, given here in C code:
    Code:
    unsigned int factorial(unsigned int n) 
    {
      if (n <= 1) 
        return 1;
      else
        return n * factorial(n-1);
    }
    for the fetures with two loops i use two things like this... and i am putting the Gun as argument but still thinking that it can be easer with references
    credits go to: Recursion - Wikipedia, the free encyclopedia
    sory for the outside link but here peoplecan learn something
    Last edited by kmanev073; 03-29-2012 at 01:10 PM.

  15. #15
    giniyat101's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Location
    Not telling.
    Posts
    1,935
    Reputation
    130
    Thanks
    1,380
    My Mood
    Dead
    Quote Originally Posted by kmanev073 View Post
    A classic example of recursion is the definition of the factorial function, given here in C code:
    Code:
    unsigned int factorial(unsigned int n) 
    {
      if (n <= 1) 
        return 1;
      else
        return n * factorial(n-1);
    }
    for the fetures with two loops i use two things like this... and i am putting the Gun as argument but still thinking that it can be easer with references
    credits go to: Recursion - Wikipedia, the free encyclopedia
    sory for the outside link but here peoplecan learn something
    so you made something like that:

    Code:
    void features(DWORD pWeapopnMgr, DWORD index)
    {
        DWORD pWeapon = *(DWORD*)(pWeaponMgr+index*4);
        if (pWeapon)
        {
             //OHK
             *(FLOAT*)(pWeapon+0x7F8) = 99999.0f;
        }
        if (index == 0) return;
        features(pWeaponMgr, index-1);
    }
    and just called features(pWeaponMgr, 600);

    really useless and will just fuck the stack, i dont suggest using it


     



    [img]https://i43.photobucke*****m/albums/e367/DeteSting/Steam-update.gif[/img]

Page 1 of 2 12 LastLast

Similar Threads

  1. [Help Request] Simple Noob Question
    By csimami in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 17
    Last Post: 11-02-2011, 02:31 PM
  2. [Help]Quick Simple Fast Question[Solved]
    By Lyoto Machida in forum Visual Basic Programming
    Replies: 12
    Last Post: 02-07-2011, 12:53 PM
  3. - Simple Texture Question -
    By Silver Ace in forum WarRock Skinning
    Replies: 8
    Last Post: 10-07-2010, 10:31 AM
  4. Simple mod question..
    By caron300 in forum Combat Arms Mod Discussion
    Replies: 2
    Last Post: 09-04-2010, 11:58 AM
  5. simple c++ question
    By BloodSkin in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 13
    Last Post: 08-13-2010, 11:34 PM