[Tutorial] How to Build a Hackshield Bypass

11/23/2011 02:50 lolkop#1
This is (hopefuly) going to be an easy to understand tutorial,
which will show you, how to bypass the HackShield included in the official DE Client.

Code:
Warning!: Clients bypassing HackShield are easily detected by the Server,
          since HackShield sends security packets to the server every few
          minutes.

          If you are going to ByPass HackShield,
          you should only use test accounts!
Required Tools:

Step 1: Analyzing
Quote:
To get started, we have to analyze the Client first.
The best of all free analyzing tools is PEiD.

Simply download and unpack it, and drag and drop the Client onto it's GUI.
As you can see, the Client is packed by UPX.

UPX is nothing else than a simple packer. Since it's a free open-source Tool,
you can download it from their sourceforge project site (link posted above)
Step 2: Unpacking
Quote:
UPX is a simple command line based tool. Once you've downloaded and unpacked UPX,
you can simply use a batch file, to unpack the Client.
The Batch-File could look like this:
Code:
upx -d -o TClient_unpacked.exe TClient.exe
(i've attached my batch file to the post)
just put Client, Batch-File, and the UPX-packer into one and the same Dir
and execute the batch file, to get the unpacked client.

copy the "TClient_unpacked.exe" back to the game Dir
and go on with the next step.
Step 3: Reversing (The Harder Part)
Quote:
To start the reversing, we need a Debugger. Since OllyDbg is free and still one of the
best debuggers, i'll use it for this example.

1. Run OllyDbg and drag and drop the "TClient_unpacked.exe" onto it.
2. Open the Executable modules list.
3. Doubleclick the first module, to get into the clients code.
4. Right-Click the code window, and select the "Analyse code" Option.
Code:
once the analyzing is completed, we will have to check, where the HackShiel dll gets loaded.
to do that, we'll simply check each single dll, which gets loaded by the LoadLibraryA function.
5. Rightclick again, and open the modular calls window.
6. Sort the list by calls, and select one of the LoadLibraryA calls, rightlick and select all of them.
Code:
Now all of those Calls should be red marked.
Once that happend, we can run the client using F9.
It will break, whenever a dll gets loaded into the client now.
So we have to check the upper right box containing the registers
to notice, which dll gets loaded.
7. Press F9 until we find a dll stored in \HShield\...
Code:
Now that we've found the call, which runs the LoadLibraryA function,
we will have to trace it back, to the call, which starts the injection, to remove that one.
8. Scroll up to the Entry Point of the function. Entry points are allways marked by $!
9. We have to Repeat that, until we get totaly out of that HackShield Code.
10. Once we've reached the top, we can NOP the HackShield Call.
11. Remove the Breakpoints on the LoadLibraryA functions, since we don't need them anymore.
12. Now we reset the Client, and redo the Patch we just did, and run the client, to see if it works.
FAIL :(
Code:
Looks like there's another protection added to the client.
But this time it will be easy to crack it, since we've got a msgbox =)
13. Get Back Into the Intermodular Calls Window (Step 5)
14. Scroll down to the MessageBoxA function and breakpoint them all.
15. Reset the Client again, to get out of that Error, apply the Patch again (step 12)
16. Run the Client
Code:
Since we've got breakpoints on all MsgBox functions, the Client will break,
once we'll get the error message =)
17. The Client breaks on the Function call of the MsgBox. Scroll up to the Entry of the Function and trace it back
18. Nop out that Error!
19. Remove the Breakpoints from the MessageBoxA functions, since we don't need them anymore (simmilar to Step 11)
20. Reset the client, apply both patches again and run or save the client, since we're done now =)
Step 4: Finished
Quote:
if you've done everything correctly, the client should now run through the debugger.
Note:
Quote:
Bypassing the Hackshield will DC you from Time to Time, since the security packets won't get send to the server.
So after all you got a max of 5-10minutes online for reversing the client.
Bonus:
Quote:
I'll attach the Normal, Unpacked and Unpacked_Patched client to this Post, as a proof of concept =)
11/23/2011 12:19 kaiatan#2
For what can we use it? a sample pls Are we then allowed to use the old 4Story hacks, wich are patched since the HS is there?
11/23/2011 13:22 expo_botter#3
to patch the Client to run it without HS isn't that complicated. You get dc after 20 seconds because you don't send the correct packet to the server. But i'm fair and give you a thanks for this work.
11/23/2011 13:39 lolkop#4
Quote:
Originally Posted by expo_botter View Post
to patch the Client to run it without HS isn't that complicated. You get dc after 20 seconds because you don't send the correct packet to the server. But i'm fair and give you a thanks for this work.
Well, i'm not playin' 4story.

In the last days there have been lots of questions about the hs in 4story. All i did was downloading the client, and remove the hs, to open a gate for beginner reversing engineers.

To build real hacks/cracks, it would be necessary, to know the game system...
11/23/2011 14:36 AnghelescuG#5
Quote:
Originally Posted by expo_botter View Post
to patch the Client to run it without HS isn't that complicated. You get dc after 20 seconds because you don't send the correct packet to the server. But i'm fair and give you a thanks for this work.
if you are so good why you don't have you done a tutorial?

tnx to lolkop ;)
11/23/2011 17:14 mezzouomo10#6
good
11/23/2011 19:55 Chillex#7
Ist wohl neben dem "Modify the tcd Files"-Tutorial das wohl Hilfreichste, was in diesem gesamten Jahr 2011 im 4Story Bereich veröffentlicht wurde.
In dieser Sektion auch nur ein paar Kentnisse zu erwerben ist leider fast unmöglich.
Jedenfalls 5* und ein Thanks für das Tutorial.

eine kleine Sache..das Unpacken geht ja praktisch auch direkt mit PEiD.
11/23/2011 20:49 lolkop#8
Quote:
Originally Posted by Chillex View Post
Ist wohl neben dem "Modify the tcd Files"-Tutorial das wohl Hilfreichste, was in diesem gesamten Jahr 2011 im 4Story Bereich veröffentlicht wurde.
In dieser Sektion auch nur ein paar Kentnisse zu erwerben ist leider fast unmöglich.
Jedenfalls 5* und ein Thanks für das Tutorial.

eine kleine Sache..das Unpacken geht ja praktisch auch direkt mit PEiD.
das ist natürlich richtig =)

wie bereits erwähnt habe ich selbst keinen account für dieses spiel, und bin auch nicht darann interessiert. bin nur über anfragen in der coding section auf diese aufmerksam geworden, und war erschüttert, als ich gesehen habe, wie anfängern hier die tür vor der nase zugeschlagen wird.

gerade bei spielen wie diesem, wo es bis vor kurzem anscheinend noch möglich war ungehindert den client zu erforschen, sollte man sein bereits erworbenes wissen auch mit der community teilen.

hoffen wir, dass es einige leute vielleicht anregt ebenfalls mal etwas fürs allgemeinwohl zu tun. ich bin mir sicher das es auch hier leute gibt, welche den client lange genug analysiert haben, um einzelne client funktionen genaustens erklären zu können.
11/23/2011 21:24 Jinkson#9
hey, quick question real fast from a noob<~~~~ umm, those downloads at the bottom of ur post, is the unpatched tclient the full bypass? so could i just replace my original TClient in the game with that one and it will work?
11/23/2011 21:42 lolkop#10
Quote:
Originally Posted by Jinkson View Post
hey, quick question real fast from a noob<~~~~ umm, those downloads at the bottom of ur post, is the unpatched tclient the full bypass? so could i just replace my original TClient in the game with that one and it will work?
full bypass means, that it's not for normal usage.

as mentioned many times, this will make you disconnect every few minutes.
beside that, u'll be easily detected by the server as cheater, since u're not sending the security packets.

it's only made for reverse engineers =)
11/23/2011 21:49 Jinkson#11
so, say i got a hack, if i was to use during these 10mins, would it work?
11/24/2011 17:49 bruno825#12
Arbeit an BR und PT?
11/27/2011 15:01 Chillex#13
Keine Ahnung warum sich hier bei keinem Fragen auftun, liegt wohl daran, dass 98% einfach nur am Download des fertigen TClients interessiert sind.
Jedenfalls komme ich an einem Punkt nicht weiter.
Also mein Problem:

1.Ich hab die calls von LoadLibaryA "gebreakpoint" & doppelklicke den ersten Breakpoint.
(Irgendwie hab ich hier schon weniger LoadLibaryA Calls als du im Tutorial)


2.Jedenfalls lass ich jetzt den Client laufen und nach 1-2 Sekunden poppt eine Meldung auf:

3.Jetzt drück ich auf "OK" und Themida meldet sich.

4.Nochmals auf "OK" und..

5.Dann schmeißt es mich raus.
(Weiß jetzt nicht ob das Bild noch relevant sein könnte)

Ich hab jetzt ehrlich gesagt keine Ahnung wie ich weiter verfahren soll.
11/27/2011 15:45 ~*Breakdown*~#14
Würde es jemand vll auf deutsch übersetzen? wurde ja schon bei vielen anderen threads auch gemacht würde mich drüber freuen :D
11/27/2011 16:14 lolkop#15
Quote:
Originally Posted by Chillex View Post
Keine Ahnung warum sich hier bei keinem Fragen auftun, liegt wohl daran, dass 98% einfach nur am Download des fertigen TClients interessiert sind.
Jedenfalls komme ich an einem Punkt nicht weiter.
Also mein Problem:

1.Ich hab die calls von LoadLibaryA "gebreakpoint" & doppelklicke den ersten Breakpoint.
(Irgendwie hab ich hier schon weniger LoadLibaryA Calls als du im Tutorial)


2.Jedenfalls lass ich jetzt den Client laufen und nach 1-2 Sekunden poppt eine Meldung auf:

3.Jetzt drück ich auf "OK" und Themida meldet sich.

4.Nochmals auf "OK" und..

5.Dann schmeißt es mich raus.
(Weiß jetzt nicht ob das Bild noch relevant sein könnte)

Ich hab jetzt ehrlich gesagt keine Ahnung wie ich weiter verfahren soll.
wenn dein client wirklich anders aussieht als meiner, kann ich ja mal einen blick darauf werfen.

wäre nett wenn du den mal als anhang posten könntest =)
(am besten packed und unpacked)