Last active
          August 22, 2021 21:02 
        
      - 
      
- 
        Save NWPlayer123/7044816c02e89075aa1af886269eb7f7 to your computer and use it in GitHub Desktop. 
    Metroid Samus Returns text
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def getstr(f): | |
| ret = "";char = f.read(1) | |
| while char != "\x00": | |
| ret += char | |
| char = f.read(1) | |
| return ret | |
| def getustr(f): | |
| ret = "";char = f.read(2) | |
| while char != "\x00\x00": | |
| ret += char | |
| char = f.read(2) | |
| return ret | |
| data = [] | |
| with open("japanese.txt", "rb") as f: | |
| # change this ^^^ to use | |
| assert f.read(4) == b"BTXT" | |
| assert f.read(4) == b"\x01\x00\x08\x00" #??? | |
| f.seek(0, 2) | |
| size = f.tell() | |
| f.seek(8) | |
| while f.tell() < size: | |
| name = getstr(f) | |
| data.append(name.encode("UTF-16-LE")) | |
| name = getustr(f) | |
| data.append(name) | |
| with open("japanese1.txt", "wb") as o: | |
| # change this ^^^ to use | |
| o.write("\xFF\xFE") | |
| for line in data: | |
| o.write(line + "\r\n".encode("UTF-16-LE")) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Im try to translation this game and want to encrypt is back to binary. How can i do it with this?
And thanks for your hard work.