bpk59 Posted May 27, 2011 Share Posted May 27, 2011 (edited) Update: problem solved, info a little further down! Hi all, I'm a Linux dev by profession and a lifelong Pokemon fan I was getting irritated trying to receive a certain Pokemon from a popular GTS distribution so I decided to run an experiment... I used the awesome GTS & pkm struct wikis hosted here (incredible job by the community!), modified ir-gts-bw and captured & studied the headers from a GTS transfer. After more experimentation I figured if I captured the output from the following, I should be able to get a .pkm file data back from the server: $ curl 'http://<distro_server>/worldexchange/result.asp?' Well, I do get what looks some .pkm data, but it's 336 bytes. I dd'd the first 236 bytes of the response to a file, and this file is indeed a valid .pkm file - it opens in PokeGen and everything seems cool with it. So I scripted downloading all unique .pkm from this distro server by this method and have 60+ files to deal with... At this point, I can save one of these files in PokeGen as a 236-byte non-encrypted pkm file (which is actually only 220 bytes for B/W) and this can then be sent to my game via ir-gts-bw. I tried trimming the last 16 bytes from my 236 byte files to make them 220 bytes, but these aren't valid .pkm files. I could open them all up in PokeGen and save them, but would rather not spend the time doing so if I don't have to. TL;DR - Is there a script to convert a GenV 236-byte .pkm into a 220-byte file? I know I can do it in PokeGen but I'm a script kinda guy. I'd be happy to provide more info if someone can help. Thanks! Edited June 2, 2011 by bpk59 Link to comment Share on other sites More sharing options...
Kaphotics Posted May 27, 2011 Share Posted May 27, 2011 KazoWAR has a Poke Transfer converter http://projectpokemon.org/forums/showthread.php?14371-Pok%E9-Transfer&highlight=Poke+Transfer Don't think he posted the source, but I created a thread on all of the PKM changes http://projectpokemon.org/forums/showthread.php?11474-Hex-Values-and-Trashbytes-in-B-W&p=93598&viewfull=1#post93598 Link to comment Share on other sites More sharing options...
bpk59 Posted May 27, 2011 Author Share Posted May 27, 2011 KazoWAR's PokeTransfer looks good but it was built on .net and wine's complaining when I try to install the redistributable. So it looks like I'm either going to have to 1) Use a windows VM to pokexfer them, or 2) try this: http://projectpokemon.org/forums/showthread.php?14875-Pokemon-Shifting-(4G-5G)-python-code Thanks for the help Link to comment Share on other sites More sharing options...
bpk59 Posted June 2, 2011 Author Share Posted June 2, 2011 (edited) For anyone who cares, I figured out how to deal with the PKM data that came back from a curl to a GTS server. I wrote a script that uses the ir-gts-bw code library - put it in the src/ folder and it should pickup the necessary imports. See the attached for the script and for the example .pkm file I created with this method 1. Do the curl, redirect output to a file: $ curl -s 'http://75.18.142.225/worldexchange/result.asp?' > curl.pkm 2. Bonus points - make sure it's a 336 byte file: $ ls -l curl.pkm -rw-r--r-- 1 bpk59 bpk59 336 2011-06-02 18:00 curl.pkm 3. Use the prep_gts_pkm.py script on curl.pkm - the script will make a new file called "<pkm_file>.136.decoded.pkm": ir-gts-bw/src$ ./prep_gts_pkm.py curl.pkm curl.pkm does not equal 136 bytes, trimming ... Writing new pkm file: curl.136.decoded.pkm ir-gts-bw/src$ ls -l curl.136.decoded.pkm -rw-r--r-- 1 bpk59 bpk59 136 2011-06-02 18:07 curl.136.decoded.pkm 4. This file, now 136 bytes, is a decoded .pkm file. It can now be sent via ir-gts-bw! curl_prep_pkm..zip Edited June 2, 2011 by bpk59 uploaded scripts Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now