adrielcafe / NMSAlphabetAndroidApp

An unofficial translator app for No Man's Sky
https://play.google.com/store/apps/details?id=cafe.adriel.nmsalphabet.free
MIT License
25 stars 12 forks source link

Mining translations from screenshots #8

Open KarneAsada opened 7 years ago

KarneAsada commented 7 years ago

First off, thanks for the app. I love it.

You may already be doing this, but if not, you could use the screenshot/OCR functionality to mine for translations. Every user has some translations, and I'm assuming there is a random distribution of what words people know. When they submit a screenshot, those words are already defined. You could compare people's submissions and find the differences that are human words, and then use that to infer the alien translation.

I'd be willing to help.

adrielcafe commented 7 years ago

Thanks @KarneAsada!

I'm following another ways:

  1. Trying to extract the alien words and their translations from the game files. I found all translations in all languages:

Now I'm looking for the alien words, but seems they are encrypted and are hard to find 😕

  1. I'm using this table from Cheat Engine to toggle between the alien words and their english translations in-game. This way I can discover, one by one, all the alien words. But is a slow way to discover all words from the game.

This week I'll release a new simplified version of the app with more translations. All help are welcome!

KarneAsada commented 7 years ago

Cool, I'm on PS4, so I don't have access to those files (easily at least).

Manually entering the translations seems like a pain. Thanks for the hard work. There must be an easier way to extract them from the game files.

I wonder if they used an algorithmic method to create the alien words. It seems like it would have been a pain to create them manually. Does it seem like there is a pattern?

adrielcafe commented 7 years ago

There is an "easier" way to get these words. The Assembler Script below from this Cheat Engine table can decode all alien words. But I have no idea about how to extend this script to dump the words into a file, for example.

<CheatEntry>
          <ID>1465</ID>
          <Description>"Universial Translator (Decode Words)"</Description>
          <LastState/>
          <VariableType>Auto Assembler Script</VariableType>
          <AssemblerScript>[ENABLE]
aobscanmodule(words,NMS.exe,EB 02 32 C9 84 C9)
words:
  db 90 90 B1 01
registersymbol(words)

[DISABLE]
words:
  db EB 02 32 C9
unregistersymbol(words)

{
// ORIGINAL CODE - INJECTION POINT: "NMS.exe"+892E6C

"NMS.exe"+892E4C: 0F 1F 40 00           -  nop [rax+00]
"NMS.exe"+892E50: 4C 39 00              -  cmp [rax],r8
"NMS.exe"+892E53: 75 06                 -  jne NMS.exe+892E5B
"NMS.exe"+892E55: 48 39 50 08           -  cmp [rax+08],rdx
"NMS.exe"+892E59: 74 0B                 -  je NMS.exe+892E66
"NMS.exe"+892E5B: 48 83 C0 18           -  add rax,18
"NMS.exe"+892E5F: 48 3B C1              -  cmp rax,rcx
"NMS.exe"+892E62: 74 0A                 -  je NMS.exe+892E6E
"NMS.exe"+892E64: EB EA                 -  jmp NMS.exe+892E50
"NMS.exe"+892E66: 41 0F B6 4C 04 10     -  movzx ecx,byte ptr [r12+rax+10]
// ---------- INJECTING HERE ----------
"NMS.exe"+892E6C: EB 02                 -  jmp NMS.exe+892E70
"NMS.exe"+892E6E: 32 C9                 -  xor cl,cl
"NMS.exe"+892E70: 84 C9                 -  test cl,cl
// ---------- DONE INJECTING  ----------
"NMS.exe"+892E72: 0F 84 A3 00 00 00     -  je NMS.exe+892F1B
"NMS.exe"+892E78: 48 8D 05 1D 4B AB 00  -  lea rax,[NMS.exe+134799C]
"NMS.exe"+892E7F: 48 89 45 A0           -  mov [rbp-60],rax
"NMS.exe"+892E83: 48 8D 05 0E 4B AB 00  -  lea rax,[NMS.exe+1347998]
"NMS.exe"+892E8A: 48 89 45 A8           -  mov [rbp-58],rax
"NMS.exe"+892E8E: 48 8D 05 2B 4B AB 00  -  lea rax,[NMS.exe+13479C0]
"NMS.exe"+892E95: 48 89 45 B0           -  mov [rbp-50],rax
"NMS.exe"+892E99: 48 8D 1D 5E C7 A9 00  -  lea rbx,[NMS.exe+132F5FE]
"NMS.exe"+892EA0: 48 89 5D B8           -  mov [rbp-48],rbx
"NMS.exe"+892EA4: 48 8D 05 0D 4B AB 00  -  lea rax,[NMS.exe+13479B8]
}
          </AssemblerScript>
</CheatEntry>