Changing the requirements for NG medals
-migrated-
Changing the requirements for NG medals Posted on: 01/04/2011 6:49pm
Quote Post

This is a guide for changing the requirements of Newgrounds medals with SoThink and Cheat Engine.

Step 1: Download the .swf file

We will hack the game Sidney Shark. If you don't know how to download it, click here. If you don't want to bother with downloading and decrypting it, click here and skip the next step.


Step 2: Decrypt the .swf file

Sadly, the .swf of Sydney Shark is encrypted, so we have to decrypt it. For that purpose, we'll use UnSWFEncrypt. You can download it here.

Open up UnSWFEncrypt.

[spoiler=UnSWFEncrypt:25vucosr](broken image removed)
In order to decrypt the .swf, you have to click the Restore button and select your file. You will get a pop-up "Found SWFEncrypt Flag!" and it will automatically decrypt the file and save it in the same folder as the original.


Step 3: Decompile the .swf file

For this step, you need a decompiler like SoThink. You can download it here.

Open up the .swf with SoThink and it will decompile it into code.

(broken image removed)

Click on the ActionScript tab to proceed.

(broken image removed)

The medal requirements, which are also changeable, are the requirements for the following medals:

  • Passenger (Kill 30 Passengers)
  • Kayak (Crush 10 Kayaks)
  • Orca (Eat 60 pieces of Orca)
  • Horse (Kill 9 Horses)
  • Skydiver (Kill 10 Skydivers)
Let's change the Passenger's one requirement. We will be using the built-in search bar to search for the "Passenger" medal. Type "Passenger" in the Searchbar and press on 'Search All AS'. You can stop the search after a few seconds. We just need the first result (which is in sprite 1461).

(broken image removed)

What we need is in the black frame. Basically the code means:
"If killed passengers = 30 then the medal "Passenger" will unlock and register on your profile"

The colored words correspond with those in the image.

The SourceCode won't help us, so now we switch to RawData.

Code: [Select]
if (_root.cp1y == 30)
{
    var medal_name = "Passenger";
    com.newgrounds.API.unlockMedal(medal_name, 26, 52);
will look like this in RawData

Code: [Select]
  //96 02 00 08 02
   _push "cp1y"
   //4e
   _getMember
   //96 05 00 07 1e 00 00 00
   _push 30
   //49
   _equals2
   //12
   _not
   //9d 02 00 36 00
   _if true goto #39
   //96 04 00 08 03 08 04
   _push "medal_name" "Passenger"

In AoBing, you have to connect all of the bytes in order to find what you need to change for when we search for it in Cheat Engine. You won't need ALL of the bytes, just this part:

Code: [Select]
  //96 02 00 08 02
   _push "cp1y"
   //4e
   _getMember
   //96 05 00 07 1e 00 00 00
   _push 30

Let's put all this together.

96 02 00 08 02 4e 96 05 00 07 1e 00 00 00

The red marked part is what we are looking for. 1e is Hex and translates to 30, so we want to change 1e to a lower number. Let's take 1 for example, which is in Hex 01. Our final AoB will look like this:

96 02 00 08 02 4e 96 05 00 07 1e 00 00 00 =>
96 02 00 08 02 4e 96 05 00 07 01 00 00 00

This AoB will set the required kills from 30 to 1. For the rest of the medals, repeat the same steps, but instead of searching for "Passenger", you will search for the corresponding medal name.

I appreciate every review, critic, and improvement suggestions.

Thanks to ChaoMing and Unfold for the grammar check!