2 years ago
#42044
Nagy Nabieh
Is there a way to adjust the text size (trying to change text from language to other inside exe PE file) using hex editors
What I'm trying to do is to translate an application interface language from Korean to English
I've added a new section using CFF Explorer because the application doesn't have a size to extend the translated text
Then I used Ghidra to change the address for the text to the new address location
The problem I've faced is that the new text is cropped at specific character
eg.
The original text USB를 읽고 있습니다.
and the new text Reading The USB
the problem is the new text appears like this Reading The US
without the last character, and this problem appears in different places I've tried to change the text with the same approach, I know that this problem is related to the text size but I can't find where I can change the text size
here is a sample of code taken from IDA
.text:00049784 ; =============== S U B R O U T I N E =======================================
.text:00049784
.text:00049784
.text:00049784 sub_49784 ; CODE XREF: sub_491B0+50↑p
.text:00049784 ; DATA XREF: .pdata:00616468↓o
.text:00049784
.text:00049784 var_3C = -0x3C
.text:00049784 var_38 = -0x38
.text:00049784 var_34 = -0x34
.text:00049784 var_30 = -0x30
.text:00049784 var_2C = -0x2C
.text:00049784 var_28 = -0x28
.text:00049784 var_24 = -0x24
.text:00049784 var_20 = -0x20
.text:00049784 var_1C = -0x1C
.text:00049784 var_18 = -0x18
.text:00049784 var_14 = -0x14
.text:00049784 var_10 = -0x10
.text:00049784
.text:00049784 PUSH {R4,R5,LR}
.text:00049788 SUB SP, SP, #0x30
.text:0004978C MOV R4, R0
.text:00049790 LDR R2, [R4,#8] ; xLeft
.text:00049794 MOV R0, #0x41 ; 'A'
.text:00049798 STR R0, [SP,#0x3C+var_10] ; int
.text:0004979C MOV R1, #0xFFFFFF
.text:000497A0 LDR R0, =dword_146998
.text:000497A4 MOV R5, #1
.text:000497A8 STR R1, [SP,#0x3C+var_14] ; int
.text:000497AC MOV R3, #0 ; yTop
.text:000497B0 LDR R1, [R0]
.text:000497B4 LDR R0, =off_11D9E0 ; "Reading the USB"
.text:000497B8 STR R1, [SP,#0x3C+var_18] ; int
.text:000497BC MOV R1, #0x32 ; '2'
.text:000497C0 STR R0, [SP,#0x3C+var_1C] ; int
.text:000497C4 MOV R0, #0x3C ; '<'
.text:000497C8 STR R1, [SP,#0x3C+var_20] ; int
.text:000497CC MOV R1, #0x190
.text:000497D0 STR R0, [SP,#0x3C+var_28] ; int
.text:000497D4 MOV R0, #0xDA ; 'Ú'
.text:000497D8 STR R1, [SP,#0x3C+var_2C] ; wchar_t *
.text:000497DC MOV R1, #0x168
.text:000497E0 STR R0, [SP,#0x3C+var_30] ; int
.text:000497E4 LDR R0, =dword_146CA4
.text:000497E8 STR R1, [SP,#0x3C+var_34] ; int
.text:000497EC MOV R1, #0
.text:000497F0 STR R0, [SP,#0x3C+var_38] ; int
.text:000497F4 STR R1, [SP,#0x3C+var_3C] ; int
.text:000497F8 MOV R1, #0 ; int
.text:000497FC LDR R0, [R4,#0x30] ; int
.text:00049800 STR R5, [SP,#0x3C+var_24] ; int
.text:00049804 BL sub_55320
.text:00049808 LDR R0, [R4,#0x30]
.text:0004980C MOV R3, #1 ; int
.text:00049810 STR R5, [SP,#0x3C+var_3C] ; int
.text:00049814 LDR R0, [R0,#0x70] ; int
.text:00049818 MOV R2, #0 ; int
.text:0004981C MOV R1, #0 ; int
.text:00049820 BL sub_57990
.text:00049824 ADD SP, SP, #0x30 ; '0'
.text:00049828 POP {R4,R5,LR}
.text:0004982C BX LR
.text:0004982C ; ---------------------------------------------------------------------------
.text:00049830 ; const int off_49830
.text:00049830 off_49830 DCD dword_146CA4 ; DATA XREF: sub_49784+60↑r
.text:00049834 ; const int off_49834
.text:00049834 off_49834 DCD off_11D9E0 ; DATA XREF: sub_49784+30↑r
.text:00049834 ; "Reading the USB"
.text:00049838 off_49838 DCD dword_146998 ; DATA XREF: sub_49784+1C↑r
.text:00049838 ; End of function sub_49784
.text:00049838
.text:0004983C
.text:0004983C ; =============== S U B R O U T I N E =======================================
Any suggestions please
windows
winapi
character-encoding
arm
disassembly
0 Answers
Your Answer