How do we go about identifying the friend code out of the <friend-ID>, and vice-versa? I mainly want to know so I can match friend-ids to people, after they sign up wherever we host servers, and input their friend code for their specific game.
Friend codes
-
-
The friend id are the last 4 byte of the friend code. The others are a Checksum, at the moment the other way is impossible.
For example, if my friend code is 3996-0519-2263, it is 0x5d0a535647 in hex, and the last 4 bytes in dec are 173233735. So my friend id is 173233735.DevkitPro Archiv (alte Versionen / old versions): wii.leseratte10.de/devkitPro/
Want to donate for Wiimmfi and Wii-Homebrew.com? Patreon / PayPalDieser Beitrag wurde bereits 0 mal editiert, zuletzt von Leseratte ()
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Leseratte ()
-
I suppose I should also keep an eye out for how the top 7 bits of friend codes are derived. I did find caitsith2.com/ds/fc.php.txt while searching for this, which seems to be the algorithm used on DS.
-
Hm, I've tried this algo with "RMC", "RMCJ", RMCP" and "RMCE" but it always told me my friendcode is wrong. So i suppose Wii games use another algorithmus.
EDIT: If someone wants to find out an algorithmus, here is a list of valid friend codes (extracted out of all my network dumps):DevkitPro Archiv (alte Versionen / old versions): wii.leseratte10.de/devkitPro/
Want to donate for Wiimmfi and Wii-Homebrew.com? Patreon / PayPalDieser Beitrag wurde bereits 0 mal editiert, zuletzt von Leseratte ()
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von Leseratte ()
-
I just looked at my savegame (and searched for my Friendcodes) and found something interesting. As some maybe know I have copied my Friendcode from one to another profile. And now to the interesting thing: not just the 4 bytes of the savegame are the same but also the 44 bytes before the Friendcode.Ich gehe nur bei Frauen im Alter von 18 bis 20 die Bettwäsche testen.
-
I've just managed to find the routine that converts the PID to a friend code at 800ec6bc in PAL (input unknown data structure including pid at offset 28, output 64 bit friend code in r3 and r4). Stay tuned for a translation to pseudocode.
-
Chadderz schrieb:
I've just managed to find the routine that converts the PID to a friend code at 800ec6bc in PAL (input unknown data structure including pid at offset 28, output 64 bit friend code in r3 and r4). Stay tuned for a translation to pseudocode.
Very interesting.
Today I have tried several CRC8 checksums (brute force with different polynomials and initial values, also different combinations of FC (big+little endian) and Game ID). Found nothing.
If we found the algorithm, it is perhaps the same for the packet checksums.
Wiimms Mario Kart Fun 2023-09
Mittwochs & Donnerstags
ab 19:30 Uhr CEST (17:30 UTC)
mit Team-Speak (freiwillig)
FC: Wiimm=0432-5226-7951, Leseratte=2880-9868-0945
WIT: Wiimms ISO Tools
Verwaltet Plain ISO, WDF, WIA, CISO, WBFS, FST: kann Extrahieren, Erstellen, Patchen, Mischen und Überprüfen
SZS: Wiimms SZS Tools
Verwaltet SZS-, BRRES-, U8-, BMG-, BREFT-Dateien uvm.
PN ohne persönlichen Charakter werden ignoriert. Support-Anfragen gehören ins Forum.
-
It seems to be based on an MD5 of something. The last part of the code sets the checksum to the the first 7 bits of an MD5 calculation of a buffer of 8 bytes. 4 of those bytes are the PID, I'm still working on what the other four are.
Edit: See wiki.tockdom.com/wiki/Friend_code for algorithm, took an educated guess the last 4 bytes were RMCJ, which paid off.Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Chadderz ()
-
Chadderz schrieb:
took an educated guess the last 4 bytes were RMCJ, which paid off.
In the Savegame the friendcode starts at 0x64 followed by 2 parsing bytes and those are followed by RMCJ. Thats probably the region (0x38-0x6F) what the Wii sends to the Nintendo Server. Before 0x38 is the Mii data.Ich gehe nur bei Frauen im Alter von 18 bis 20 die Bettwäsche testen. -
I made a page that'll convert a Friend Code to the corresponding Gamespy ID, and also spit out what game that Friend Code is for.
Wii Friend Code to PID
edit: It'll only spit out the game ID if that person has registered someone else's friend code. We can fix this after we establish our own databases.
I'll have to implement the reverse at some point now that Chadderz got it, and test it with some other games. (SSBB, Animal Crossing, etc.)
edit: I tried coding it, but it doesn't give the exact original friend codes in my case. It does generate a friend code that'll result in the same PID though.
PIDtoFC PHP PHP-Quellcode
- <?php
- $pid = $argv[1];
- $gameid = $argv[2]; //RUUJ for Animal Crossing, RMCJ for Mario Kart Wii, etc.
- $md5[16];
- $fbuffer = pack('Va4', $pid, strrev($gameid));
- $pidhash = md5($fbuffer);
- for ($i = 0; $i < 16; $i++)
- {
- $md5[$i] = substr($pidhash, 2 * $i, 2);
- echo "$md5[$i]\n";
- }
- echo ((hexdec($md5[0]) >> 1) << 32) | $pid;
- echo "\n";
- ?>
Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von soneek () aus folgendem Grund: Update with working code
-
Not sure what's wrong with that code, but here is a calcualtion I did that you can use for testing:
PID: 472322707
PID in hex: 1c271293
Buffer to MD5: 9312271c4a44d52
Result of MD5: 5b317f51fe8e9f89c697ceb5a5f79bce
Top 7 bits of MD5: 2d
FC in hex: 2d1c271293
FC in dec: 1937-4585-1027 -
Wrong is: $buffer[0] = substr($pid, 6, 2);
It assigns 2 char string instead of a binary 8 bit number
Wiimms Mario Kart Fun 2023-09
Mittwochs & Donnerstags
ab 19:30 Uhr CEST (17:30 UTC)
mit Team-Speak (freiwillig)
FC: Wiimm=0432-5226-7951, Leseratte=2880-9868-0945
WIT: Wiimms ISO Tools
Verwaltet Plain ISO, WDF, WIA, CISO, WBFS, FST: kann Extrahieren, Erstellen, Patchen, Mischen und Überprüfen
SZS: Wiimms SZS Tools
Verwaltet SZS-, BRRES-, U8-, BMG-, BREFT-Dateien uvm.
PN ohne persönlichen Charakter werden ignoriert. Support-Anfragen gehören ins Forum.
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Wiimm ()
-
Wiimms Mario Kart Fun 2023-09
Mittwochs & Donnerstags
ab 19:30 Uhr CEST (17:30 UTC)
mit Team-Speak (freiwillig)
FC: Wiimm=0432-5226-7951, Leseratte=2880-9868-0945
WIT: Wiimms ISO Tools
Verwaltet Plain ISO, WDF, WIA, CISO, WBFS, FST: kann Extrahieren, Erstellen, Patchen, Mischen und Überprüfen
SZS: Wiimms SZS Tools
Verwaltet SZS-, BRRES-, U8-, BMG-, BREFT-Dateien uvm.
PN ohne persönlichen Charakter werden ignoriert. Support-Anfragen gehören ins Forum.
-
It works now! So far I can confirm it working with MKWii, Animal Crossing: City, NIGHTS, and Snowboard Riot. For some reason it's not working with Smash Bros.. I'll figure that out later, but I'll have a conversion page up in a little bit. Thanks for your help guys.
Updated my previous post with the working code.Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von soneek ()
-
Analysing today's meeting:
After adding Leserattes FC: 1947-4861-4314 => PID 1475085994 my Wii sends:
Quellcode
- 18:28:14.716 ######## add 1947-4861-4314 = 2d.57ec.06aa = 475085994 (Leseratte)
- 18:28:15.392 4>E 192.168.178.51:61171 -> 69.10.30.242:29900, client -1
- 66 (0x42) udp data bytes in 1 record
- -1.----.TPAR, 42 ( 66/dec) bytes, offset 0x00
- addbuddy =
- sesskey = 203677659
- newprofileid = 475085994
- reason =
- final =
- ...
- 18:28:17.927 4>E 192.168.178.51:61171 -> 69.10.30.242:29900, client -1
- 62 (0x3e) udp data bytes in 1 record
- -1.----.TPAR, 3e ( 62/dec) bytes, offset 0x00
- getprofile =
- sesskey = 203677659
- profileid = 475085994
- id = 4
- final =
- ...
- 18:28:18.878 4>E 192.168.178.51:61171 -> 69.10.30.242:29900, client -1
- 161 (0xa1) udp data bytes in 1 record
- -1.----.TPAR, a1 (161/dec) bytes, offset 0x00
- authadd =
- sesskey = 203677659
- fromprofileid = 475085994
- sig = 7db4da241f2dfccd0f51a91c6e39c52f
- final =
- addbuddy =
- sesskey = 203677659
- newprofileid = 475085994
- reason =
- final =
The first digit (newprofileid/profileid ) is cut!!(ERROR by me)
EDIT: here you can find my dump:
* download.wiimm.de/mkw-ana/dumps/2014-03-07-friend-codes/
Wiimms Mario Kart Fun 2023-09
Mittwochs & Donnerstags
ab 19:30 Uhr CEST (17:30 UTC)
mit Team-Speak (freiwillig)
FC: Wiimm=0432-5226-7951, Leseratte=2880-9868-0945
WIT: Wiimms ISO Tools
Verwaltet Plain ISO, WDF, WIA, CISO, WBFS, FST: kann Extrahieren, Erstellen, Patchen, Mischen und Überprüfen
SZS: Wiimms SZS Tools
Verwaltet SZS-, BRRES-, U8-, BMG-, BREFT-Dateien uvm.
PN ohne persönlichen Charakter werden ignoriert. Support-Anfragen gehören ins Forum.
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von Wiimm ()
-
@Wiimm: Do you want me to upload my dump & video too?
DevkitPro Archiv (alte Versionen / old versions): wii.leseratte10.de/devkitPro/
Want to donate for Wiimmfi and Wii-Homebrew.com? Patreon / PayPalDieser Beitrag wurde bereits 0 mal editiert, zuletzt von Leseratte ()
-
Leseratte schrieb:
@Wiimm: Do you want me to upload my dump & video too?
yes
Wiimms Mario Kart Fun 2023-09
Mittwochs & Donnerstags
ab 19:30 Uhr CEST (17:30 UTC)
mit Team-Speak (freiwillig)
FC: Wiimm=0432-5226-7951, Leseratte=2880-9868-0945
WIT: Wiimms ISO Tools
Verwaltet Plain ISO, WDF, WIA, CISO, WBFS, FST: kann Extrahieren, Erstellen, Patchen, Mischen und Überprüfen
SZS: Wiimms SZS Tools
Verwaltet SZS-, BRRES-, U8-, BMG-, BREFT-Dateien uvm.
PN ohne persönlichen Charakter werden ignoriert. Support-Anfragen gehören ins Forum.
-
Upload is finished, here is the link.
wfc-share.com/mkw-log-2014-03-07-test.7z
Do you have any idea why my video is so big? 1h05m have 400 MB (uncompressed), and the ffmpeg-parameter -r didn't work...DevkitPro Archiv (alte Versionen / old versions): wii.leseratte10.de/devkitPro/
Want to donate for Wiimmfi and Wii-Homebrew.com? Patreon / PayPalDieser Beitrag wurde bereits 0 mal editiert, zuletzt von Leseratte ()
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von Leseratte ()
-
@Leseratte:
Which software do you use for recording your video? In case you can use a Windows machine to capture video, I would highly recommend "Open Broadcaster Software" to capture the video. It works with most capture cards and can also record many sources at once because it is mainly designed for broadcasting streams to sites like Twitch.tv but it works just fine to just record videos aswell. It has some advantages over other software since it records the source's audio plus your microphone and your speakers (or whatever you setup). Also, the bitrate and framerate as well as resolution can be freely chosen to keep your video files as small as needed.
EDIT: It is also open source so you might even be able to find or compile builds for other operating systems aswell, although I doubt that it works without some (major) tweaks.Was? Info Modell Standard (weiß, Release-Day) Zubehör interne 500GB HDD, SDHC 32GB, LAN-Adapter, 128MB MemoryCard Wi-Fi Spiele Wiimm's MKW Fun, Mario Kart Wii, Super Smash Bros. Brawl, ...
Was? Info Modell Premium (schwarz, Release-Day) Zubehör 500GB 2,5" HDD (schwarz), SDHC 32GB Wi-Fi Spiele Mario Kart 8, Nintendo Land, Sonic Racing (S&ASRT), ...
Was? Info Modell 3DS XL (blau-schwarz) Zubehör SuperCard DSTwo, 4GB SDHC Wi-Fi Spiele Mario Kart 7, ...
Was? Code / ID Wiimm's MKW-Fun 0904-9558-6482 Nintendo Network ID Enting Nintendo 3DS 5455-9634-9827
Danke an feeder für meinen tollen Avatar! -
I'm using the software which was delivered with my capture card - ArcSoft ShowBiz. But tomorrow I'll try "Open Broadcaster Software", thanks for the hint.
DevkitPro Archiv (alte Versionen / old versions): wii.leseratte10.de/devkitPro/
Want to donate for Wiimmfi and Wii-Homebrew.com? Patreon / PayPalDieser Beitrag wurde bereits 0 mal editiert, zuletzt von Leseratte ()
-
@Leseratte:
I have reduced your video to 54 MiB, upload is running.
Videos are compressed using ffmpeg:
ffmpeg -i INPUT -r 10 -b:v 50k -s 360x240 -preset slow -crf 30.0 -vcodec libx264 -an -y OUTPUT.avi
And here is the next record: delete a profile:
Wiimms Mario Kart Fun 2023-09
Mittwochs & Donnerstags
ab 19:30 Uhr CEST (17:30 UTC)
mit Team-Speak (freiwillig)
FC: Wiimm=0432-5226-7951, Leseratte=2880-9868-0945
WIT: Wiimms ISO Tools
Verwaltet Plain ISO, WDF, WIA, CISO, WBFS, FST: kann Extrahieren, Erstellen, Patchen, Mischen und Überprüfen
SZS: Wiimms SZS Tools
Verwaltet SZS-, BRRES-, U8-, BMG-, BREFT-Dateien uvm.
PN ohne persönlichen Charakter werden ignoriert. Support-Anfragen gehören ins Forum.
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von Wiimm ()
-
How would you delete a profile? Removing a lisence, then creating a new one and then going on WFC on that?
-
No, the record delbuddy Wiimm posted is sent if you delete a buddy - if you remove somebody out of your friend list.
DevkitPro Archiv (alte Versionen / old versions): wii.leseratte10.de/devkitPro/
Want to donate for Wiimmfi and Wii-Homebrew.com? Patreon / PayPalDieser Beitrag wurde bereits 0 mal editiert, zuletzt von Leseratte ()
-
Wiimm schrieb:
The first digit (newprofileid/profileid ) is cut!! (ERROR by me)
And here is a summary of the yesterdays friend codes:
Quellcode
- # mkw-ana -b fc 1937-4861-4314 4299-7181-5607 0949-6436-6645 \
- 4729-2148-9753 0305-3985-8275 3011-2279-8006
- friend code fc as hex player id valid for game
- ----------------------------------------------------------------------
- 1937-4861-4314 2d.1c51.3caa 475085994 RMCJ,R4RJ,RJ2J
- 4299-7181-5607 64.1c51.3cb7 475086007 RMCJ = Mario Kart Wii
- 0949-6436-6645 16.1c51.3d35 475086133 RMCJ,SELJ,SNCJ
- ----------------------------------------------------------------------
- 4729-2148-9753 6e.1c51.4159 475087193 RMCJ = Mario Kart Wii
- 0305-3985-8275 07.1c51.4163 475087203 RMCJ,RFUJ
- 3011-2279-8006 46.1c51.41b6 475087286 RMCJ = Mario Kart Wii
- ----------------------------------------------------------------------
- 1203-9355-6949 1c.0803.e3d5 134472661 my first FC, created at 2008-04-13
Look at the player id: 3 persons made 2 test, and both test with new profiles. The new player ids are very near together in increasing order. I appended my very first FC.
Idea for our own system: We just start with a very low player id, like 1, and there are not many conflicts.
Wiimms Mario Kart Fun 2023-09
Mittwochs & Donnerstags
ab 19:30 Uhr CEST (17:30 UTC)
mit Team-Speak (freiwillig)
FC: Wiimm=0432-5226-7951, Leseratte=2880-9868-0945
WIT: Wiimms ISO Tools
Verwaltet Plain ISO, WDF, WIA, CISO, WBFS, FST: kann Extrahieren, Erstellen, Patchen, Mischen und Überprüfen
SZS: Wiimms SZS Tools
Verwaltet SZS-, BRRES-, U8-, BMG-, BREFT-Dateien uvm.
PN ohne persönlichen Charakter werden ignoriert. Support-Anfragen gehören ins Forum.
-
My old FC info in case it can help:
1334-7142-8252
PID 327442076