0

I am Programming on Mac OS X 10.6 with XCode. Im trying to make a Programm that "decrypts" a Pokemon GBA game so that you can read the dialogs of the game with any Text Editor.

I already got a programm finished witch does that, so I can read all Text Data.

My problem is, that I need to change the clear Text back to Hex after editing it, but I have no Idea what im making wrong.

string PathDE;
string PathGBA;
string Zeichen;
int kontrolle = 0;
int current = 0;

char buffer1[3] = "00";
char buffer2[3] = "a1";
...

schreiben.open(PathGBA.c_str(), ios::out | ios::binary); //writes out the edited hex
lesen.open(PathDE.c_str(), ios::in); //reads in the plain text


while(current <= kontrolle){
    lesen.read(reinterpret_cast<char*>(&a), 1);
    converter << a;
    converter >> Zeichen;
    if(Zeichen == "_"){
        schreiben.write(buffer1,3);
    }
    else if(Zeichen == "0"){
        schreiben.write(buffer2,3);
    }
...

I Tryed that, but when I open the result in a Hex Editor, the ASCII code is only a8.a8.a8.a8... and so on till eof, and the Hex code is 61 38 00 ... till eof.

I also tryed other methods, but all with the same result, I cant write the decoded GBA as Hex so I can play it with edited Text.

4

1 回答 1

0

您需要将字符串转换为具有正确编码的 byte[]。这是 Pokemon http://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_FireRed_-_TBL的 Gen3 文本表

一旦正确转换,您只需将其插入您的 rom。

抱歉,如果这没有多大帮助,但我只制作了 c# Pokemon 工具,而不是 c++。

顺便说一句,口袋妖怪不使用 ascii 十六进制加密,它使用一种 utf8 形式。

于 2015-01-07T04:09:07.223 回答