Badge submitting AoBs
-migrated-
Badge submitting AoBs Posted on: 04/11/2010 4:21pm
Quote Post
When hacking games for Badgehack, I've tried also making one of the AoBs that are "Enter game, get badges".
So far, no cookies (I didn't succeed).

Now, I looked at the http://www.kongregate.com/games/ArmorGames/run-elephant-run's .swf, and saw this:
Code: [Select]
if (_root.diff == "hard")
{
    _root.kongregateStats.submit("Insane", _root.lives);
Code: [Select]
//96 09 00 08 0a 07 02 00 00 00 08 00
_push "Insane" 2 "_root"
//1c
_getVariable
//96 02 00 08 05
_push "kongregateStats"
//4e
_getMember
//96 02 00 08 06
_push "submit"
//52
_callMethod
//17
_pop

And well, this is as far as I got.

Anyone has any spare cookies? Not just the chocolate chips, but the cookie dough as well?
Re: Badge submitting AoBs Posted on: 04/11/2010 4:28pm
Quote Post
Kongregate badges are a bit different than Newgrounds badges because Kongregate submits the stats, and then the server awards you the badges.

In this case, you want to replace _root.lives with a high enough stat so that you get the badge. It depends on the badge and whatnot, but it looks like here it's going to be an integer.
So here, we'll replace
Code: [Select]
  //96 09 00 08 0a 07 02 00 00 00 08 00
   _push "Insane" 2 "_root"
with an integer (Is this AS2?)

I can't remember the exact formatting, but something like this in place of the above should push the integer 5.
96 09 00 07 05 00 00 00 00 00 00 00
Re: Badge submitting AoBs Posted on: 04/11/2010 4:31pm
Quote Post
(yes, this is AS2)

The badge is finishing Insane mode. So 96 09 00 07 01 00 00 00 00 00 00 00?
And why did you erase the 08 towards the end? Because you changed to an integer?
Re: Badge submitting AoBs Posted on: 04/11/2010 4:46pm
Quote Post
If it has _push or _root (which is _level0/: in CE), it's most likely AS2 since AS3 looks like _as3_getlocal <0>.
Re: Badge submitting AoBs Posted on: 04/11/2010 4:51pm
Quote Post
Code: [Select]
  //96 09 00 08 0a 07 02 00 00 00 08 00
   _push "Insane" 2 "_root"

There's three parts to this variable.

It first pushes the string "Insane" with the code
08 0a
08 designates the next byte as a string, and 0a refers back to wherever it holds the strings.

Then, it pushes the integer 2
07 02 00 00 00
07 designates the next 4 bytes as an integer, so 02 00 00 translates to 2.

Finally, it pushes "_root"
08 00

If this entire variable was to retrieve an integer, then I would just replace the entire thing with
96 09 00 07 01 00 00 00 00 00 00 00


Edit: On second though, it might be better to just have it push the integer since right now there are extra 0's.
96 05 00 07 01 00 00 00 02 02 02 02
Re: Badge submitting AoBs Posted on: 04/11/2010 4:54pm
Quote Post
I see. But why aren't you keeping the 08 00? Isn't it supposed to push both "Insane" 2 and "_root"?
Re: Badge submitting AoBs Posted on: 04/11/2010 4:56pm
Quote Post
In this case, if the badge is just for finishing Insane mode, I'd say is easier to change the if statement.
If you change
Code: [Select]
if (_root.diff == "hard") to
Code: [Select]
if (_root.diff == "easy") or just
Code: [Select]
if (_root.diff) or maybe even taking out the whole if, you'll get the badge by beating the game, whatever the difficulty is.

EDIT: Yeah, I forgot to change to easy =P
Re: Badge submitting AoBs Posted on: 04/11/2010 5:00pm
Quote Post
Don't you mean
Code: [Select]
if (_root.diff == "hard")to
Code: [Select]
if (_root.diff == "easy")?

And what I'm asking in this topic is how to do it in general, not just this case. That's what I meant in "cookie dough" and not just "chocolate chips".
Re: Badge submitting AoBs Posted on: 04/11/2010 5:02pm
Quote Post
Quote from: "Zirak"
I see. But why aren't you keeping the 08 00? Isn't it supposed to push both "Insane" 2 and "_root"?

If one pushes "Insane" 2 "_root", then it'll grab the variable that goes by that name. We don't want it to grab any variable at all, so we're just replacing the entire thing with an integer. Then, it'll submit that integer to Kongregate.

On that thought, I just realized I forgot something.
Code: [Select]
  //1c
   _getVariable
We don't want it to grab the variable, so just NOP this out, too.
Re: Badge submitting AoBs Posted on: 04/11/2010 5:08pm
Quote Post
Quote from: "Zirak"
And what I'm asking in this topic is how to do it in general, not just this case. That's what I meant in "cookie dough" and not just "chocolate chips".

Well, I'm not sure if there's a way of doing it in general. Based on what I've seen so far, it will submit to kong if one or more conditions are satisfied. So the most general way I can think of is simply noping the if, therefore making the game submit the badge info wheter you match the criteria or not
Re: Badge submitting AoBs Posted on: 04/11/2010 5:14pm
Quote Post
Quote from: "whatever"
Quote from: "Zirak"
And what I'm asking in this topic is how to do it in general, not just this case. That's what I meant in "cookie dough" and not just "chocolate chips".

Well, I'm not sure if there's a way of doing it in general. Based on what I've seen so far, it will submit to kong if one or more conditions are satisfied. So the most general way I can think of is simply noping the if, therefore making the game submit the badge info wheter you match the criteria or not

It seems that in this case it submits the stats whether the user dies or not. What Zirak wants to do is change what it sends to the server and make it good enough such that it'll give the badge.
Re: Badge submitting AoBs Posted on: 04/11/2010 6:52pm
Quote Post
So, insta-badge:

96 09 00 08 0a 07 02 00 00 00 08 00 1c =>
96 09 00 07 01 00 00 00 00 00 00 00 02

Or finish easy difficulty level to get badge:
96 02 00 08 09 =>
96 09 00 08 04 07 02 00 00 00 08 00

The latter seems a bit...off. I'm not sure that changing length won't cause trouble.