Arcade Prehacks

Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Hacking BadBoys

  1. #1
    Super Moderator ZuckeR's Avatar
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    1,596

    Hacking BadBoys

    Hi guys!

    I thought i might share my little journey into hacking the game Bad Boys. After i am done now it was easier than i expected but took quite a while. The worst part about this game is that it comes with 41 files (i think i got all) which needed to be found in the first place. I post this here as i don't know if it fits into the tutorial section. Sorry if this is the wrong place for it.

    0. Preparing

    Everything i gonna tell you here needs you to have some knowlegde about hacking. The more advanced you are the easier this should be for you. Well it is not really hard to do all this but there seem to be some hackers that may wan't to know it. I hope you can learn something from it and i am there for questions and critic!

    1. How it started

    Someone requested this game and gave the link to the game http://www.addictinggames.com/badboys.html so i searched with firefox site information for the file and found it quite easy.



    I realized that the file could not be everything as the game had much more graphics than it could fit into 289kb. There needed to be files which were loaded while playing the game. But how to find all the files the game needs?

    2. Finding the files

    There are several ways to find a file which gets loaded into the game after start:

    The old school method
    • Decompress the swf file. You won't find any strings in an compressed swf.
    • Open the decompressed file into Notepad++ or any other texteditor.
    • Search for common file extensions (.swf, .xml, .mp3) with and without the dots.
    • Not finding anything or just a string with ".swf" or so does not mean the game doesn't load anything, just use the next method.



    This is how i found the files in the first place.

    The decompiler method
    • Load the game swf into your favorite decompiler like Sothink SWF Decompiler or Trillix.
    • With Trillix you can search through the whole scripts in the game. Other Deompilers may force you to look through every class manually.
    • Search for common file extensions (.swf, .xml, .mp3) with and without the dots.
    • You should be able to find files this way or maybe a function which uses a string as input and concatenates the extension to it before it loads.
    • If you found a function then you should search for the input it takes which can be really annoying.
    • Still no luck yet? Use the next method!

    Code:
    this._pathArray = [Main.url + "unitsGraphic.swf", Main.url + "carsGraphic.swf", Main.url + "carsGraphic_part2.swf", Main.url + "gui.swf"];
    ...
    _loc_1.load(new URLRequest(Main.url + "data.xml"));
    The connection checking method
    • This can take a while and needs you to play the game as you need to make it requesting the files.
    • SWFs can request files via http which can be traced with a firewall if it connects to the internet but not if it tries to load files from the same domain it is in. That may depend on the firewall but mine does not check local connection.
    • But i remembered that servers log http requests in easy to search text files. Good that i already got XAMPP http://www.apachefriends.org/en/xampp.html which includes Apache and runs a server on my home pc. I am not going to explain this further here so i hope you know what i mean.
    • So running the game on my local server (127.0.0.1:80) i just needed to open the access.log file from apache into Notepad++ and play the game so it does it requests.
    • Every time a request was done i could refresh the logfile and at the very bottom i had the files i wanted.


    A little bit out of the access.log

    First i got all the files with graphics and the data file which was xml. And i was happy as the game started and i could play it on my PC. I just noticed that the intro and the phone calls had no voice overs anymore. That was because these sound files were also loaded additionally to the graphics files. I could see them in my logfile and i found a function which loaded them. Also there had to be some code which tells the function which file it should load. The file names were generated from the data.xml.
    Code:
    The request code for the sound in the ActionScript:
    var loc1:*=new flash.net.URLRequest(com.mvi.client.Main.url + "snd/" + arg1 + ".mp3");
    
    An example from the data.xml where i found most of the file names for the mp3s:
    <DIALOG id="m1_d1" label="Stranger" sound="Mission One">
    
    Together with the original path to the game i got this:
    http://www.addictinggames.com/gamefi...sion%20One.mp3
    That was easy wasn't it!? Well maybe not and annoying anyhow, so here is the complete list of all 41!!! files.
    Code:
    THE GAME:
    http://www.addictinggames.com/gamefi...ys/badboys.swf
    
    THE EXTRA SWFs:
    http://www.addictinggames.com/gamefi...itsGraphic.swf
    http://www.addictinggames.com/gamefi...arsGraphic.swf
    http://www.addictinggames.com/gamefi...phic_part2.swf
    http://www.addictinggames.com/gamefiles/BadBoys/gui.swf
    
    THE DATA XML:
    http://www.addictinggames.com/gamefi...dBoys/data.xml
    
    THE SOUND FILES:
    http://www.addictinggames.com/gamefi...20part%201.mp3
    http://www.addictinggames.com/gamefi...20part%202.mp3
    http://www.addictinggames.com/gamefi...20part%203.mp3
    
    http://www.addictinggames.com/gamefi...sion%20One.mp3
    http://www.addictinggames.com/gamefi...ne_Failure.mp3
    http://www.addictinggames.com/gamefi...sion%20Two.mp3
    http://www.addictinggames.com/gamefi...wo_Failure.mp3
    http://www.addictinggames.com/gamefi...on%20Three.mp3
    http://www.addictinggames.com/gamefi...ee_Failure.mp3
    http://www.addictinggames.com/gamefi...On%20Bench.mp3
    http://www.addictinggames.com/gamefi...ion%20Four.mp3
    http://www.addictinggames.com/gamefi...eforeHench.mp3
    http://www.addictinggames.com/gamefi...AfterHench.mp3
    http://www.addictinggames.com/gamefi...ion%20Five.mp3
    http://www.addictinggames.com/gamefi...ut%20Scene.mp3
    http://www.addictinggames.com/gamefi...0Scene_Yes.mp3
    http://www.addictinggames.com/gamefi...20Scene_No.mp3
    http://www.addictinggames.com/gamefi...ion%20Six1.mp3
    http://www.addictinggames.com/gamefi...ion%20Six2.mp3
    http://www.addictinggames.com/gamefi...%20Failure.mp3
    http://www.addictinggames.com/gamefi...on%20Seven.mp3
    http://www.addictinggames.com/gamefi...en_Failure.mp3
    http://www.addictinggames.com/gamefi...ssionEight.mp3
    http://www.addictinggames.com/gamefi...FailureAlt.mp3
    http://www.addictinggames.com/gamefi...ion%20Nine.mp3
    http://www.addictinggames.com/gamefi...ine_Killed.mp3
    http://www.addictinggames.com/gamefi...sion%20Ten.mp3
    http://www.addictinggames.com/gamefi...n%20Eleven.mp3
    http://www.addictinggames.com/gamefi...ven_Killed.mp3
    http://www.addictinggames.com/gamefi...ut%20Scene.mp3
    http://www.addictinggames.com/gamefi...%20Scene_3.mp3
    http://www.addictinggames.com/gamefi...%20Scene_2.mp3
    3. Hacking the game

    After downloading all the files and putting them together i could play the game as if i were doing it on the internet. No i could actually start hacking the game! So how should i hack the game with so many files? Easy thing as BadBoys.swf is the only file for this game which actually has code in it. So it is possible to hack this game like every other.

    Code:
    public static var CHEAT:uint = 0;
    This particular code i found in the Main class was making me happy. It just did not worked out as i planned. When trying to change it to 1 or anything i had no luck as it never changed. I a using the hex editor way RJT made popular for AS3 but changing this variable just did not work. So i had to change the functions n which this cheat mode gets checked for.

    Here is my little hacklog:
    Code:
    # ENABLE GOD MODE THE COMPLICATED WAY
    # com/mvi/client/view/game/ObjetsMediator::handleNotification()
    # To change the if statements just change iffalse (0x12) to iftrue (0x11).
    # This turns the statement to the negative.
    # There are three statements in the game they are written here in order as they appear in the code too.
    
    -- PLAYER HEALTH
    
    CODE: if (Main.CHEAT & FlagCheat.GOD_MODE) { return; }
    BYTE: 60 ca 01 66 fa 18 60 c0 05 66 e4 1b a8 12 01 00 00 47 
    
    CODE: if (!(Main.CHEAT & FlagCheat.GOD_MODE)) { return; }
    BYTE: 60 ca 01 66 fa 18 60 c0 05 66 e4 1b a8 11 01 00 00 47 
    
    --- PLAYER HEALTH
    
    CODE: if (Main.CHEAT & FlagCheat.GOD_MODE) { _loc_21.HEALTH = _loc_21.HEALTH + _loc_20; }
    BYTE: 60 ca 01 66 fa 18 60 c0 05 66 e4 1b a8 12 0d 00 00
    
    CODE: if (!(Main.CHEAT & FlagCheat.GOD_MODE)) { _loc_21.HEALTH = _loc_21.HEALTH + _loc_20; }
    BYTE: 60 ca 01 66 fa 18 60 c0 05 66 e4 1b a8 11 0d 00 00
    
    --- CAR HEALTH (SEEMS TO AFFECT ALL CARS)
    
    CODE: if (Main.CHEAT & FlagCheat.GOD_MODE) { _loc_21.HEALTH = _loc_21.HEALTH + _loc_20; }
    BYTE: 60 ca 01 66 fa 18 60 c0 05 66 e4 1b a8 12 0d 00 00
    
    CODE: if (!(Main.CHEAT & FlagCheat.GOD_MODE)) { _loc_21.HEALTH = _loc_21.HEALTH + _loc_20; }
    BYTE: 60 ca 01 66 fa 18 60 c0 05 66 e4 1b a8 11 0d 00 00
    So what i did after finding these checks is that i made the statements negative. You can see the original code and bytecode and the changed ones for the health of the player and the cars.

    4. Playing the game
    This is obviously the best part about hacking a game: Enjoying it!

    Code:
    http://www.mediafire.com/?jm5tndmtqto
    Here is the game, it includes the original (BadBoys.swf) and the hacked version (BadBoys_h.swf). Like i said you canot die and also you get 9999 every time some drops money. That was in the .xml file, which holds the mission data and some other stuff, you could even add your own missions if you wanted to.



    If you found a fault in my grammar you can keep it!

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Location
    Finland
    Posts
    1,867

    Re: aa

    Wow! This is very awesome! I think that this should have been posted into the Tutorials section

  3. #3
    Banned
    Join Date
    Jul 2009
    Posts
    68

    Re: Hacking BadBoys

    Wow man...it's so great,people can actually do it step-by-step. Thanks.
    If you want,we can move it to Tutorials

  4. #4
    Super Moderator ZuckeR's Avatar
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    1,596

    Re: Hacking BadBoys

    Quote Originally Posted by MartinRistov
    If you want,we can move it to Tutorials
    I am fine with that i just wasn't sure if i should put it there or here.

  5. #5
    Banned
    Join Date
    Jul 2009
    Posts
    68

    Re: Hacking BadBoys

    Well this is a tutorial so it should go there.
    I must say again,good job man! I haven't got the time to read it all but I'll do it in future

  6. #6
    Super Moderator ZuckeR's Avatar
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    1,596

    Re: Hacking BadBoys

    OK move it then and thanks.

  7. #7
    Senior Member
    Join Date
    Jan 2010
    Location
    TRMI
    Posts
    4,613

    Re: Hacking BadBoys

    your a really good hacker for being on the forums less then a month
    sig by pedro and soewut

  8. #8
    Banned
    Join Date
    Jul 2009
    Posts
    68

    Re: Hacking BadBoys

    Not all hackers should be here,though
    Anyway,yeah,he's going pretty good.

  9. #9
    Administrator Xnite's Avatar
    Join Date
    Nov 2009
    Posts
    1,327

    Re: Hacking BadBoys

    Great work man. Very helpful.

  10. #10
    Senior Member
    Join Date
    Jan 2010
    Location
    TRMI
    Posts
    4,613

    Re: Hacking BadBoys

    he should win the next best hacker contest
    sig by pedro and soewut

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •