How to activate the cheats for Pokkaloh
- Download JPEXS Free Flash Decompiler. I used version 9.0.0
- Open the swf in the decompiler. Make sure to create a backup.
- Open Scripts -> ui -> Menu.
- You will now see a window named ActionScript with the code for the menu class
- Also note the lowerleft window with 2 tabs. One named Traits and the other constants.
- In the traits tab, scroll to public function showCheats(): void and click on it.
- In the actionscript window you should now see the showCheats function.
- If you look closely you can see that only the patreon text is set to true, all the other to false. Time to change that.
- Changing codes in the actionscript part can and probably will cuase you a lot of pain. So we gonna edit the instruction on the right window instead.
- Four lines interest us there
Code:
findproperty Qname(PackageNamespace(""),"texteCheatsNotPatron")
getproperty Qname(PackageNamespace(""),"texteCheatsNotPatron")
pushtrue
callpropvoid Qname(PackageNamespace(""),"set_visible") 1
This code get the proprety named texteCheatsNotPatron, it then push true to the stack and call the function set_visible with the latest value that was pushed in the stack. So, if we push false instead it will be hidden.
Code:
findproperty Qname(PackageNamespace(""),"texteCheatsItems")
getproperty Qname(PackageNamespace(""),"texteCheatsItems")
pushfalse
callpropvoid Qname(PackageNamespace(""),"set_visible") 1
As you can see, the texts we want to see are set to false.
So we need to pushfalse for the patreon warning and true to the 4 others. Lets do that
11. Click edit on the Trait window on the right, edit them and click save.
12. Now save the swf and run it.
Fuck! It doesn't work! The cheat menu is visible, but I can't click on anything!
Yeah. The author didn't just hide the cheats option. He neutered them. So we need to reanimate them too.
- Find the update function in the trait list Window (override public function update(param1: blablabla.
- One of the constant of the Menu class is to set the menu_cheats at number 6. So we gonna hunt for this value in the update function
If you scroll you can see if(menuCurrent == 0), if(menuCurrent == 5), 4 . But no menu 6. Instead we just see a weird
From my understanding the weird §§push(false) command is because the decompiler have no idea WTF is going on with the instruction on the right. So we whould investigate that part.
3. So first, we have to find the start of that elseif. To do that we need to check the previous else if. This will also gave us a baseline to know how an else if should look like. So click on the == of the instruction else if(menuCurrent == 4) on line 362.
4. You will see the instrunctions.
Code:
ofs05da:jump ofs0a09 <= jump to label ofs0a09. Label ofs0a09 is at the end of the big if. That line is part of the previous else if.
ofs05de:findproperty Qname(PackageNamespace(""),"menuCurrent") <= 0fs05de is the label of this if and find proprety is the first command of that label
getproperty Qname(PackageNamespace(""),"menuCurrent") <= push the proprety menuCurrent to the stack
pushbyte 4 <= push the number 4 to the stack
ifne ofs073f <= if the two latest values of the stacks are not equal jump to label 0fs073f. Otherwise, continue to the next line
pushstring "" <= rest of the instructions for this branch
coerce Qname(PackageNamespace(""),"String")
setlocal 9
So, that tell us that if menuCurrent is not equal to 4 jump to label ofs073f, otherwise continue along.
5. So we need to find the label ofs073f since it's where the last else start. Ctrl+f ofs073f and we find it at line 752.
6. So we see the following instructions.
Code:
jump ofs0a09
ofs073f:pushfalse
findproperty Qname(PackageNamespace(""),"menuCurrent")
getproperty Qname(PackageNamespace(""),"menuCurrent")
pushbyte 6
ifne ofs074f
Hum pushbyte 6(the cheatsmenu is #6) and that look closely at the elseif from part 4, but there's a weird push in there between the label and the findproperty. Let's remove the push false and moved the find property there instead, just like part4. Edit and save.
Code:
else if(menuCurrent == 6)
{
§§pop();
}
Ok, so the else if is back, but now there's a weird pop.
Now we should investigate a little more.
Code:
jump ofs0a09
ofs073f:findproperty Qname(PackageNamespace(""),"menuCurrent") <= find the menuCurrent property
getproperty Qname(PackageNamespace(""),"menuCurrent") <= push the value to the stack
pushbyte 6 <= push 6 to the stack
ifne ofs074f <= if two latest values in the stack are not equal jump to ofs074f otherwise continue
pop <= pop the latest value off the stack. Since we removed the pushfalse earlier, it doesn't have anything to pop. I think.
pushfalse <= push false to the stack
convert_b <= convert false to boolean (flash is weird)
ofs074f:iffalse ofs0a09 <= if the latest value in the stack is false jump to ofs0a09 which if you remember is the end of everything.
pushtrue
convert_b
This is the code we have now. Compare it again with the one at part 4. There's a few weird thing going on. Regardless of the value in menuCurrent, we always end up running this line ofs074f:iffalse ofs0a09 with false on top of the stack. Which make us jump to the label ofs0a09 and skip all the cheating instructions bellow.
So we will do a few things to fix all if this. First, lets correctly jump to the end label if the menuCurrent is not 6.
Change
ifne ofs074f
to
ifne ofs0a09
Then, remove the part that jump to the end if the menuCurrent is 6. Delete those lines
Code:
pop
pushfalse
convert_b
ofs074f:iffalse ofs0a09
Edit & save. And now look at the action script.
Holy shit! All the cheating instructions that were skipped are now there!
Time to save & test.
Yay! Cheatings works!
TL;DR: Just download this link to have the cheat enabled for V. 0.9.7
You must be registered to see the links
P.S. Seems like the label change. When you save or stuffs like that.