View previous topic :: View next topic |
Author |
Message |
The_Unnamed How do I cheat?
Reputation: 0
Joined: 07 Jan 2008 Posts: 3
|
Posted: Mon Jan 07, 2008 7:12 am Post subject: I can't quite understand what I'm doing wrong |
|
|
First off I finally decided to join these forums after spending a couple of days halfass looking around them. Looks mostly good so far. Anyway I've been messing around with Crimsonland lately and rather than freeze my ammo or nop out the code that decreases it I would rather just like to be able to preload my gun. What I refer to when I say preloading would be adding the clip size of the gun to the current amount of ammo that I have left in the clip. So I checked what writes to the amount of ammo currently in the clip and then I loaded that little snippet of code into the auto assembler thing. Using my complete lack of knowledge of assembly I just briefly checked a tutorial on these forums and came up with something that looked to me like it would work.
Code: | alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
004150CA:
jmp newmem
nop
returnhere:
newmem: //this is allocated memory, you have read,write,execute access
//place your code here
push ebx //I didn't want to overwrite it since i don't know what's in it
mov ebx,[0048E858] //this is the address for the clip size
add [0048E860],ebx //added clip size to ammo already in clip
pop ebx
originalcode:
//mov [edi+000002c0],eax
exit:
jmp returnhere |
Both the clip size and the amount of ammunition currently in the clip are float values which I think probably has something to do with my unexpected results. When inject it and reload my weapon I end up with an empty clip. After reloading several more times I end up with a little more than what would be a full clip. One more reload after that and it's back to an empty clip. Another and I'm back to an empty clip. When I continue reloading many times it will go back and forth between empty and an amount of ammo that steadily increases the more times that i reload.
If you can tell me why this is happening and what I can do to correct it I'd be much obliged.
|
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Mon Jan 07, 2008 7:56 am Post subject: |
|
|
My guess would be the game reads something like 4 bytes and your value reached 5+ bytes, so instead of having max ammo (lets say FFFF) you get 10,000. (00 00 00 00 01)
Why don't you just change the value to the max ammo allowed. (Instead of adding and adding and adding untill it reachs 0 again or even an negative number, so if you dont' want a negative number make it smaller than 8000(0000...00's) because then the value is "NOT"ed, I think...)
You can also compare the value of max ammo - size of clip and if its smaller than add that value.
|
|
Back to top |
|
 |
Labyrnth Moderator
Reputation: 10
Joined: 28 Nov 2006 Posts: 6301
|
Posted: Mon Jan 07, 2008 2:56 pm Post subject: |
|
|
First thing i notice about this script is it looks very confusing and one could not really tell what your doing to give a good answer.
If this is the address you found the original code at.
Why does your injection have nothing to do with the original code.
-----------------------------------------------------------------------------------------
I do not see anything related to the original code here. You cant just make up something and hope it will effect the ammo.
Code: |
push ebx //I didn't want to overwrite it since i don't know what's in it
mov ebx,[0048E858] //this is the address for the clip size
add [0048E860],ebx //added clip size to ammo already in clip
pop ebx |
-----------------------------------------------------------------------------------------
If this is the original code, then your not doing anything with it in the script at all.
Code: | mov [edi+000002c0],eax |
|
|
Back to top |
|
 |
rohagymeg Advanced Cheater
Reputation: 0
Joined: 25 Nov 2007 Posts: 57 Location: Hungary
|
Posted: Tue Jan 08, 2008 9:33 am Post subject: PLZ :D |
|
|
Can someone give me a site or something to learn these codes what they are meaning? Like mov eax dword ect. I'd like to understand them to be able to inject codes.
|
|
Back to top |
|
 |
Frost_ONE Advanced Cheater
Reputation: 0
Joined: 03 Jan 2008 Posts: 97 Location: Banished to the point of no return
|
Posted: Tue Jan 08, 2008 11:19 am Post subject: Re: PLZ :D |
|
|
rohagymeg wrote: | Can someone give me a site or something to learn these codes what they are meaning? Like mov eax dword ect. I'd like to understand them to be able to inject codes.  |
mby that's not the right topic but i'd like to know the same thing
_________________
|
|
Back to top |
|
 |
Labyrnth Moderator
Reputation: 10
Joined: 28 Nov 2006 Posts: 6301
|
|
Back to top |
|
 |
The_Unnamed How do I cheat?
Reputation: 0
Joined: 07 Jan 2008 Posts: 3
|
Posted: Wed Jan 09, 2008 9:37 am Post subject: |
|
|
Quote: | I do not see anything related to the original code here. You cant just make up something and hope it will effect the ammo. |
I didn't just make up something and hope it would effect the ammo. The comments in the script were intended to explain what it does but perhaps failed to do so. I did not understand the original code so I just left it out and decided to redo it. The following code accomplishes the exact same thing as the original code yet I understand it entirely.
Code: | push ebx
mov ebx,[0048E858]
mov [0048E860],ebx
pop ebx |
The only difference between that and the script that I thought should have accomplished my purpose is that it is adding to the amount of ammo in the clip rather than just setting it to the clip size as would happen when reloading normally.
It is far from a pressing matter so I will just figure it out myself when I get some free time. Thanks for the input I suppose.
|
|
Back to top |
|
 |
|