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 


Stealthedit plugin to deal with memory checks (crcbypass)
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon Jan 09, 2012 8:01 pm    Post subject: Reply with quote

Yes, I got the plugin from the author directly, not downloaded it from some random site, this is why you don't see it elsewhere. And because most programmers hate to write manuals or any documentation (it's their nightmare), I have volunteered to make one for it and upload it for a public place with instructions. This is how it ended up on my site.
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Tue Jan 10, 2012 9:49 pm    Post subject: Reply with quote

I was thinking of doing something like this in a much, much more primitive way because I was unable to bypass certain integrity checks, then I remembered seeing something like it here, and it worked! Thanks lots Razz
Back to top
View user's profile Send private message
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Sun Jan 22, 2012 7:05 pm    Post subject: Reply with quote

Hmm, I encountered a strange problem when using this. I'll go straight to the point.

...: jne x
...: <mov ...>
x : <new module which is copied is here>
..
..
..

The problem is that when I stealthedit x, the game crashes. I've even tried jmping straight from the copied x to the original x (i.e. there is no "extra" code deviating from the original other than the jmp) but it still crashes (at some memory location 07a90000 or something like that which isn't even assigned).

Notes:
1) I've used stealthedit in other parts of the game cheating and it worked fine.
2) Game is packed with Thermidia.
3) Stealthediting the previous module (the part before x) works but because of the Thermedia encryption/obfuscation, I can't figure a way to hack the game except directly stealthediting the "x" module.

Any ideas? Sad
Back to top
View user's profile Send private message
scribly
Cheater
Reputation: 1

Joined: 27 Apr 2008
Posts: 36

PostPosted: Sun Jan 22, 2012 11:41 pm    Post subject: Reply with quote

Check the page you are editing
Are there any instructions inside that section that jumpo to memory locations OUTSIDE of the module ?
If so, you have to edit the stealthedited region so that it jumps to the correct location

e.g:
The module is in the range of 00400000 to 008a0000
But in the code you have a "jmp 07a90000" somewhere you must 'repair' that instruction in the stealthedit copy because the relative destination will need to be changed (Just reassemble "jmp 07a90000" manually)


---
And keep in mind: Not ALL pages can be stealthedited. If there is a breakpoint on the code which when executed triggers a jump to another location then that page can not be stealthedited since the breakpoint will never trigger (or be in an invalid address)
Back to top
View user's profile Send private message
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Sun Jan 22, 2012 11:59 pm    Post subject: Reply with quote

Hmm, what you said does make sense and I think it may be applicable to another part of the memory that I tried stealthediting before but would result in instant crashes of the game.

However, for the case I am saying, I think it is a different problem.
As I wrote at the start, I tried placing a jmp back to the original instruction once the exception was called.
So this is how the memory layout would be after editing:
---
ORIGINAL
...: jne x
...: <mov ...>
x : <new module>
..
..
..
---
EDITED
...: jne exception
...: <mov ...>
exception: jmp x
x: <original module>
..
..
..

This was as far as I got to tracing the problem. You can see that no other code is run (unless I am somehow mistaking the way this stealthedit plugin works) besides the jmp back to the original instruction - From my beginner's understanding of assembly, I really don't see how this could affect anything Sad

P.S. the jmp back to the original module was the way I looked at the problem. It's just to show that nothing else is happening (my actual cheat is editing memory somewhere in the middle of the module, but I'm fairly certain fixing this problem would have the same effect on my cheat)
Back to top
View user's profile Send private message
scribly
Cheater
Reputation: 1

Joined: 27 Apr 2008
Posts: 36

PostPosted: Mon Jan 23, 2012 1:46 am    Post subject: Reply with quote

I am not really sure what you are doing or what you mean with "new module"

You are aware that "jne exception" most likely is bigger than the original 2 byte instruction and will overwrite the mov instruction?
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon Jan 23, 2012 2:56 am    Post subject: Reply with quote

Yes, I am a bit confused with your description too. Maybe it would help if you would post the code itself, just that few lines at least.

And the best solution would be to try debugging the code to see where is the error happening and what could be the cause.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Tue Jan 24, 2012 12:36 am    Post subject: Reply with quote

Sorry, I will be more specific this time.
Also, I was referring to "new modules" as that's the term put forth by the plugin - "stealthedit this page (whole module copy)" - but I believe a more precise term would be a "new page".

So after I stealthedit the page, this is what a few lines of code look like in memory...

IN BLACK (unedited code which is just before the new page)
Code:

0484BFFD jne 0484C004 //jne to new page
0484BFFF call 04AA2867


IN BLUE (original code for the new page)
Code:

0484C004 mov eax,[esp+2C]
0484C008 mov ecx,[eax+10]
// ...so on


IN GREEN (edited code for the new page)
Code:

<allocated memory> jmp 0484C004 //right at the start, jmp back to original code
// ...rest of original code, which in my understanding will NEVER run


As I was saying, this was as far as I got into tracing the problem.
I can play the game for a few seconds but after a few steps, windows error: "The instruction at 0x07a90000 referenced memory at 0x07a90000. The memory could not be written." (same error if I stealthedit other parts, so this jmp right back to the original code shows that it has nothing to do with my edit). As scribly pointed out, I also believe somehow the code is jmping to 07a90000; but as you can see from what I give, I don't see how it's possible unless the stealthedit plugin is encountering an error or changing information which eventually crashes the game (I'll admit this one seems the most likely to me due to thermidia, but I just don't know how).

Also, I must confess that not only is the game thermidia packed, it has gameguard in it. For certain reasons I cannot debug the game; however, memory editing has never been a problem for me and I have done so on many previous occasions. I have also used stealthedit successfully in other parts of memory. Also, I know (at least the part I am trying to edit) the code (somewhere in the middle, actually) has to do with the game (I know exactly what it does; it's just a check on whether the character has a certain ability and it can be edited) and is not some gameguard/thermidia check. For these reasons, I don't believe it has anything to do with gameguard (if it did I wouldn't even post it here, so this is just more of a disclaimer).
Back to top
View user's profile Send private message
scribly
Cheater
Reputation: 1

Joined: 27 Apr 2008
Posts: 36

PostPosted: Tue Jan 24, 2012 1:09 am    Post subject: Reply with quote

Does it crash when you use stealthedit without making ANY modifications to the copy's memory ? (green mem)

You have to think about the jumps from other locations and instruction sizes. If EIP enters inside the middle of an instruction, random crashes can happen

Just to reiterate, assume the stealthedit registers a redirect from 0048c000 to 20400000: (That affects everything from 0048c000 to 0048cfff)
When 0484C004 gets executed, it jumps to 20400004 and executes that instead
And when 048c008 gets executed, it jumps to 20400008 and executes that instead
So basically, you could rewrite that jump to 0484C004 to "jmp 20400004" instead (in aa: jmp stealtheditregion+4)

Quote:

<allocated memory> jmp 0484C004 //right at the start, jmp back to original code
// ...rest of original code, which in my understanding will NEVER run

Not sure, do you mean with <allocated memory> the stealthedit allocated memory or your own?
If stealthedit, when 484c008 or bigger is executed, it WILL execute the code after the jmp


Also, stealthedit makes only one copy of the module, even if you have multiple stealthedits. If this is one of those cases where the code is decrypted temporarily and reencrypted when done, that will cause a problem, as the copy won't get decrypted (you can always make your own modified copy)
Back to top
View user's profile Send private message
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Tue Jan 24, 2012 2:01 am    Post subject: Reply with quote

Yes, same problem without any modifications. The jmp was just to illustrate how it seemed like it was crashing without any visible modifications.

But I think I see where you are getting at now.
(Btw <allocated memory> was referring to the copied page, I didn't know how else to put it)

Suppose this is the original page
00xxxxx1 : ...
00xxxxx2 : ...
etc

My understanding of the stealthedit plugin was that it would basically make some kind of exception whenever 00xxxxx1 was called, but it seems I was mistaken and that anywhere from 00xxxxx1 to the end of that page would redirect the flow to the copied page.

That means I was entirely wrong in my approach of thinking that 1 single jmp could show me where the problem was and that only the start of the copied page mattered... sorry, I thought I knew what you were saying at first but I didn't. Darn. And the copied page is huge too Sad
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Tue Jan 24, 2012 3:44 am    Post subject: Reply with quote

Yes, when you use stealthedit, the whole module will be copied (eg the whole exe file or dll) and the whole page will be re-directed to the copy. In the copy, the black parts before and after the green part are just there to make sure to have a 100% copy, but only the green part is executed. If you want to change a code that isn't marked with blue yet, you have to copy that page too and modify the copy.

As I mentioned in the tutorial, if you use stealthedit instruction, even if you put in just 6 bytes for example, the instruction will copy the whole page anyway.

The right method is to manually select the required codes and make a copy of them in the disassembler view (not in AA). If it is not crashing, fine, then stealthedit is not causing error. If it is crashing, well then you need to figure out why, it could be an exception that is in the original (blue) code which is not executed since you use the copy and it is causing a crash. If stealthedit is working, you can write your AA script to do whatever you want, but that is the last part only, when you are sure that not stealthedit itself is causing the problem.
Some protections may detect this plugin, it isn't 100% undetectable, but it is still quite an edge against most detections.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
xeratal
Advanced Cheater
Reputation: 1

Joined: 05 Nov 2005
Posts: 93

PostPosted: Wed Jan 25, 2012 11:30 pm    Post subject: Reply with quote

Hmm, I've more or less given up on this particular hack since it seems impossible for me to do without an undetected way to debug the program, but I was just wondering if you could explain to me how one would normally fix these kinds of crashes (if possible without debugging)?

I did a quick scan, and there were a whole bunch of interrupts (int 3) throughout the page and I thought that was what was crashing the program (I still think it is even if I don't know exactly how), but also when I looked at other parts which I could stealthedit there were just as many interrupts, and I don't really know how they work so... Razz
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Thu Jan 26, 2012 2:43 am    Post subject: Reply with quote

You have to solve the debugging problem. I am sure you will find some solution if you look around on the internet.
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon May 21, 2012 12:08 pm    Post subject: Reply with quote

UPDATE: Added Stealthedit 2 download link and description to the article.
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
Igor
Expert Cheater
Reputation: 1

Joined: 04 Apr 2012
Posts: 145

PostPosted: Mon May 21, 2012 12:47 pm    Post subject: Reply with quote

How to stop stealthedit. means if i select 'stealthedit this page' then it will blue then how do i stop this and restore orignal (black color)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 2 of 6

 
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