Kuribo64
Views: 19,852,824 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
03-28-24 11:11 PM
Guest:

0 users reading Super Mario Galaxy 2 - Reverse Engineering | 1 bot

Main - Misc. ROM hacking - Super Mario Galaxy 2 - Reverse Engineering Hide post layouts | New reply


shibboleet
Posted on 09-05-17 02:45 PM Link | #87860
greetings mortals

Super Mario Galaxy 2 has never been really looked at, in a structure sense. So I've decided to yolo it and try to reverse engineer the game to see what it can contain.

class Goomba : public Object {
public:
void* vtable; // _0
u32 _50;
u32 _54;
u32 _58;
void* _5C;
u32 _68;
u8 _70;
u8 _71;
u8 _72;
u8 _73;
u8 _77;
u32 _80;
u32 _8C;
void* _90;
u32 _94;
u32 _98;
u32 _9C;
u32 _A0;
u32 _A4;
void* _A8;
float _AC;
float _B0;
float _B4;
float _B8;
u32 _C8;
u8 _CC;
u8 _CD;
u8 _CE;

~Goomba();
Goomba();

void init(u32 *);
void vf08();
void vf28();
void vf2C();
void vf4C();
void vf50();
void vf58(u32 *, u32 *);
void vf5C(u32 *, u32 *);
u32 vf60(u32 *, u32 *, u32 *);
u32 vf64(u32 *, u32 *, u32 *);
u32 vf68(u32, u32 *, u32 *);
};

This is your basic class. You have your fields, and you have your methods. Every object inherits a base class, which I call "Object". "Object" has a lot of empty methods (or nullsubs) because they didn't bother coding for them because they would be overwritten by every class anyways.

The last few methods (vf58 to vf68) seem to be the colliders once you really look at it, seeing as it's probably self * and collider *.

more to come

____________________
a

Super Hackio
Posted on 09-05-17 03:18 PM Link | #87866



I 100% support you on your YOLO quest shibboleet!!

Anyone else with me on that?

____________________
SMG RUN Progress: Not available here, for more information, check my Youtube Channel

shibboleet
Posted on 09-05-17 04:33 PM Link | #87867
well I’m opening a completely seperate wiki soon sooo

____________________
a

Super Hackio
Posted on 09-05-17 04:34 PM Link | #87868



Posted by shibboleet
well I’m opening a completely seperate wiki soon sooo

REALLY?? Where?

____________________
SMG RUN Progress: Not available here, for more information, check my Youtube Channel

shibboleet
Posted on 09-05-17 05:20 PM Link | #87875
void init(u32 *arg1)
{
r5 = "Kuribo";
r6 = 0;
r31 = arg1;
r30 = r3; // this->
call_object_init(arg1, r5, r6);
r0 = r30->_CD;
if (r0 != 0)
goto CDNot0;
r3 = r30;
sub_8022BC70(r3);

CDNot0:
r5 = r30;
r3 = r30 + 0xAC; // this creates a pointer
r4 = r30 + 0xBC; // this creates a pointer
sub_80010070(r3, r4, r5);
r3 = r31;
sub_8002BD90(r3);
if (r3 == 0)
goto r3Is0;
r3 = r31;
r4 = r30 + 0xCC; // this creates a pointer
sub_8002C580(r3, r4); // Obj_arg0

r3Is0:
r0 = r30->_CC;
if (r0 != 0)
goto CCNot0;
r3 = r30;
sub_80034560(r3); // this sets r30->_CC to 1
r3 = r30;
sub_80034DA0(r3);
goto allocMemory;

CCNot0:
r3 = r30;
Store0InField76(r3);
f10 = r30->_AC;
r3 = r1 + 0x14;
f9 = r30->_B0;
f0 = f10 * f10;
f1 = r30->_B4;
f6 = r30->_B8;
f8 = f10 * f9;
f7 = r2->_-3E90;
f2 = f1 * f1;
f5 = f6 * f1;
f3 = r2->_-3EA0;
f4 = f7 * f0;
f0 = f6 * f10;
f1 = f9 * f1;
f4 = f3 - f4;
f2 = f7 * f2;
f6 = f7 * f8;
f5 = f7 * f5;
f3 = f7 * f1;
f0 = f7 * f0;
f1 = f6 - f5;
f2 = f4 - f2;
f3 = f3 + f0;
sub_80006F90(f1, f2, f3);
r3 = r30 + 0x44;
r4 = r1 + 0x14;
sub_8000E9C0(r3, r4);
goto allocMemory;

allocMemory:
r3 = 0x1C;
AllocFromHeapEx_Align4_0(r3);
if (r3 == 0)
goto allocResult;
r4 = 0;
sub_801501D0(r3, r4);
goto allocResult;

allocResult:
r3 = r30->_90;
r3 = r30;
sub_801B8C30(r3);
r3 = r30;
r4 = r31;
sub_801B8D70(r3, r4);
r3 = r30;
r4 = r31;
r5 = 0;
r6 = 0;
sub_80063350(r3, r4, r5, r6);
r3 = r31;
sub_8002BD90(r3);
if (r3 == 0)
goto end;
r3 = r30;
r4 = r31;
r5 = 0x20;
sub_80031970(r3, r4, r5);
goto end;

end:
r3 = r30;
r4 = r31;
sub_8001AA10(r3, r4);
f1 = r2->_-3E9C;
r3 = r1 + 0x08;
sub_80006EB0(f1);
r4 = "Center";
r5 = r3;
r3 = r30;
sub_8041A940(r3, r4, r5);
r30->_A8 = r3;
r31 = r1->_2C;
r30 = r1->_28;
r0 = r1->_34;
r1 = r1 + 0x30;
}

init() function attempted RE

____________________
a

Super Hackio
Posted on 09-05-17 05:26 PM Link | #87876



This looks like... whatever language GalaxyCreate used. (whatever command prompt uses)

____________________
SMG RUN Progress: Not available here, for more information, check my Youtube Channel

shibboleet
Posted on 09-05-17 05:27 PM Link | #87877
what

____________________
a

Super Hackio
Posted on 09-05-17 05:28 PM Link | #87878



NVM. I saw the "goto" function and recognized it. I've used it before.

____________________
SMG RUN Progress: Not available here, for more information, check my Youtube Channel

JasonTGF
Posted on 09-05-17 06:02 PM Link | #87880
Posted by shibboleet
greetings mortals

Super Mario Galaxy 2 has never been really looked at, in a structure sense. So I've decided to yolo it and try to reverse engineer the game to see what it can contain.

class Goomba : public Object {
public:
void* vtable; // _0
u32 _50;
u32 _54;
u32 _58;
void* _5C;
u32 _68;
u8 _70;
u8 _71;
u8 _72;
u8 _73;
u8 _77;
u32 _80;
u32 _8C;
void* _90;
u32 _94;
u32 _98;
u32 _9C;
u32 _A0;
u32 _A4;
void* _A8;
float _AC;
float _B0;
float _B4;
float _B8;
u32 _C8;
u8 _CC;
u8 _CD;
u8 _CE;

~Goomba();
Goomba();

void init(u32 *);
void vf08();
void vf28();
void vf2C();
void vf4C();
void vf50();
void vf58(u32 *, u32 *);
void vf5C(u32 *, u32 *);
u32 vf60(u32 *, u32 *, u32 *);
u32 vf64(u32 *, u32 *, u32 *);
u32 vf68(u32, u32 *, u32 *);
};

This is your basic class. You have your fields, and you have your methods. Every object inherits a base class, which I call "Object". "Object" has a lot of empty methods (or nullsubs) because they didn't bother coding for them because they would be overwritten by every class anyways.

The last few methods (vf58 to vf68) seem to be the colliders once you really look at it, seeing as it's probably self * and collider *.

more to come

Doing this should probably make asm hacking possible and a lot easier.

____________________
Skek is a Fortnite god

TheSunCat
Posted on 09-05-17 06:11 PM Link | #87883
This would open up possibilities for custom code, right?

So we could finally make custom AIs and objects. :)

Super Hackio
Posted on 09-05-17 06:13 PM Link | #87884



Or fix objects that are broken. OR port SMG1 objects. (kamella, for example)

____________________
SMG RUN Progress: Not available here, for more information, check my Youtube Channel

TheSunCat
Posted on 09-05-17 06:30 PM Link | #87886
YES!

Good luck, shibboleet!
I wish I could help, but I do not know PPC.. :(

Do not give up! :)

Jesse
Posted on 09-08-17 10:30 AM Link | #88114
Nice man, I always wanted to take a look inside the code! So far I've only ever decompiled/reverse Engineered gameboy advance games. I suppose IDA doesn't provide the luxury of decompiling for PPC as it does for ARM?

iyenal
Posted on 09-08-17 07:58 PM Link | #88134
I encourage you for this ASM decompiling.
Posted by Jesse
Nice man, I always wanted to take a look inside the code! So far I've only ever decompiled/reverse Engineered gameboy advance games. I suppose IDA doesn't provide the luxury of decompiling for PPC as it does for ARM?


IDA Pro can decompile ASM PPC ISA.
PPC ISA don't use jump syntax but goto ? I didn't knew that, it looks like BASIC.

____________________
[image][image]
"I failed in some subjects in exam, but my friend passed in all. Now he is an engineer in Microsoft and I am the owner of Microsoft." -Bill Gates

shibboleet
Posted on 09-08-17 08:33 PM Link | #88137
only 6.95, which hasn’t been leaked yet

____________________
a

Super Hackio
Posted on 09-08-17 10:11 PM Link | #88142



So you actually PURCHASED IDA PRO?

How much was it?

____________________
SMG RUN Progress: Not available here, for more information, check my Youtube Channel

TheSunCat
Posted on 09-08-17 10:43 PM Link | #88145
Pretty sure it is $1409.

shibboleet, how is progress going?

mibts
Posted on 09-09-17 12:19 AM Link | #88155
Good luck with the reverse engineering.

____________________
Current hack: Excerpt from Super Mario 256

Any map on a flat torus can be colored with at most 7 colors.


Main - Misc. ROM hacking - Super Mario Galaxy 2 - Reverse Engineering Hide post layouts | New reply

Page rendered in 0.035 seconds. (2048KB of memory used)
MySQL - queries: 28, rows: 234/234, time: 0.010 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.