Pages: 1234 »
Posted on 08-25-12, 10:08 pm (rev. 1 by  Dirbaio on 12-09-12, 11:36 pm)
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2375/4391
Since: 06-08-11
So, if you want to make ASM hacks, start off by downloading this thing.
It comes with some useful code too

I'll update it from time to time to work with newer DeviktPro versions, or to update the (ugh) symbols.x file.

Download: https://github.com/Dirbaio/ASMPatchTemplate/archive/master.zip
GitHub: https://github.com/Dirbaio/ASMPatchTemplate

See tutorial How ASM hacks are setup for details on how to use it.
Posted on 08-27-12, 06:03 pm
Paragoomba


Karma: 6
Posts: 27/71
Since: 07-10-12
Is it possible to use this in combination with an eu mkds rom?
Posted on 08-27-12, 06:07 pm (rev. 1 by  ray on 08-27-12, 06:08 pm)
Roy Koopa


Karma: 3766
Posts: 2190/2722
Since: 06-26-11
No, since this is made for NSMB only

EDIT: Except of the print.s (I think)
_________________________
See a lots of creative DS Hacking here
If you want to support me, you might check out my Patreon Page : )
Posted on 08-27-12, 06:33 pm
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2390/4391
Since: 06-08-11
Posted by Gericom
Is it possible to use this in combination with an eu mkds rom?


Stuff that can be used as-is in other games: print.s
Stuff that is specific to NSMB and is useless in other games: nonintendo.cpp, debugscreen.s, nsmb.h, symbols.x.
Stuff that you need to modify in order to make it work in MKDS: arenaoffs.txt

arenaoffs.txt contains the only address NSMBe needs to know in order to insert custom code in the ROM, and it's different for every game
I haven't implemented autodetection into NSMBe because it would be tricky and unreliable.

I have the arenaoffs for a MKDS rom, but I don't remember which region it was. I'll post it tomorrow when I get back home.

You can still find it out yourself. Grab the NSMB IDB, look at the function OS_GetInitArenaLo. The arenaoffs points to the value that's right after the end of the function, which is used by the function

Then grab your MKDS IDB, find this function, and you got the arenaoffs for your MKDS rom too.

Posted on 08-27-12, 06:38 pm
Roy Koopa


Karma: 3766
Posts: 2191/2722
Since: 06-26-11
Too bad, I formated my PC and forgot to save the Arenaoffs (tactical facepalm incoming)...
_________________________
See a lots of creative DS Hacking here
If you want to support me, you might check out my Patreon Page : )
Posted on 08-28-12, 04:01 pm (rev. 1 by  Dirbaio on 08-28-12, 04:02 pm)
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2400/4391
Since: 06-08-11
http://nsmbhd.net/get.php?id=468

MKDS ASM hack I made a while ago, works on eur region (SMNP gamecode)
The main point of it is the arenaoffs file, that one's the right one for EUR region.

The code itself does this:
- A button is inverted so you don't have to press it while racing.
- B button makes you drift plus auto-snake (Presses left, right in a loop automatically)
- X button gives you items. Works in WFC, but NOT in local wifi play.
- Y throws objects
- Select+Up enables/disables the hack.
- Select+Down enables/disables the X button.



EDIT:
1: Makefile is not updated, use the one from the template.
2: I think it won't work when compiled with NSMBe 334+ because I changed how the hooks work.
Posted on 08-28-12, 06:25 pm
Red Paragoomba


Karma: 91
Posts: 24/64
Since: 07-31-12
Hey, Dirb, can you do a quick hack that if it is in air for longer than 0,5 second, upon landing provides boost? Also, jump activated only on R press. A quick tricks mod.
Posted on 08-28-12, 06:33 pm
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2405/4391
Since: 06-08-11
That's not a "quick" hack.
It requires finding:
1: How to see if the kart is on air
2: How to give boost to the kart.

Sure, the code might be short once we know that, but finding that *is* hard. You might get the info from AR codes (I think there was an "always boost" AR code), but the "on air" thing might be harder.

So no, I won't do it. I have enough work disassembling NSMB, I won't do MKDS.

(For you to get an idea, I have 2208 names (functions+vars) identified all by myself in the NSMB IDA Pro DB. And that's just a REALLY SMALL part of NSMB )
Posted on 08-28-12, 06:35 pm


Karma: 3552
Posts: 1468/2112
Since: 06-28-11
I think Gericom knows how to detect when the kart is in the air.
Posted on 08-28-12, 06:36 pm (rev. 3 by  Dirbaio on 08-28-12, 06:37 pm)
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2406/4391
Since: 06-08-11
Then let him make it
It should be just 2 or 3 lines of ASM C++ code, after all.

But, getting it to work with multiplayer would be verrry tricky. If not done properly, different DS's will get out of sync.
Posted on 08-28-12, 06:38 pm
Paragoomba


Karma: 6
Posts: 28/71
Since: 07-10-12
Posted by Dirbaio
That's not a "quick" hack.
It requires finding:
1: How to see if the kart is on air
2: How to give boost to the kart.

Sure, the code might be short once we know that, but finding that *is* hard. You might get the info from AR codes (I think there was an "always boost" AR code), but the "on air" thing might be harder.

So no, I won't do it. I have enough work disassembling NSMB, I won't do MKDS.

(For you to get an idea, I have 2208 names (functions+vars) identified all by myself in the NSMB IDA Pro DB. And that's just a REALLY SMALL part of NSMB )

I am disassembling mkds. Using your nsmb db i found allready many library functions. And using the nitro sdk (source) I found some functions you didn't find.

I found the rendering of the boost screen warp. Could be useful.
Posted on 08-28-12, 06:46 pm (rev. 1 by  Dirbaio on 08-28-12, 06:47 pm)
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2407/4391
Since: 06-08-11
Posted by Gericom
I am disassembling mkds. Using your nsmb db i found allready many library functions. And using the nitro sdk (source) I found some functions you didn't find.

Also take into account that not all functions from the SDKs appear in the game's code. The compiler seems to leave out unused library functions.

If you found a function in MKDS that's not in NSMB, that might be the reason.
If you found a function in NSMB that I didn't find, then tell me address + function name.
But I'm pretty sure the NSMB IDB has NitroSDK complete, and it has many NitroSystem stuff (Sound complete, Foundation maybe too, some of the 3D stuff, nearly nothing about 2D stuff)

Also a very useful trick for finding functions faster: Their compiler compiles functions from the source files in reverse order (IDK why reverse). So if you find a function from a file, you can easily find more. Just be careful about skipped functions.
Posted on 08-28-12, 06:51 pm
Paragoomba


Karma: 6
Posts: 29/71
Since: 07-10-12
Posted by Dirbaio
Posted by Gericom
I am disassembling mkds. Using your nsmb db i found allready many library functions. And using the nitro sdk (source) I found some functions you didn't find.

Also take into account that not all functions from the SDKs appear in the game's code. The compiler seems to leave out unused library functions.

If you found a function in MKDS that's not in NSMB, that might be the reason.
If you found a function in NSMB that I didn't find, then tell me address + function name.
But I'm pretty sure the NSMB IDB has NitroSDK complete, and it has many NitroSystem stuff (Sound complete, Foundation maybe too, some of the 3D stuff, nearly nothing about 2D stuff)

Also a very useful trick for finding functions faster: Their compiler compiles functions from the source files in reverse order (IDK why reverse). So if you find a function from a file, you can easily find more. Just be careful about skipped functions.

I know.

I found some G3d functions you didn't find.

I noticed.

I will upload my database soon.
Posted on 08-28-12, 06:52 pm
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2408/4391
Since: 06-08-11
But I mean.
You found these functions in NSMB or in MKDS !?
I'm interested in the offsets if you found them in NSMB.

Also be careful about the 3D stuff, it's full of inlines, so functions maybe aren't what they look like.
Posted on 08-28-12, 06:53 pm (rev. 2 by  Gericom on 08-29-12, 01:00 pm)
Paragoomba


Karma: 6
Posts: 30/71
Since: 07-10-12
Posted by Dirbaio
But I mean.
You found these functions in NSMB or in MKDS !?
I'm interested in the offsets if you found them in NSMB.

Also be careful about the 3D stuff, it's full of inlines, so functions maybe aren't what they look like.

I found them in mkds, but I noticed that some are also in nsmb.

When I upload my database, you can look yourself. I will give the offset in mkds then.

Edit: I have a question: how do I get the size of the 'Local variables area'? Sometimes it is allready given. But sometimes it is 0.
Posted on 10-24-12, 05:39 pm
Paragoomba


Karma: 6
Posts: 39/71
Since: 07-10-12
How do you change if the generated code will be thumb or arm?
Posted on 10-24-12, 05:44 pm
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2751/4391
Since: 06-08-11
In the Makefile, change -marm to -mthumb.
But if you change it, NSMBe won't be able to insert the code properly because the instructions to jump to Thumb code are different.

Why do you want to change it? Thumb code sucks and should die, and commercial games use ARM.
Posted on 10-24-12, 05:55 pm
Paragoomba


Karma: 6
Posts: 40/71
Since: 07-10-12
Posted by Dirbaio
In the Makefile, change -marm to -mthumb.
But if you change it, NSMBe won't be able to insert the code properly because the instructions to jump to Thumb code are different.

Why do you want to change it? Thumb code sucks and should die, and commercial games use ARM.

Mkds uses lots of thumb. (Which is very irritating in ida) For example are almost all item functions writen in thumb. But some in arm. And even some sdk functions which are arm in nsmb are thumb in mkds.
Posted on 10-24-12, 06:00 pm
Super Luigi
( ͡° ͜ʖ ͡°)

Karma: 7925
Posts: 2752/4391
Since: 06-08-11
Wow really? That sucks
I've seen very very few functions that use thumb in NSMB. And all of them are unimportant things.

I don't know how to deal with that. The thing I could do is to make the editor able to hook into thumb code. There'd be no need to compile the ASM hacks in Thumb mode for that, btw. It'd be something like hook_02xxxxxx_thumb, and NSMBe would know that address is thumb code.

I'll take a look. I don't know if it's possible to do the hooks with just one Thumb instruction though. Thumb sucks, it's verrry restricted in lots of ways.
Posted on 11-28-12, 05:44 pm
Paragoomba


Karma: 6
Posts: 41/71
Since: 07-10-12
Is it possible to read/write a value from/in a register? I have found something cool and I need it.
Pages: 1234 »