ehhh Don't have much time to look at this, but why is pitch a char? Shouldn't it be a float?
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 09:55 PM.
ehhh Don't have much time to look at this, but why is pitch a char? Shouldn't it be a float?
oops my bad, supposed to be a float...
Is this like better version of Pushtoconsole
Commented for the curious.
Sparkie7 (07-03-2011)
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
https://www.youtube.com/watch?v=EMSB1GbBVl8
And for sure my 8 months old gameplay with 2 friends
https://www.youtube.com/watch?v=Na2kUdu4d_k
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.
No compiler and/or assembler worth it's name is going to allow this statement. I assume it means mov edx, [ecx+18h]Code:MOV EDX,ECX+18
Having said that, here's an improved version:
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 PUSH Pitch //Pushing Our pitch PUSH EAX //Pushing our Pointer CALL [EDX+18h] //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 cppCode: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 } }
Last edited by .::SCHiM::.; 07-03-2011 at 03: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
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 06:30 PM.
calling convention is cdecl, that means you need to fix the stack after calling the function. functionparameters * 4 = 8
edx holds the pointer.Code:PUSH Pitch //push second parameter PUSH EAX //push first parameter CALL [EDX+18h] //call ADD ESP,8 //fix stack, parameters*4 = 8
kibbles18 (07-04-2011)
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 10:25 AM.