ROM Hack ASM Hacking | Overlay not loading in game when changing more than 1 byte in the overlay.

bananabread

Member
OP
Newcomer
Joined
May 10, 2019
Messages
9
Trophies
0
Age
18
XP
122
Country
Netherlands
Hi, I'm currently working on trying to do ASM Hacking on a game, Professor Layton and Pandora's box to be exact. I've been trying hard to get this to work. The NSMBE ASM Patcher didn't work, so I wrote my own in python with the use of the ndspy library, and I so far have been able to do hooks in arm9.bin, but since most of the interesting code is put in the overlays, I was working on being able to hook to overlays.
The thing is though, whenever I try to modify the uncompressed overlay. When I change more than 2 bytes, wherever in the file, it fails to load the overlay in game. I can change 1 byte fine, but 2 and it fails.
I was wondering if any of you know why this might occur and how I could fix it, or redirect me to someone who does.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,277
Country
United Kingdom
I am assuming this is in place rather than expanding or reducing the size.

If it had been any changes then we would start looking for some kind of hashing anti piracy check but a single byte working but not two is odd. Hopefully any changes made are valid ones and it is not a problem of the edit itself rather than the methods employed.
You say uncompressed -- are these not overlays that are not compressed in the original ROM? If they are compressed and you are compressing them again (I have never been a great fan of changing the "is compressed" flag) then just to make sure you are using the DS binary compression (in cue's tools it is the blz compression option).
 

bananabread

Member
OP
Newcomer
Joined
May 10, 2019
Messages
9
Trophies
0
Age
18
XP
122
Country
Netherlands
I don't think the issue is compression. I've tested that what I'm editing isn't compressed and the overlays are compressed standard. Also the overlays won't load at all if their not compressed. The changes I made when the hooks didn't work was to first just adjust 1 byte, then adjust another. Both worked fine. Then changed both and the overlay just stopped working. The 2 bytes changed are also far apart so it isn't like I'm making a huge change to some value.
 

bananabread

Member
OP
Newcomer
Joined
May 10, 2019
Messages
9
Trophies
0
Age
18
XP
122
Country
Netherlands
Well, until I figure this out, I will try to implement something to setup the hooks in the overlays while the game is running. My current plan is to change the value at the address when the overlay gets loaded in or branches to the first function I can hook to.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,277
Country
United Kingdom
"I've tested that what I'm editing isn't compressed and the overlays are compressed standard"

So that means the overlays are compressed but the byte you are changing is as it would be in the uncompressed/in memory version? That might be so but the way LZ works means it could well reference that byte later in decompression and at that point you have just propagated an error.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BakerMan @ BakerMan:
    click link (the chain icon), then paste the link without adding text for the link to say
    +1
  • BakerMan @ BakerMan:
    that's how you embed
  • K3Nv2 @ K3Nv2:
    Or just hit edit
  • Sicklyboy @ Sicklyboy:
    This newfangled shoutbox always trips me up
  • K3Nv2 tempBOT:
    K3Nv2 rolls 1d6 and gets 2 (2).
  • BakerMan @ BakerMan:
    how do you roll a die?
  • BigOnYa @ BigOnYa:
    with your hands, duh. Well uremum has a party trick that she uses something else
  • BakerMan @ BakerMan:
    in chat i mean
  • BakerMan @ BakerMan:
    and what if i don't have any hands? (i mean, i do (duh), but what if i didn't?)
  • K3Nv2 @ K3Nv2:
    Uremum is in the chat and she told me you're grounded
    +1
  • BakerMan @ BakerMan:
    cap
  • Xdqwerty @ Xdqwerty:
    Uremum's mum grounded her
  • K3Nv2 @ K3Nv2:
    This is Bakermans mum you're grounded no internet
    +1
  • BigOnYa @ BigOnYa:
    He must be listening, no response
  • K3Nv2 @ K3Nv2:
    Well he shouldn't have used chatgpt to do his homework
    +1
  • Xdqwerty @ Xdqwerty:
    Wut
  • HiradeGirl @ HiradeGirl:
    I got crabs
  • Xdqwerty @ Xdqwerty:
    The crustacean or the disease?
  • K3Nv2 @ K3Nv2:
    Well we warned you about Juan
    +4
  • wolffangalchemist @ wolffangalchemist:
    I personally love seafood.
  • Xdqwerty @ Xdqwerty:
    Good night
  • BakerMan @ BakerMan:
    i personally dislike seafood
  • BakerMan @ BakerMan:
    except tuna salad, a tuna melt fucking slaps dude
    BakerMan @ BakerMan: except tuna salad, a tuna melt fucking slaps dude