Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


I've got this ASM code, not my language, tiny help?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
thethiny
Cheater
Reputation: 0

Joined: 01 Apr 2012
Posts: 38
Location: earth

PostPosted: Thu Aug 06, 2015 8:15 pm    Post subject: I've got this ASM code, not my language, tiny help? Reply with quote

So I ran an API monitor to track file loads, and I was able to make my hack using the tool. However I want to convert that hack to Cheat Engine, so I ran pointer checks and found none, even at levels as high as 20 with 8192 maximum, still nothing. So I used the address I've found in API Monitor for the file loaded and tracked what writes to it and found this:
i.imgur. com/SYBf2cL.png
The game goes as following:
-Write the Character Package Loaded into this address.
-Load the Package.
-Move over to the next Costume then Display it.

in API Monitor, I was able to replace "Assets\Character" with "Mods\Character" to load the characters from a different folder under a different name. But in cheat engine, I don't know how to do that using ASM, also using breakpoints crashes the game rather than actually breaking points.

Any help please?


In case anyone is wondering, this is a 64Bit App, Mortal Kombat X.
Back to top
View user's profile Send private message
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Fri Aug 07, 2015 4:22 pm    Post subject: Reply with quote

Im a little unclear what your asking.
A pointer is a address in the game code that tracks a random(ish) memory location start.

Basically you have MKX.exe and in its code it has a line of code that says im writing all my memory PERTAINING to character load here 123456789. That is the address you need to search for not the address of the code you found.

From that base address of 12345678, you add an offset to your pointer entry to modify the value you need.

After looking at your picture I would probably start with the RCX value of the bottom picture. Also you prolly want to look for string data if you are loading DATA from a different hard disk LOCATION. That is easily modified with a text entry and will unlikely require a POINTER.
Back to top
View user's profile Send private message
thethiny
Cheater
Reputation: 0

Joined: 01 Apr 2012
Posts: 38
Location: earth

PostPosted: Sat Aug 08, 2015 2:25 am    Post subject: Reply with quote

What I'm trying to do is replace the string with a different one, I can do that using CE and it works fine, my problem is finding the pointer, or I mean the Base Address, so that it works whenever I restart the game instead of rescanning, since that wouldn't work I just want to make a script that replaces \Assets with \MODS for example everytime it finds a custom string. Besides I don't know what RCX and these stuff mean so I don't understand what's in my picture at all.
Back to top
View user's profile Send private message
akumakuja28
Master Cheater
Reputation: 16

Joined: 28 Jun 2015
Posts: 432

PostPosted: Sun Aug 09, 2015 9:40 pm    Post subject: Reply with quote

Ok, so there is a couple option you have here.

Find your code then click browse this memory region.

Find another value in memory editor thats blinking red that very close and ABOVE to your CODE/string/text and find out what access's that address. In the new window click on more information button. In the middle of the screen it will say the pointer for this is probably 46373???????.

Write that value down somewhere and then goback to ACCESS window and click the same opcode and click the button on the right that says show in dissambler. You will now have the opcode location for that memory sector.
DO NOT CLOSE THE DISASSBLER.
Right click on the opcode and select what writes/access or something along those lines you know have a new window add one those addresses to your cheat list.

Go to your cheat list and right click /find pointer on the address you just added. Type the value that you written down. And scan.

If you get no results try the same PROCESS over in a different memory location.

33. Now that you have pointer results. Restart your game and close all the access windows exept memory editor and pointer scan do not close memory editor do not close memory editor. Open the game and get to the same place game you Scan for your code. Right click on the SAME opcode in the memory editor and click what access/writes too. You will get a new window add that code and right click and click browse memory location. Look forYOUR text string in the bottom window.

If you found it Awesome your on the right track
If not start at step one. BLOWS.

Now right click and find what accesss the code you just added find that same op code in the new window that matches your memory browser and click the more information button to the right. Write down that middle address again.

Go back to your pointer scan window and select the last drop menu option and click the rescan. Type the new address that you just written down in there. Now rescan and repeat from step 33.

After awhile you will get to reasonable amout of pointers. Add a dozen or so to your list and double check which ones give a dynamic memory start value everytime.

Then when your satisfied with a certain pointer. Right click on that pointers VALUE and GOTO the memory editor bottom window and goto that VALUE which is an address. Now find out what the starting address of your CODE is write it down. Type the value you written down in your windows calc in hex mode and minus the pointer VALUE. Thats your offset. Now copy and paste the pointer in question and double click the address, press add offset button and type in the value of your calculator.

Congratulations you made a pointer
Back to top
View user's profile Send private message
thethiny
Cheater
Reputation: 0

Joined: 01 Apr 2012
Posts: 38
Location: earth

PostPosted: Mon Aug 10, 2015 12:35 am    Post subject: Reply with quote

Well, thanks but that didn't work, there is no blinking red anywhere :\
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Mon Aug 10, 2015 2:45 am    Post subject: Reply with quote

Hey

Since you said you can manually edit it in CE I am guessing the variable is read every time.
So why don't you "make find out what accesses the variable" that you replace, see how many opcodes read it and find the opcode that is really determining the loaded file.
Once that is done, you hook this opcode either to load the same file all the time (but your file now) either to take that information from another memory location (a code cave for example) where you always can store the file you want loaded.
You can code a .exe that writes into the program memory and hooks the reading string function
Back to top
View user's profile Send private message
thethiny
Cheater
Reputation: 0

Joined: 01 Apr 2012
Posts: 38
Location: earth

PostPosted: Mon Aug 10, 2015 5:49 am    Post subject: Reply with quote

ulysse3131 wrote:
Hey

Since you said you can manually edit it in CE I am guessing the variable is read every time.
So why don't you "make find out what accesses the variable" that you replace, see how many opcodes read it and find the opcode that is really determining the loaded file.
Once that is done, you hook this opcode either to load the same file all the time (but your file now) either to take that information from another memory location (a code cave for example) where you always can store the file you want loaded.
You can code a .exe that writes into the program memory and hooks the reading string function


Exactly, but I don't know how to do any of that unfortunately. I do know that the code is indeed read everytime and I do know it's value at any given instance. Would you be kind enough to tell me how that's done? Maybe a chat or something if possible?
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Mon Aug 10, 2015 6:19 am    Post subject: Reply with quote

You need to :
1) right click your string variable and "find out what accesses".

2) You will probably see several codes (if you see only one it's the easiest possibility but unlikely) and there are chances the variable being read then rewritten with the same value (if that if the case you will see 2 or more codes).
So here you need to determine which is the code that is reading your variable (it will be a code that is something like mov register,[register+xx]
with register being one of eax ebx ecx etc... and xx being in a 00 to FF range.
The brackests must be on the right side of the opcode ie they must affect right operand that means your value is being read (it" important you understand that).

3)Now you use tool of cheat engine in memory window and you scan for code cave. Any code cave will do, you chose one and you write the adress on paper, you will need it later.


4) once you have determined that code your click follow in dissassembler, you click on the opcode line and you press ctrl +A then ctrl +I. ctrl+A opened assemble window and ctrl +I is a great time saving tool that basicly makes inserting code that much easier (Thank you Dark Byte you are brilliant).
There you replace the existing code that is preinserted by ctrl+I, you will find it at "originalcode:"
Remember " mov register,[register+xx]" ?
you replace the register+xx into bracket by the memorycave adress you chose. now you simply edit the memory code cave adress and it's the value that will be read.

I should have mentioned that concerning " mov register,[register+xx]" it is unlikely yet possile that you see a memory adress into the bracket, something like mov register,[02435678] if that is the case you replace the 8 digits by your code cave adress.

It is possible that modifying the game's code makes your game crash after 1 or 2 mins if the game has protections, if that is the case do not worry there are easy ways around this.

You can add my skype if you need quicker info : Atlhe0 (the last character is the digit 0)
Back to top
View user's profile Send private message
thethiny
Cheater
Reputation: 0

Joined: 01 Apr 2012
Posts: 38
Location: earth

PostPosted: Mon Aug 10, 2015 6:30 am    Post subject: Reply with quote

ulysse3131 wrote:
You need to :
1) right click your string variable and "find out what accesses".

2) You will probably see several codes (if you see only one it's the easiest possibility but unlikely) and there are chances the variable being read then rewritten with the same value (if that if the case you will see 2 or more codes).
So here you need to determine which is the code that is reading your variable (it will be a code that is something like mov register,[register+xx]
with register being one of eax ebx ecx etc... and xx being in a 00 to FF range.
The brackests must be on the right side of the opcode ie they must affect right operand that means your value is being read (it" important you understand that).

3)Now you use tool of cheat engine in memory window and you scan for code cave. Any code cave will do, you chose one and you write the adress on paper, you will need it later.


4) once you have determined that code your click follow in dissassembler, you click on the opcode line and you press ctrl +A then ctrl +I. ctrl+A opened assemble window and ctrl +I is a great time saving tool that basicly makes inserting code that much easier (Thank you Dark Byte you are brilliant).
There you replace the existing code that is preinserted by ctrl+I, you will find it at "originalcode:"
Remember " mov register,[register+xx]" ?
you replace the register+xx into bracket by the memorycave adress you chose. now you simply edit the memory code cave adress and it's the value that will be read.

I should have mentioned that concerning " mov register,[register+xx]" it is unlikely yet possile that you see a memory adress into the bracket, something like mov register,[02435678] if that is the case you replace the 8 digits by your code cave adress.

It is possible that modifying the game's code makes your game crash after 1 or 2 mins if the game has protections, if that is the case do not worry there are easy ways around this.

You can add my skype if you need quicker info : Atlhe0 (the last character is the digit 0)


I've found these opcodes:
Code:
7FF7CB95E3D4 - 0F29 42 80  - movaps [rdx-80],xmm0
7FF7CB95E3DC - 0F29 4A 90  - movaps [rdx-70],xmm1
7FF7CB8EB890 - 0F28 02  - movaps xmm0,[rdx]
7FF7CB8EB893 - 0F28 4A 10  - movaps xmm1,[rdx+10]
7FFF0A16C89C - 49 8B C8  - mov rcx,r8
7FFF0A167251 - 41 88 03  - mov [r11],al
7FFF0A16726A - 41 88 1B  - mov [r11],bl
7FFF0A166950 - 66 41 0F74 00  - pcmpeqb xmm0,[r8]
7FFF0A16695E - 66 41 0F74 08  - pcmpeqb xmm1,[r8]
7FFF0A16697B - 66 41 0F74 08  - pcmpeqb xmm1,[r8]
7FFF0A166980 - 66 41 0F74 00  - pcmpeqb xmm0,[r8]
7FFF0A166997 - 44 38 12  - cmp [rdx],r10l
7FFF0A166AAE - 41 0FBE 01  - movsx eax,byte ptr [r9]
7FFF0A166AB8 - 41 80 39 00 - cmp byte ptr [r9],00
7FFF0A166AD4 - 40 73 0D - jae 7FFF0A166AE4
7FFF0A166AE3 - 40 74 BB - je 7FFF0A166AA1
7FFF18FFB7D3 - 80 39 00 - cmp byte ptr [rcx],00
7FFF18FFC1CC - 8A 04 0A   - mov al,[rdx+rcx]
7FFF18FFC1DC - 66 8B 04 0A   - mov ax,[rdx+rcx]
7FFF18FFC1F0 - 8B 04 0A   - mov eax,[rdx+rcx]
7FFF18FFC20F - 48 8B 04 0A   - mov rax,[rdx+rcx]
7FFF18FFC230 - 8A 04 0A   - mov al,[rdx+rcx]
7FFF1F210B86 - 44 38 04 02   - cmp [rdx+rax],r8l
7FFF1F21390E - 41 0FB6 41 17  - movzx eax,byte ptr [r9+17]
7FFF1F21391C - 41 0FB6 41 16  - movzx eax,byte ptr [r9+16]
7FFF1F21392A - 41 0FB6 41 15  - movzx eax,byte ptr [r9+15]
7FFF1F213938 - 41 0FB6 41 14  - movzx eax,byte ptr [r9+14]
7FFF1F213946 - 41 0FB6 41 13  - movzx eax,byte ptr [r9+13]
7FFF1F213954 - 41 0FB6 41 12  - movzx eax,byte ptr [r9+12]
7FFF1F213962 - 41 0FB6 41 11  - movzx eax,byte ptr [r9+11]
7FFF1F213970 - 41 0FB6 41 10  - movzx eax,byte ptr [r9+10]
7FFF1F21397E - 41 0FB6 41 0F  - movzx eax,byte ptr [r9+0F]
7FFF1F21398C - 41 0FB6 41 0E  - movzx eax,byte ptr [r9+0E]
7FFF1F21399A - 41 0FB6 41 0D  - movzx eax,byte ptr [r9+0D]
7FFF1F2139A8 - 41 0FB6 41 0C  - movzx eax,byte ptr [r9+0C]
7FFF1F2139B6 - 41 0FB6 41 0B  - movzx eax,byte ptr [r9+0B]
7FFF1F2139C4 - 41 0FB6 41 0A  - movzx eax,byte ptr [r9+0A]
7FFF1F2139D2 - 41 0FB6 41 09  - movzx eax,byte ptr [r9+09]
7FFF1F2139E0 - 41 0FB6 41 08  - movzx eax,byte ptr [r9+08]
7FFF1F2139EE - 41 0FB6 41 07  - movzx eax,byte ptr [r9+07]
7FFF1F2139FC - 41 0FB6 41 06  - movzx eax,byte ptr [r9+06]
7FFF1F213A0A - 41 0FB6 41 05  - movzx eax,byte ptr [r9+05]
7FFF1F213A18 - 41 0FB6 41 04  - movzx eax,byte ptr [r9+04]
7FFF1F213A26 - 41 0FB6 41 03  - movzx eax,byte ptr [r9+03]
7FFF1F213A34 - 41 0FB6 41 02  - movzx eax,byte ptr [r9+02]
7FFF1F213A42 - 41 0FB6 41 01  - movzx eax,byte ptr [r9+01]
7FFF1F213868 - 41 0FB6 01  - movzx eax,byte ptr [r9]

I've narrowed down the results with only mov to:
Code:
7FFF0A16C89C - 49 8B C8  - mov rcx,r8
7FFF0A167251 - 41 88 03  - mov [r11],al
7FFF0A16726A - 41 88 1B  - mov [r11],bl
7FFF18FFC1CC - 8A 04 0A   - mov al,[rdx+rcx]
7FFF18FFC1DC - 66 8B 04 0A   - mov ax,[rdx+rcx]
7FFF18FFC1F0 - 8B 04 0A   - mov eax,[rdx+rcx]
7FFF18FFC20F - 48 8B 04 0A   - mov rax,[rdx+rcx]
7FFF18FFC230 - 8A 04 0A   - mov al,[rdx+rcx]

Then again I've checked if any direct me to 0x000000fe6c64d8c0 (which is my address that has the value) and found that only this:
Code:
7FFF0A167251 - 41 88 03  - mov [r11],al
does that, and I'm unsure if what I'm doing is correct or not.
I'll add you on skype my username is thethiny (Ridhwan)


Also I've found these code caves with 28 bytes free:
Code:
7FFE0043
7FFE036B
7FFE0406
7FFE0602
Back to top
View user's profile Send private message
ulysse31
Master Cheater
Reputation: 2

Joined: 19 Mar 2015
Posts: 324
Location: Paris

PostPosted: Mon Aug 10, 2015 7:11 am    Post subject: Reply with quote

This is quite a bit of opcodes.
A good thing to do to narrow them down:
Say your file is being read when you press that button, click "find out what accesses" on your variable like before, let it run a few minutes then click the button and check if you see new opcodes and also which previous opcode got their execute timer increased.
Because the right opcode will be one of these.

You're values narrowed down are invalid, I am not sure how you narrowed them down but you've kept writting values (which we dont care about and should exclude straight up) and you have eliminated movzx and stuff that isn't "mov".
Any instruction that is part of the mov family is valid, that includes movzx and so on, what you can exclude is the instructions with brackets on the left operand (which you kept in your narrowed down values) because these are writting the file.

So, a first narrow down could look like this :
Code:

7FF7CB8EB890 - 0F28 02  - movaps xmm0,[rdx]
7FF7CB8EB893 - 0F28 4A 10  - movaps xmm1,[rdx+10]
7FFF0A166AAE - 41 0FBE 01  - movsx eax,byte ptr [r9]
7FFF18FFC1CC - 8A 04 0A   - mov al,[rdx+rcx]
7FFF18FFC1DC - 66 8B 04 0A   - mov ax,[rdx+rcx]
7FFF18FFC1F0 - 8B 04 0A   - mov eax,[rdx+rcx]
7FFF18FFC20F - 48 8B 04 0A   - mov rax,[rdx+rcx]
7FFF18FFC230 - 8A 04 0A   - mov al,[rdx+rcx]
7FFF1F21390E - 41 0FB6 41 17  - movzx eax,byte ptr [r9+17]
7FFF1F21391C - 41 0FB6 41 16  - movzx eax,byte ptr [r9+16]
7FFF1F21392A - 41 0FB6 41 15  - movzx eax,byte ptr [r9+15]
7FFF1F213938 - 41 0FB6 41 14  - movzx eax,byte ptr [r9+14]
7FFF1F213946 - 41 0FB6 41 13  - movzx eax,byte ptr [r9+13]
7FFF1F213954 - 41 0FB6 41 12  - movzx eax,byte ptr [r9+12]
7FFF1F213962 - 41 0FB6 41 11  - movzx eax,byte ptr [r9+11]
7FFF1F213970 - 41 0FB6 41 10  - movzx eax,byte ptr [r9+10]
7FFF1F21397E - 41 0FB6 41 0F  - movzx eax,byte ptr [r9+0F]
7FFF1F21398C - 41 0FB6 41 0E  - movzx eax,byte ptr [r9+0E]
7FFF1F21399A - 41 0FB6 41 0D  - movzx eax,byte ptr [r9+0D]
7FFF1F2139A8 - 41 0FB6 41 0C  - movzx eax,byte ptr [r9+0C]
7FFF1F2139B6 - 41 0FB6 41 0B  - movzx eax,byte ptr [r9+0B]
7FFF1F2139C4 - 41 0FB6 41 0A  - movzx eax,byte ptr [r9+0A]
7FFF1F2139D2 - 41 0FB6 41 09  - movzx eax,byte ptr [r9+09]
7FFF1F2139E0 - 41 0FB6 41 08  - movzx eax,byte ptr [r9+08]
7FFF1F2139EE - 41 0FB6 41 07  - movzx eax,byte ptr [r9+07]
7FFF1F2139FC - 41 0FB6 41 06  - movzx eax,byte ptr [r9+06]
7FFF1F213A0A - 41 0FB6 41 05  - movzx eax,byte ptr [r9+05]
7FFF1F213A18 - 41 0FB6 41 04  - movzx eax,byte ptr [r9+04]
7FFF1F213A26 - 41 0FB6 41 03  - movzx eax,byte ptr [r9+03]
7FFF1F213A34 - 41 0FB6 41 02  - movzx eax,byte ptr [r9+02]
7FFF1F213A42 - 41 0FB6 41 01  - movzx eax,byte ptr [r9+01]
7FFF1F213868 - 41 0FB6 01  - movzx eax,byte ptr [r9]


Now, notice all the brackets on the right ?
That being said, there are many opcodes and stuff like compares and so on complicate thing (mostly I am afraid your game will crash if those opcodes dont see the same values which will happen if you don't reroute all the instructions).

So from here what to do next is all the instructions narrowed down you replace what is in the brackets by a codecave address that points to yours string and you see if this works, if it does it's good.


Another possibility is that you take a simple code such as this one :
"7FFF18FFC1F0 - 8B 04 0A - mov eax,[rdx+rcx] "
you hook it (ctrl +A then CTRL+I) and in the newmem section you write something like this :

lea [CODECAVEADDRESS],[rdx+rdc]

what this does is write in your codecave the value that is the adress that you want to write.
You could see this method as a pointer finder except it does so by hooking the function. [/code]
Back to top
View user's profile Send private message
thethiny
Cheater
Reputation: 0

Joined: 01 Apr 2012
Posts: 38
Location: earth

PostPosted: Mon Aug 10, 2015 7:21 am    Post subject: Reply with quote

I will try that now, but I've found out that the 4 Code Caves are actually read-only, so this means that there are absolutely no usable Code Caves :\
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites