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
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=BjK2lPBzGzo