ROM Hack Trouble running custom .code

Status
Not open for further replies.

JustPingo

Well-Known Member
OP
Member
Joined
Jan 11, 2015
Messages
497
Trophies
0
Age
24
XP
1,081
Country
France
Hello everyone!

So, I'm having trouvle using HANS. So, I extracted properly code.bin using ctrtool and those commands :

ctrtool --contents=contents myCIA.cia
ctrtool -p --exefs=exefs.bin contents.0000.WHATEVER
ctrtool -t exefs --exefsdir=exefs --decompresscode exefs.bin

My CIA is a homebrew that has nothing to do with any of the app I'm trying to inject it into, but it doesn't have any romFS, so I guess its .code could run alone (it's a simple homebrew).
So then, I wanted to inject it on the eShop to try, so I renamed it and placed it like this:

sd:/hans/00022900.code

In HANS, I set the region to EUR because my console is EUR, no special language, O3DS-type clock speed, Code to YES, Romfs to NO, Save to NO. Then I start. But I get this, and can't figure out why:

1445864131-error.jpg
(sorry for the terrible quality, the last line is invalidated icache)

I tried with other apps to inject in, changing the name in the hans folder, but same error. When there is no .code, it just gets back to homebrew menu so the .code is detected. It is 544KB by the way.

Do you guys have any idea?
Thanks in advance!
 

Mrrraou

Well-Known Member
Member
Joined
Oct 17, 2015
Messages
1,873
Trophies
0
XP
2,374
Country
France
That's something I tried too, and I couldn't get it to work either. At the moment, HANS is closed source, so it doesn't help.
 
Last edited by Mrrraou,

MRJPGames

Pretty great guy
Member
Joined
Aug 17, 2013
Messages
1,199
Trophies
1
Location
The Netherlands
Website
fizazy.com
XP
1,676
Country
Netherlands
Possibly intentionally so we can't pirate with this...

Did you remove the first 1000 or so bytes of data(Search Smea's Twitter for the actual amount)? Just try that, shouldn't make a difference but might be worth the shot?
 
  • Like
Reactions: CeeDee

Mrrraou

Well-Known Member
Member
Joined
Oct 17, 2015
Messages
1,873
Trophies
0
XP
2,374
Country
France
Possibly intentionally so we can't pirate with this...

Did you remove the first 1000 or so bytes of data(Search Smea's Twitter for the actual amount)? Just try that, shouldn't make a difference but might be worth the shot?
0x1000 bytes isn't 1000 bytes, but 4096 bytes (Hexadecimal -> decimal) ;) And these instructions are only for the romfs, but I'll try.
 

Mrrraou

Well-Known Member
Member
Joined
Oct 17, 2015
Messages
1,873
Trophies
0
XP
2,374
Country
France
I only vaguely remembered from Twitter, actually pretty proud I got the amount of zero's right XD
However, I still don't think that it would work, because the .code file is ARM compiled code.

--------------------- MERGED ---------------------------

Still the same crash even with removing the 0x1000 first bytes.
 

MRJPGames

Pretty great guy
Member
Joined
Aug 17, 2013
Messages
1,199
Trophies
1
Location
The Netherlands
Website
fizazy.com
XP
1,676
Country
Netherlands
However, I still don't think that it would work, because the .code file is ARM compiled code.

--------------------- MERGED ---------------------------

Still the same crash even with removing the 0x1000 first bytes.
As I said: "shouldn't make a difference but might be worth the shot", but yeah I hoped it would work however unlikely it was... :(
 

JustPingo

Well-Known Member
OP
Member
Joined
Jan 11, 2015
Messages
497
Trophies
0
Age
24
XP
1,081
Country
France
The thing is that we don't even have a proper explanation on what it does, even without the details. So we can't even try to do stuff and we get blocked by any difficulty because we're completely blind on what's going on behind the scene.
 
  • Like
Reactions: Mrrraou

Mrrraou

Well-Known Member
Member
Joined
Oct 17, 2015
Messages
1,873
Trophies
0
XP
2,374
Country
France
The thing is that we don't even have a proper explanation on what it does, even without the details. So we can't even try to do stuff and we get blocked by any difficulty because we're completely blind on what's going on behind the scene.
That's the whole problem, and nobody would explain us how to do that.
 

shinyquagsire23

SALT/Sm4sh Leak Guy
Member
Joined
Nov 18, 2012
Messages
1,977
Trophies
2
Age
26
Location
Las Vegas
XP
3,765
Country
United States
It's most likely compressed. I believe ctrtool or 3dstool has an option to decompress on extracting. Also, the sections have to line up to the original, so update code bins can't be loaded (easily).

Edit: probably not compressed actually, could be borked on the HANS side though.
 
Last edited by shinyquagsire23,

Mrrraou

Well-Known Member
Member
Joined
Oct 17, 2015
Messages
1,873
Trophies
0
XP
2,374
Country
France
It's most likely compressed. I believe ctrtool or 3dstool has an option to decompress on extracting. Also, the sections have to line up to the original, so update code bins can't be loaded (easily).

Edit: probably not compressed actually, could be borked on the HANS side though.
By sections, I'm not sure what are you talking about exactly.
Is there a way we can modify a game .code to run an homebrew instead ? Even if we have to do it manually, how can we do that ?
 

Mrrraou

Well-Known Member
Member
Joined
Oct 17, 2015
Messages
1,873
Trophies
0
XP
2,374
Country
France
How do we know the section locations in the .code file ? And do you know a good ARM disassembler ?
 

Mrrraou

Well-Known Member
Member
Joined
Oct 17, 2015
Messages
1,873
Trophies
0
XP
2,374
Country
France
Had a (probably stupid) idea relating to code replacement:

HANS can edit the eshop. Does the eshop have access to the service needed to install .cia files? If so, you could edit the eshop exefs with something which could install "legit" CIAs, which won't fail the signature check.
We can. That's what I'm trying to do. But we can even do better.
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    OctoAori20 @ OctoAori20: Nice nice-