ROM Hack How can I modify the text in the code.bin file?

aktkglfh

New Member
OP
Newbie
Joined
Jan 8, 2017
Messages
4
Trophies
0
Age
35
XP
64
Country
Hello. I am now working on converting srw ux from Japanese to Korean. I found almost all of the Japanese text, but the text in exefs / code.bin is getting an error even if I increase only one character (2bytes). This code.bin contains very important text and I have to modify it. However, because I use Unicode, I can not use English to change it. (English needs a byte longer than Hangul.)

Could you tell me how to modify this exefs / code.bin? Rather than just replacing hex data, some need to increase bytes.

If anyone knows about this method, please let me know. Thanks!
 

LITTOMA

Well-Known Member
Newcomer
Joined
Nov 14, 2014
Messages
81
Trophies
0
Age
30
XP
352
Country
China
Here's my idea:
You should replace the text pointer at run time dynamically.

All strings in code.bin are terminated with '\0' (2 zero bytes in UTF-16) and their offsets are fixed. For this reason, their lengths are NOT extendable inplace.
 
  • Like
Reactions: aktkglfh

aktkglfh

New Member
OP
Newbie
Joined
Jan 8, 2017
Messages
4
Trophies
0
Age
35
XP
64
Country
Here's my idea:
You should replace the text pointer at run time dynamically.

All strings in code.bin are terminated with '\0' (2 zero bytes in UTF-16) and their offsets are fixed. For this reason, their lengths are NOT extendable inplace.

Thanks for the reply! I think your idea is good.
If you want to run your idea, should I use the ntr plugin?
I don't know the exact meaning of "run time dynamically".
 

LITTOMA

Well-Known Member
Newcomer
Joined
Nov 14, 2014
Messages
81
Trophies
0
Age
30
XP
352
Country
China
Thanks for the reply! I think your idea is good.
If you want to run your idea, should I use the ntr plugin?
I don't know the exact meaning of "run time dynamically".

Here's the basic step:
1. Extract the orignal texts.
2. Translate the texts.
3. Calculate the hash of the orignal texts.
4. Save the hash->translated-text pair to a file in your way.
5. Hook the print string function of the game. There should be a string pointer parameter pointed to the orignal string in code.bin. You should do the following stuff in hooked function:
1) Calculate hash of the string, which is passed by the string pointer.
2) Find the match hash in your hash->translated-text pair entries.
3) Replace the pointer with the translated text pointer and call the orignal print function.
 

aktkglfh

New Member
OP
Newbie
Joined
Jan 8, 2017
Messages
4
Trophies
0
Age
35
XP
64
Country
Here's the basic step:
1. Extract the orignal texts.
2. Translate the texts.
3. Calculate the hash of the orignal texts.
4. Save the hash->translated-text pair to a file in your way.
5. Hook the print string function of the game. There should be a string pointer parameter pointed to the orignal string in code.bin. You should do the following stuff in hooked function:
1) Calculate hash of the string, which is passed by the string pointer.
2) Find the match hash in your hash->translated-text pair entries.
3) Replace the pointer with the translated text pointer and call the orignal print function.

Actually I was not a programmer, so I did not understand everything. But! I know your explanation is very beneficial! Thanks for taking the time to answer :)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Going with that right now with a dental claim morons put the wrong company name and rejected claims been on hold an hour for the claims department
  • K3Nv2 @ K3Nv2:
    @Sicklyboy, BTW is it better to go usb or bt for these mini Pcs figure you may know since you play with rack systems so much
  • Sicklyboy @ Sicklyboy:
    Counting my blessings that my insurance hasn't caused me really any headache (yet, at least) despite the fact that I've been getting way more appointments and what not recently due
  • Sicklyboy @ Sicklyboy:
    @K3Nv2, what do you mean, what are you trying to do?
  • K3Nv2 @ K3Nv2:
    Just looking at a built in mouse pad keyboard combo
  • K3Nv2 @ K3Nv2:
    I loose the dongle constantly but they may have better connection with usb frequency
  • Sicklyboy @ Sicklyboy:
    Imo Bluetooth is always a option of last resort for me
  • Sicklyboy @ Sicklyboy:
    Except for phones because it tends to be pretty reliable there
  • K3Nv2 @ K3Nv2:
    I got a bad habit of taking out usb transmitter and loosing it because they can't you know print names on the damn things
  • Sicklyboy @ Sicklyboy:
    But any desktop OS, I've never had anything but frustration trying to get Bluetooth devices to work reliably and stable. It might pair and connect once, and then next time I go to use it I have to delete and re-pair it again
  • K3Nv2 @ K3Nv2:
    5.3 has been so good I think 6 is really going to make it stable
  • K3Nv2 @ K3Nv2:
    I remember how shit 3 was
  • Sicklyboy @ Sicklyboy:
    Ptouch labeler aren't terribly expensive, label shit yourself fam. This is the one I own and there are cheaper ones too https://www.amazon.com/Brother-P-Touch-PTH110BP-Portable-included/dp/B09QXYND6S
  • Sicklyboy @ Sicklyboy:
    Solves part of the problem, mixing up which dongle is which. Then you just have to not lose them lol
  • K3Nv2 @ K3Nv2:
    Double D would be proud
    +1
  • Sicklyboy @ Sicklyboy:
    Even my Xbox One controller I have it paired to my desktop over Bluetooth, it USUALLY works but sometimes it refuses to connect and I have to delete and re-pair it. Maddening
  • K3Nv2 @ K3Nv2:
    Gigabytes built in mobo bt/wifi pairs pretty decent
  • Sicklyboy @ Sicklyboy:
    That's what I'm using :(
  • K3Nv2 @ K3Nv2:
    Ran a driver update in device manager?
  • Sicklyboy @ Sicklyboy:
    Not recently but I think it's less a driver issue and more just Windows having a garbage Bluetooth stack
  • K3Nv2 @ K3Nv2:
    Could be I was having issues when I first upgraded it and didn't realiser gigabyte has specific driver revisions which is stupid
  • K3Nv2 @ K3Nv2:
    Which is married to the boards revision
  • Xdqwerty @ Xdqwerty:
    Made my first review
  • RedColoredStars @ RedColoredStars:
    I've gone years without ever removing a logitech usb transmitter. Across several replacements of keyboards and mice. It just stays put.
  • Sicklyboy @ Sicklyboy:
    tldr usb > bluetooth imo
    +1
    Sicklyboy @ Sicklyboy: tldr usb > bluetooth imo +1