Page 1 of 1

Multilanguage makes things even harder to understand

Posted: 05 Nov 2021, 21:40
by Go4IT
Multilanguage makes things even harder to understand

You all know that IPC supports several languages. They are:
  1. "English"
  2. "Deutsch"
  3. "Italiano"
  4. "Français" (note that special char "c" here)
  5. "Español" (note that special char "n" here)
  6. "Türkçe" (note that special char "c" here)
  7. "pyccкий" (note that special chars "KNN" here)
  8. "Nederlands"
  9. "polski"
  10. "Svenska"
  11. "Português" (note that special char "e" here)
So each string is represented in 11 languages, in fact the image contains 11 language specific strings per text.
So somewhere in the code (RAM, maybe EEPROM) there must be a variable telling the whole system which language was choosen by the user. If the IPC want's to show a string, e.g. "Navigation" it has to respect this setting.

But the representation in the different languages could be of different number of characters. So the code can't deal with a fixed-width stringsize. Think of them as an array. A common array has an index, so you can access each member of that array with an number. In Assembler this could be done with an array of pointers, where each pointer has a fixed length (e.g. 4 Bytes so give it as absolute address). This way the code need to know the base address of that pointer-array and can calculate the offset to the entry needed. Then it loads the pointer stored at the calculated address and can directly access the string in question.

If i'm right there must be such an pointer-array for each text-group. Let's search for that... the String "Navigation" is found at address 0x0007AE2B. If i use ALT-I i find a representation of this address at 0x67C64 (the 6th from the first line):

Code: Select all

MAIN:00067C64                 DCD 0x7AE2B =>"Navigation"
MAIN:00067C68                 DCD 0x7AE36 => "Navigazione"
MAIN:00067C6C                 DCD 0x7AE42 => "Navigation"
MAIN:00067C70                 DCD 0x7AE4D => "Navegación"
MAIN:00067C74                 DCD 0x7AE58 => "Navigasyon"
MAIN:00067C78                 DCD 0x7AE63 => "Ha£ža¯£÷"
MAIN:00067C7C                 DCD 0x7AE6D => "Navigatie"
MAIN:00067C80                 DCD 0x7AE77 => "Nawigacja"
MAIN:00067C84                 DCD 0x7AE81 => "Navigation"
MAIN:00067C88                 DCD 0x7AE8C => "Navegação"
If i hover over the address there, IDA shows the representation of that string
ida-pro_string_preview_by_address.png
And when you proceed to the next entry (DCD is a short for a 4 Bytes of data), 0x7AE36, it shows you the Italian text of navigation. My assumption here is, that the Englisch version is the default and found elsewhere and this array is only used to point to other languages than English.

So i was right, this is a pointer-array. And you even find more of them around that one. Look yourself!

Next would be to find a function using this array to also find out how it makes use of the language-number choosen.