 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Kolkina Newbie cheater
Reputation: 0
Joined: 13 Oct 2012 Posts: 17
|
Posted: Tue Nov 11, 2014 3:02 am Post subject: FNaF 2 - General disassembler help |
|
|
Here's the deal:
FNaF 2 is one large executable file. From what I figure, this should mean that I should be able to locate the functions/assembly operations that modify the variables I want to find, sorta like using the byte scanner to find the location where you want to inject your custom lua script from cheat engine.
Unfortunately, I seem to be unable to find any variables using the normal cheat engine tool, so where I'd normally just find the value -> find the modifying operations -> inject my code, I though maybe I could simply find the function if I looked around for long enough in the disassembler or the memory viewer, but so far I haven't been able to make a system of anything.
I know I have the entire code in the executable, but my question is, what can I do make some sense of it?
Alternatively, since normal value scans don't seem to work, what other options would I have to find the address of the value I seek?
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Tue Nov 11, 2014 3:08 pm Post subject: Re: FNaF 2 - General disassembler help |
|
|
| Kolkina wrote: | | since normal value scans don't seem to work | -Why not? Are you sure?
If you can find the values that you are looking for, you can find the functions that handle those addresses very easily, by simply right-clicking on them to see which instructions read/write to them.
|
|
| Back to top |
|
 |
Kolkina Newbie cheater
Reputation: 0
Joined: 13 Oct 2012 Posts: 17
|
Posted: Tue Nov 11, 2014 4:50 pm Post subject: Re: FNaF 2 - General disassembler help |
|
|
| ++METHOS wrote: | | Kolkina wrote: | | since normal value scans don't seem to work | -Why not? Are you sure?
If you can find the values that you are looking for, you can find the functions that handle those addresses very easily, by simply right-clicking on them to see which instructions read/write to them. |
Well I'm not sure, but it happens in other games as well.
Maybe I'm just worse than I already thought, but I think it constantly changes the address of the values and since I have this problem in other games, I figured it would be wise to learn some tricks beyond value scanning.
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Tue Nov 11, 2014 7:05 pm Post subject: |
|
|
For most games, the addresses will change at each run or load. You can use pointers and injection to overcome this problem.
If you cannot find the values by simply scanning, doing anything beyond that may be pointless. First, try to find the value by scanning, or, at least try to find the value inside of a data structure or similar. If you cannot do that, try to find out why...perhaps change your search method/criteria and/or look to see if there are any anti-cheat mechanisms in place etc..
If you have not already done so, I would advise you to study and complete the CE tutorial.
|
|
| Back to top |
|
 |
Kolkina Newbie cheater
Reputation: 0
Joined: 13 Oct 2012 Posts: 17
|
Posted: Tue Nov 11, 2014 11:57 pm Post subject: |
|
|
| ++METHOS wrote: | For most games, the addresses will change at each run or load. You can use pointers and injection to overcome this problem.
If you cannot find the values by simply scanning, doing anything beyond that may be pointless. First, try to find the value by scanning, or, at least try to find the value inside of a data structure or similar. If you cannot do that, try to find out why...perhaps change your search method/criteria and/or look to see if there are any anti-cheat mechanisms in place etc..
If you have not already done so, I would advise you to study and complete the CE tutorial. |
I've already completed the tutorial. What I meant with changing addresses is that it will constantly recompute the values between each frame and put them into new addresses.
At least, this happens in a lot of games made using other applications, so for instance, in some games, it would constantly save a state and the library used to run the game would load the values in that save.
The reason why I asked was because I had no idea on how to make any sense of the disassembled code since there is a lot of it and I was unable to find help on my googles, so I figured maybe you would be able to give me some keywords or sources to read up on.
|
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Wed Nov 12, 2014 12:54 am Post subject: |
|
|
I think, it would be highly unusual for the address(es) to change at every frame. If code is constantly shifting, the code may be obfuscated. You can check the exe to see if it is packed with encryption or similar.
You can use speedhack to slow the game down, to narrow in on your address/value, but if the address changes at every frame, those efforts will be futile without running in a virtual/emulated environment to allow you to load/save states. If you are able to find the address/value, simply checking to see which instructions access that address should give you what you need to alter the value permanently...regardless of any code-shifting (assuming clean). If the instructions are also shifting at load times, you can utilize AOB inside of your script.
Interpreting the assembly code takes time. You have to learn it, just as you would any other language. That said, however, analyzing that code will not do you much good until you have found the correct location for the code that you are wanting to manipulate. Searching for values is the most efficient way.
|
|
| Back to top |
|
 |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Wed Nov 12, 2014 11:31 am Post subject: Re: FNaF 2 - General disassembler help |
|
|
First thing: I don't mind abbreviations, but please write the name in full at least once; I took me some time to figure you where talking about Five Nights At Freddy's 2... That's really what you were talking about, right? Well I'll make the rest of my post under this assumption.
So anyway, I don't have the full game so I hacked the demo, specifically flashlight battery. Energy is stored as an UNALIGNED* 4 byte integer that starts at -7001 (first night) or -6001 (second night) and increases toward 0. There are 2 instances of that variable (a real and a dummy copy).
*You see the "fast scan - 4 - alignment" on the main window? It means that CE will only scan addresses that are multiples of 4. Usually variables are placed that way because it improves performance, but not in your game, so you've got to turn off fast scan to find flashlight battery.
Otherwise, energy is reallocated when the level is loaded, not at every frame.
I made an AA script to lock energy:
| Code: | [ENABLE]
aobscanmodule(BatteryPatch,FiveNightsatFreddys2_Demo.exe,eb * * * * * * * F7 D1 89 4D F8 F2 0F 10 4D F8 33 C0 eb)
registersymbol(BatteryPatch)
BatteryPatch+2:
mov ecx,#-3000
nop
[DISABLE]
unregistersymbol(BatteryPatch)
BatteryPatch+2:
mov ecx,dword [esi+0000020A] | You'll ofc have to patch the "FiveNightsatFreddys2_Demo.exe" bit, don't know about the rest, but basically you're looking for that bit of code:
| Code: | FiveNightsatFreddys2_Demo.exe+CE18 - 33 C9 - xor ecx,ecx
FiveNightsatFreddys2_Demo.exe+CE1A - F7 D1 - not ecx
FiveNightsatFreddys2_Demo.exe+CE1C - 89 4D F8 - mov [ebp-08],ecx
FiveNightsatFreddys2_Demo.exe+CE1F - F2 0F10 4D F8 - movsd xmm1,[ebp-08]
FiveNightsatFreddys2_Demo.exe+CE24 - 33 C0 - xor eax,eax
FiveNightsatFreddys2_Demo.exe+CE26 - EB 62 - jmp FiveNightsatFreddys2_Demo.exe+CE8A
FiveNightsatFreddys2_Demo.exe+CE28 - F2 0F2C 8E 0A020000 - cvttsd2si ecx,[esi+0000020A]
FiveNightsatFreddys2_Demo.exe+CE30 - 33 C0 - xor eax,eax
FiveNightsatFreddys2_Demo.exe+CE32 - F7 D1 - not ecx
FiveNightsatFreddys2_Demo.exe+CE34 - 89 4D F8 - mov [ebp-08],ecx
FiveNightsatFreddys2_Demo.exe+CE37 - F2 0F10 4D F8 - movsd xmm1,[ebp-08]
FiveNightsatFreddys2_Demo.exe+CE3C - EB 4C - jmp FiveNightsatFreddys2_Demo.exe+CE8A
FiveNightsatFreddys2_Demo.exe+CE3E - 8B 8E 0A020000 - mov ecx,[esi+0000020A] <-------reads battery, doesn't seem to be shared
FiveNightsatFreddys2_Demo.exe+CE44 - F7 D1 - not ecx
FiveNightsatFreddys2_Demo.exe+CE46 - 89 4D F8 - mov [ebp-08],ecx
FiveNightsatFreddys2_Demo.exe+CE49 - F2 0F10 4D F8 - movsd xmm1,[ebp-08]
FiveNightsatFreddys2_Demo.exe+CE4E - 33 C0 - xor eax,eax
FiveNightsatFreddys2_Demo.exe+CE50 - EB 38 - jmp FiveNightsatFreddys2_Demo.exe+CE8A
FiveNightsatFreddys2_Demo.exe+CE52 - 8B 86 02020000 - mov eax,[esi+00000202]
FiveNightsatFreddys2_Demo.exe+CE58 - 83 E8 00 - sub eax,00
FiveNightsatFreddys2_Demo.exe+CE5B - 74 14 - je FiveNightsatFreddys2_Demo.exe+CE71
FiveNightsatFreddys2_Demo.exe+CE5D - 83 E8 02 - sub eax,02
FiveNightsatFreddys2_Demo.exe+CE60 - 74 05 - je FiveNightsatFreddys2_Demo.exe+CE67
FiveNightsatFreddys2_Demo.exe+CE62 - 0F57 C9 - xorps xmm1,xmm1
FiveNightsatFreddys2_Demo.exe+CE65 - EB 16 - jmp FiveNightsatFreddys2_Demo.exe+CE7D
|
Bottom comment: easy way to win this game: start level, pause process with CE, wait about 10mn, resume process -> you won, facedesk.
_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Last edited by Gniarf on Wed Nov 12, 2014 3:05 pm; edited 2 times in total |
|
| Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Wed Nov 12, 2014 2:33 pm Post subject: |
|
|
Nice work, Gniarf. I also find it irritating when people abbreviate without clarification. : /
Like we should all know...
|
|
| Back to top |
|
 |
Kolkina Newbie cheater
Reputation: 0
Joined: 13 Oct 2012 Posts: 17
|
Posted: Sun Nov 16, 2014 1:39 am Post subject: |
|
|
I'm sorry I wasn't clear enough, I will be more careful about abbreviating in the future.
Second, thanks for the clarification Gniarf. I had managed to find some values that could alter the flashlight, but they seemed to have random value offsets and I guess what you say would explain this.
My question is, how do I know when to use fast scan and when not to? I've not seen me having to turn it off before.
|
|
| Back to top |
|
 |
Gniarf Grandmaster Cheater Supreme
Reputation: 43
Joined: 12 Mar 2012 Posts: 1285
|
Posted: Sun Nov 16, 2014 9:22 am Post subject: |
|
|
Good question, to which I don't really have a good answer. IIRC I disabled fast scan after not finding what I wanted with 4byte (un)changed scans, and increased/decreased scans with the "all" datatype.
Another option is to always disable fast scan (there is a setting to keep it always off), this will just make your scans 4x slower and in most games it'll give you a lot of useless results, but you'll save a lot of time when dealing with odd games like this one.
_________________
DO NOT PM me if you want help on making/fixing/using a hack. |
|
| Back to top |
|
 |
Fotka How do I cheat?
Reputation: 0
Joined: 22 May 2020 Posts: 2
|
Posted: Mon Jun 29, 2020 2:24 am Post subject: |
|
|
There is FNAF 2 Download
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|