1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Q]My Converted Script

Discussion in 'Programming' started by Razz, Aug 5, 2010.

  1. Razz

    Razz Dedicated Supporter Dedicated Donor

    Hai all

    I converted this script from AA to C++ but im not 100% it's correct but it's a easy script but i can fail on the easiest thing.

    ASM:
    Code (Text):
    1.  
    2. [enable]
    3. 00A54D3C:
    4. db 00
    5. [disable]
    6. 00A54D3C://01 00 00 00 E8 ? ? ? 00 8D 8E ? ? 00 00 E8 ? ? ? FF 5E C3
    7. db 01
    8.  
    C++:
    Code (Text):
    1.  
    2. void NoAranMovement (hWnd HWND)
    3. {
    4. {
    5. DWORD MovementAddy = 0x00A54D3C;
    6. *(*BYTE)MovementAddy = 0x01;
    7. {
    8. *(*BYTE)MovementAddy = 0x00;
    9. }
    10. }
    11. }
    12.  
     
  2. [D.R.T]

    [D.R.T] (҂ `з´ ).︻╦̵̵̿╤── Coder Donor

    While I did not read the thread sorry seems to be correct
     
  3. Razz

    Razz Dedicated Supporter Dedicated Donor

    Okay thnx ;D
     
  4. DarkSpace

    DarkSpace Well-Known Member Coder

    yea but why so many {{{ }}}

    from what i can understand when you activate the script its gonna change it to 0x01 and then 0x00.

    to just activate the script you dont need all of those things

    for example to activate you just need the activation bytes
    Code (Text):
    1.  
    2. void noMove()
    3. {
    4. DWORD examplePointer  = 0x555555;
    5. *(BYTE*)examplePointer = 0x00;  //changes the 1st byte to 00
    6. }
    7.  
    to deactivate the thing you could lets say add a condition to the function
    like so
    Code (Text):
    1.  
    2. void NoMove(bool enable)
    3. {
    4. DWORD examplePointer = 0x555555;
    5. if(enable)
    6. {
    7. *(BYTE*)examplePointer = 0x00;
    8. }
    9. else //if false
    10. {
    11. *(BYTE*)examplePointer = 0x01;
    12. }
    13. }
    14.  
    15. //how to use.
    16. //NoMove(true) to activate
    17. //NoMove(false) to deactivate
    18.  
    Hope it helps
     
  5. Razz

    Razz Dedicated Supporter Dedicated Donor

    Im still a big noob at this but soon i get the book. The programming language C++(1k pages) so then i will learn yay ;D. But for now i like to do it this way ;)
     
  6. GroundZero

    GroundZero LOL Banned Coder Donor

    Neru if you have more then one byte to write in one addy use *(word*)
     
  7. Razz

    Razz Dedicated Supporter Dedicated Donor

    I know but that's just one byte.
    Word = 2 bytes
    DWORD = 4 bytes right?
     
  8. King Virus

    King Virus Banned Banned

    Sorry to jack ur thread Neru, hope you don't mind.

    ASM
    Code (Text):
    1.  
    2. // no knockback v62
    3. [ENABLE]
    4. 0087EA8B: //0F 85 ?? ?? ?? 00 8B ?? ?? ?? 00 00 8B 01 FF 50 04 84 C0 74
    5. db 0F 84
    6.  
    7. [DISABLE]
    8. 0087EA8B:
    9. db 0F 85
    C++
    Code (Text):
    1. //Enable
    2.  
    3. void NoKnockback ()
    4. {
    5. DWORD MovementAddy = 0x000087EA8B;
    6. *(*BYTE)MovementAddy = 0x0F 84
    7. }
    8.  
    Code (Text):
    1. //Dissable
    2.  
    3. void NoKnockback
    4. {
    5. DWORD Movementaddy = 0x0087EA8B
    6. if (enable)
    7. {
    8. *(BYTE*)NoKnockback = 0x0F 84
    9. }
    10. else
    11. {
    12. *(BYTE*)NoKnockback = 0xdb 0F 85
    13.  
    Am I doing this right or am I doing something wrong, please let me know.
    Again, sorry Neru for jacking ur thread, if u dont want it i'll remove it. :-)
     
  9. GroundZero

    GroundZero LOL Banned Coder Donor

    i mean its wrong I think this is right.

    I only forgot how to sort the Bytes after the 0x.
    Thx to Naz who teach me that

    Code (Text):
    1. void NoKnockback
    2. {
    3. DWORD dwMovementaddy = 0x0087EA8B;
    4. if (enable == true)
    5. {
    6. *(WORD*)dwNoKnockback = 0x840F;
    7. }
    8. else
    9. {
    10. *(WORD*)dwNoKnockback = 0x850F;
    11. }
    12. }
     
  10. Brandon

    Brandon New Member

    Err, why make two functions?

    Code (Text):
    1. ULONG_PTR ulMovementBase = 0x00A54D3C;
    2.  
    3. VOID ToggleHack(__in BOOL bToggle)
    4. {
    5.   *(LPBYTE)ulMovementBase = (bToggle ? 0x00 : 0x01);
    6. }
    7.  
    8. // To enable: ToggleHack(TRUE);
    9. // To disable: ToggleHack(FALSE);
    (edit) My bad, Piaggio's works great too.
     
  11. King Virus

    King Virus Banned Banned

    Thanks Piaggio & Brandon,

    Still new to converting ASM > C++.
     

Share This Page