Thread: ChangePitch

Results 1 to 14 of 14
  1. #1
    DeadLinez's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    http://mpgh.net Sexy Points: 989,576,420
    Posts
    465
    Reputation
    11
    Thanks
    499
    My Mood
    Psychedelic

    ChangePitch

    Don't Have CA installed atm so cant test it, pretty sure it works. Just bored, opened olly saw, and made it..Thanks
    Code:
    void ChangePitch(float* Pitch)
    {
    	_asm
    	{
    	MOV EAX,3778CF58 //Moving pointer to EAX Register
    	MOV ECX,EAX         //Moving EAX to ECX (We have this because you cant write the pointer directly to the register ECX, With an offset)
    	MOV EDX,ECX+18    //Moving ECX+0x18 to EDX
    	ADD ESP,8             //Adding 0x8 to ESP
    	PUSH Pitch             //Pushing Our pitch
    	PUSH EAX              //Pushing our Pointer
    	CALL EDX               //Calling our shit
    	}
    }
    Last edited by DeadLinez; 07-02-2011 at 10:55 PM.

  2. #2
    CAFlames's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Where ever my imagination takes me
    Posts
    3,014
    Reputation
    202
    Thanks
    2,934
    My Mood
    Twisted
    ehhh Don't have much time to look at this, but why is pitch a char? Shouldn't it be a float?
    Last edited by CAFlames; 07-02-2011 at 09:30 PM.

    Current Works:
    ---Horror Game






    Special thanks to drgnforce9 for my sig picture

    Quote Originally Posted by m_t_h View Post

    CAflames is one epic coder.

    Rep and thanks him.. or you're perma banned.

  3. #3
    DeadLinez's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    http://mpgh.net Sexy Points: 989,576,420
    Posts
    465
    Reputation
    11
    Thanks
    499
    My Mood
    Psychedelic
    oops my bad, supposed to be a float...

  4. #4
    CAFlames's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Where ever my imagination takes me
    Posts
    3,014
    Reputation
    202
    Thanks
    2,934
    My Mood
    Twisted
    Quote Originally Posted by DeadLinez View Post
    oops my bad, supposed to be a float...
    Okay. That's what I thought. Now, if this was voice recognition pitch control, voice char would be fine

    Current Works:
    ---Horror Game






    Special thanks to drgnforce9 for my sig picture

    Quote Originally Posted by m_t_h View Post

    CAflames is one epic coder.

    Rep and thanks him.. or you're perma banned.

  5. #5
    Stewie_Griffin's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Quahog
    Posts
    241
    Reputation
    82
    Thanks
    41
    My Mood
    Tired
    Is this like better version of Pushtoconsole

  6. #6
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,404
    My Mood
    In Love
    Quote Originally Posted by Stewie_Griffin View Post
    Is this like better version of Pushtoconsole
    Not at all
    No I do not make game hacks anymore, please stop asking.


    Been MPGH Minion: 6 July 2011 - 1 August 2012

  7. #7
    DeadLinez's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    http://mpgh.net Sexy Points: 989,576,420
    Posts
    465
    Reputation
    11
    Thanks
    499
    My Mood
    Psychedelic
    Commented for the curious.

  8. The Following User Says Thank You to DeadLinez For This Useful Post:

    Sparkie7 (07-04-2011)

  9. #8
    Ch40zz-C0d3r's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    839
    Reputation
    44
    Thanks
    400
    My Mood
    Twisted
    Quote Originally Posted by Stewie_Griffin View Post
    Is this like better version of Pushtoconsole
    This is ASM code to chnage pitch of ur palyer to aim on things.

    Progress with my game - "Disbanded"
    • Fixed FPS lag on spawning entities due to the ent_preload buffer!
    • Edit the AI code to get some better pathfinding
    • Fixed the view bug within the sniper scope view. The mirror entity is invisible now!
    • Added a new silencer for ALL weapons. Also fixed the rotation bugs
    • Added a ton of new weapons and the choice to choose a silencer for every weapon
    • Created a simple AntiCheat, noobs will cry like hell xD
    • The name will be Disbanded, the alpha starts on the 18th august 2014



    Some new physics fun (Serversided, works on every client)



    My new AI
    http://www.youtube.com/watch?v=EMSB1GbBVl8

    And for sure my 8 months old gameplay with 2 friends
    http://www.youtube.com/watch?v=Na2kUdu4d_k

  10. #9
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    833
    My Mood
    Twisted
    Quote Originally Posted by DeadLinez View Post
    Don't Have CA installed atm so cant test it, pretty sure it works. Just bored, opened olly saw, and made it..Thanks
    Code:
    void ChangePitch(float* Pitch)
    {
    	_asm
    	{
    	MOV EAX,3778CF58 //Moving pointer to EAX Register
    	MOV ECX,EAX         //Moving EAX to ECX (We have this because you cant write the pointer directly to the register ECX, With an offset)
    	MOV EDX,ECX+18    //Moving ECX+0x18 to EDX
    	ADD ESP,8             //Adding 0x8 to ESP
    	PUSH Pitch             //Pushing Our pitch
    	PUSH EAX              //Pushing our Pointer
    	CALL EDX               //Calling our shit
    	}
    }
    Unless you're working on a 16 bit machine or a very old compiler there's no reason why you can't use ANY register (even the stack registers) to write offsets and pointers. Also ADD ESP,8 before you're pushing your data can have bad effects, for all you know you're overwriting the return address or other important data.

    Code:
     MOV EDX,ECX+18
    No compiler and/or assembler worth it's name is going to allow this statement. I assume it means mov edx, [ecx+18h]

    Having said that, here's an improved version:

    Code:
    void ChangePitch(float* Pitch)
    {
    	_asm
    	{
    	MOV EAX,3778CF58  //Moving pointer to EAX Register
    	MOV EDX, eax          //mov pointer to edx
    	PUSH Pitch              //Pushing Our pitch
    	PUSH EAX               //Pushing our Pointer
    	CALL [EDX+18h]      //Calling our shit
    	ADD ESP,8              //Adding 0x8 to ESP
    	}
    }
    if mov ebx, ecx+18 instead assembles to mov edx, ecx add edx, 18h, the code would look like this:

    Code:
    void ChangePitch(float* Pitch)
    {
    	_asm
    	{
    	MOV EAX,3778CF58  //Moving pointer to EAX Register
    	MOV EDX, eax          //mov pointer to edx
            ADD EDX, 18h           // adding 18 h to our pointer to get the function name
    	PUSH Pitch              //Pushing Our pitch
    	PUSH EAX               //Pushing our Pointer
    	CALL EDX               //Calling our shit
    	ADD ESP,8              //Adding 0x8 to ESP
    	}
    }
    Don't take this the wrong way, but I just like to improve everything I see It's great to see that people realize ASM is far better then cpp
    Last edited by .::SCHiM::.; 07-03-2011 at 04:53 AM.

    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. The Following 2 Users Say Thank You to .::SCHiM::. For This Useful Post:

    kibbles18 (07-03-2011),Stephen (07-04-2011)

  12. #10
    kibbles18's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    US
    Posts
    860
    Reputation
    5
    Thanks
    124
    why are we using assembly can we not write directly to the pointer?
    also, some asm questions:
    why do we add 8 to esp register?
    why is there a function at edx? isnt it the pitch value?
    Last edited by kibbles18; 07-03-2011 at 07:30 PM.

  13. #11
    Gordon`'s Avatar
    Join Date
    Dec 2007
    Gender
    male
    Posts
    283
    Reputation
    24
    Thanks
    325
    Quote Originally Posted by kibbles18 View Post
    why do we add 8 to esp register?
    why is there a function at edx? isnt it the pitch value?
    calling convention is cdecl, that means you need to fix the stack after calling the function. functionparameters * 4 = 8

    Code:
    PUSH Pitch              //push second parameter
    PUSH EAX               //push first parameter
    CALL [EDX+18h]      //call
    ADD ESP,8              //fix stack, parameters*4 = 8
    edx holds the pointer.


  14. The Following User Says Thank You to Gordon` For This Useful Post:

    kibbles18 (07-04-2011)

  15. #12
    kibbles18's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    US
    Posts
    860
    Reputation
    5
    Thanks
    124
    do all functions use the cdcel calling convention?
    and esp is the stack pointer, rite? so your making sure the next pop or w/e dosent accidently get what we pushed?
    Last edited by kibbles18; 07-04-2011 at 11:25 AM.

  16. #13
    stshock's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    47
    Reputation
    10
    Thanks
    2
    My Mood
    Bored
    what does this do

  17. #14
    Stephen's Avatar
    Join Date
    Jun 2009
    Gender
    male
    Location
    Engine.exe
    Posts
    4,690
    Reputation
    184
    Thanks
    1,147
    My Mood
    Aggressive
    Quote Originally Posted by stshock View Post
    what does this do
    Read the title ./fp