A simple LOOP question... really simply

Posts 1–15 of 21 · Page 1 of 2
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
if i am right cuz you will find that all weapons are *4 in olly



Right ? @giniyat101
thats why.. they are weapon* or something
all pointers are 4 bytes in 32bit applications so you multiply by 4
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
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
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
@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 !!!!!!!
Quote Originally Posted by darlwis View Post
@kmanev073
Use @UltraPGNoob method:
*(WORD*) (CShell+AAC3D0-0x8);
dudemy base works without any loop it worked
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
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
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)
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
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
Posts 1–15 of 21 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us