ROM Hack help with source code to decrypt .sav from bw

marcos91

Member
OP
Newcomer
Joined
Nov 13, 2011
Messages
15
Trophies
0
XP
28
Country
I want to make a "team checker" fifth generation physical tournament but there is a part that does not work well. The part of the block itself, but to decrypt the .sav file doesn't work.

First I want to try a pkm extracted directly from the .sav and then adapt it to the file

I followed this guide but for some reason I'm god at the result, for example bit 8 = c8 (encrypted) would have to get out 83 (decryption) but does not give me that number.

Link of source code and reshiram (encrypted and decrypted with pokegen):
http://www.mediafire.com/?8oti8m294z0sjr5

Anyone know what is wrong? I want to learn how it works

-----------

public class PokemonTeamCheck5Gen {
public static void main(String[] args)throws Exception{

//block a-b-c-d (0-24)
Long pid = 3621399865L;
int a = Math.round(((pid & 0x3E000) >> 0xD) % 24);
System.out.println(a);

//Read encrypted pkm extracted from .sav (0x18E08 - 0x18E0B = pid poke 1)
JFileChooser fileopen = new JFileChooser();
fileopen.setDialogTitle("Team Checker (Written by marcos91)");
if (fileopen.showOpenDialog(null) == JFileChooser.APPROVE_OPTION){
File file = fileopen.getSelectedFile();
FileInputStream fis = new FileInputStream(file);
DataInputStream input = new DataInputStream(fis);

int[] pkm = new int[136];
for (int i=0; i<136; i++){
pkm = input.read();
}

//checksum = 0x27dd (dd27 in little endian)

//Decrypt data
//x[i+1] = x ^ Math.round((0x41C64E6D * 0xdd27 + 0x6073));
int[] x = new int[136];

for (int j=8; j<136; j++){
x[j] = x[j] ^ Math.round((0x41C64E6D * 0x27dd + 0x6073));
System.out.println(x[j]);
}

}
}
}
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan @ BakerMan:
    IT'S LIKE THAT ALMOST EVERY FUCKING METEOR SHOWER TOO
  • BigOnYa @ BigOnYa:
    You need to setup a time lapse camera, be neat
  • BigOnYa @ BigOnYa:
    I actually use a pic of it on my pc desktop cause its cool looking
  • Xdqwerty @ Xdqwerty:
    Apparently the pro versión of pizza boy is back aswell
  • Xdqwerty @ Xdqwerty:
    Gonna download the update
  • Xdqwerty @ Xdqwerty:
    Only 2 antiviruses detected the APK as a virus on virustotal so it Must be safe
  • Xdqwerty @ Xdqwerty:
    Cuz false positive
  • Xdqwerty @ Xdqwerty:
    Wait
  • Xdqwerty @ Xdqwerty:
    Eh nvm
  • BakerMan @ BakerMan:
    sadly, the clouds are setting in now

    hey BigOnYa the clouds are coming from the south, maybe check again
  • Xdqwerty @ Xdqwerty:
    Good night it's 11 pm
  • BakerMan @ BakerMan:
    night
  • BigOnYa @ BigOnYa:
    @BakerMan Nuh I'm in for the night playing Fallout 4, ill look tomorrow night
  • BigOnYa @ BigOnYa:
    Ok had let dog out, and yea still can't see it, oh well. Maybe tom night.
  • K3Nv2 @ K3Nv2:
    Ballocks these drives aren't allowing raid
  • BigOnYa @ BigOnYa:
    That sucks, well you will get double the space then atleast.
  • K3Nv2 @ K3Nv2:
    @Sicklyboy needs to come back
  • BigOnYa @ BigOnYa:
    Did you try Raid 10?
  • K3Nv2 @ K3Nv2:
    I did raid69
  • K3Nv2 @ K3Nv2:
    The physical disk keeps disabling in bios
  • BakerMan @ BakerMan:
    hey ken did you see the aurora tonight?
  • BakerMan @ BakerMan:
    also sorry it was too cloudy, that sucks
  • SylverReZ @ SylverReZ:
    @K3Nv2, This chat is sponsored by Raid Shadow Legends.
  • K3Nv2 @ K3Nv2:
    So I guess raid0 doesn't allow mismatched storage oh well
    K3Nv2 @ K3Nv2: So I guess raid0 doesn't allow mismatched storage oh well