Difference between revisions of "Wiimms mkw-ana (tool)"
m |
(mkw-ana v0.10) |
||
Line 16: | Line 16: | ||
|- | |- | ||
! Current Version: | ! Current Version: | ||
− | | 0. | + | | 0.10, 2013-06-01 |
|} | |} | ||
Line 42: | Line 42: | ||
<pre> | <pre> | ||
− | mkw-ana v0. | + | mkw-ana v0.10 r1577 - 2013-06-01 |
− | |||
− | |||
− | - | + | - Complete new RACE command: Print a live race table of all players with the |
− | + | following infos: | |
− | + | - Rank in race | |
− | + | - Position on map | |
− | + | - Lakitu status | |
+ | - Drift status | ||
+ | - Drift counters | ||
+ | - Friend code | ||
+ | - Mii name | ||
− | - | + | - First cheat check: The new option --drift enables the checking of drift |
+ | stages (drift,blue,yellow). For command LOG and RACE it is always enabled. | ||
+ | *** This cheat check is EXPERIMENTAL! *** | ||
− | - | + | - Option --delta works now nibble based instead of byte based. |
− | |||
− | |||
− | |||
− | - | + | - Several small improvements. |
− | |||
− | |||
− | |||
</pre> | </pre> | ||
;Old change log: | ;Old change log: | ||
<spoiler><pre> | <spoiler><pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
mkw-ana v0.07 r1475 - 2013-02-24 | mkw-ana v0.07 r1475 - 2013-02-24 | ||
Line 158: | Line 86: | ||
- Command 'HELP COMMANDS' prints a list of all commands and 'HELP OPTIONS' | - Command 'HELP COMMANDS' prints a list of all commands and 'HELP OPTIONS' | ||
a list of all global and command specific options. | a list of all global and command specific options. | ||
+ | |||
+ | |||
+ | mkw-ana v0.09 r1532 - 2013-05-04 | ||
+ | |||
+ | - Tool supports reading of bzip2 compressed tcpdump files. | ||
+ | - Command FLOWRATES will now scan all IP packets with correct sender. | ||
+ | - New option: --min-race=NUM: If a Grand Prix (single or team) is aborted, the | ||
+ | results of the Grand Prix are only used in the statstics, if NUM races has | ||
+ | been completed. The default is 2 and possible values are 0..4. | ||
+ | - Option --hex-only is now ignored and will be removed in the future. | ||
+ | - New option: --native (-n): If set, some known values, records or packets | ||
+ | are printed in native format instead as hex number. If set twice, some other | ||
+ | values, that will destroy the column layout of the hexdump, will printed in | ||
+ | native format too. This option replaces --hex-only. | ||
+ | - If using -nn (2x --native), some more known values are printed in native | ||
+ | presentaion as part of the hex dumps. | ||
+ | - Some minor bugs fixed. | ||
</pre></spoiler> | </pre></spoiler> | ||
Line 166: | Line 111: | ||
<spoiler><pre> | <spoiler><pre> | ||
− | mkw-ana v0. | + | mkw-ana v0.10/x86_64 r1577 -- Dirk Clemens -- 2013-06-01 |
-------------------------------------------------------- | -------------------------------------------------------- | ||
Line 210: | Line 155: | ||
TOTALS | T : Print all totals as text dump. | TOTALS | T : Print all totals as text dump. | ||
− | RACE : Live | + | RACE : Live race table of all players. The screen is updated every |
+ | 0.5 seconds. | ||
Type 'mkw-ana HELP command' to get command specific help. | Type 'mkw-ana HELP command' to get command specific help. | ||
Line 216: | Line 162: | ||
Global options: | Global options: | ||
− | -V --version | + | -V --version Stop parsing the command line, print a version info and |
− | + | exit. | |
− | -h --help | + | -h --help Print help and exit. If the first non option is a valid |
− | + | command name, then a help for the given command is | |
− | --xhelp | + | printed. |
− | + | --xhelp Stop parsing the command line and print a help message | |
− | --width width | + | with all commands included. Exit after printing. |
− | + | --width width Define the width (number of columns) for help and some | |
− | + | other messages and disable the automatic detection of the | |
− | -q --quiet | + | terminal width. |
− | + | -q --quiet Be quiet and print only error messages. All previous | |
− | + | --verbose are canceled. Multiple usage is possible. The | |
− | -v --verbose | + | impact is command dependent. |
− | + | -v --verbose Be verbose and print more progress information. All | |
− | + | previous --quiet are canceled. Multiple usage is possible. | |
− | -A --allow-all | + | The impact is command dependent. |
− | + | -A --allow-all Usually commands accept only options with impact to the | |
− | + | command. All other options fire an syntax error. But if | |
− | --old | + | --allow-all is set, all commands accept all options. |
− | + | --old Use old implementation if available. All previous --new | |
− | --new | + | are canceled. |
− | + | --new Use new implementation if available. All previous --old | |
+ | are canceled. | ||
− | --bmg file | + | --bmg file Read a BMG text file to scan online chat messages and |
− | + | track, driver and vehicle names. Disable auto load of BMG | |
− | + | files. Multiple usage is possible. | |
− | --team file | + | --team file Read a text file for team assignments and disable auto |
− | + | load of team files. Multiple usage is possible. | |
+ | --origin x,y,z Define an alternative origin for positions. | ||
Command specific options with common description: | Command specific options with common description: | ||
+ | |||
--adjust float Adjust time stamps of the network dump by adding 'float' | --adjust float Adjust time stamps of the network dump by adding 'float' | ||
Line 321: | Line 270: | ||
'HH:MM:SS.sss' is used. All previous --brief are canceled. | 'HH:MM:SS.sss' is used. All previous --brief are canceled. | ||
--rel Print timestamps as seconds relative to the beginning. | --rel Print timestamps as seconds relative to the beginning. | ||
− | Dependent of option --long the | + | Dependent of option --long the formats are: 'SSSSS', |
'SSSSS.s' or 'SSSSS.sss' | 'SSSSS.s' or 'SSSSS.sss' | ||
--rel-info Like --rel, but reset the origin whenever a reference time | --rel-info Like --rel, but reset the origin whenever a reference time | ||
is defined in the info file. | is defined in the info file. | ||
− | -1 --one-line Print the hexdumps as one line for each | + | -1 --one-line Print the hexdumps as one line for each record. This makes |
the dumps horizontal very large, but it is good for | the dumps horizontal very large, but it is good for | ||
comparing objects of the same type. Very helpful is to | comparing objects of the same type. Very helpful is to | ||
Line 336: | Line 285: | ||
-a --ascii Append an ASCII character dump behind the hexdump. This | -a --ascii Append an ASCII character dump behind the hexdump. This | ||
option is ignored if using --one-line. | option is ignored if using --one-line. | ||
− | -n --native If set, some known values | + | -n --native If set, some known values are printed in native format |
− | + | instead as simple hex number. If set twice, some other | |
− | + | values, that will destroy the column layout of the | |
hexdump, will printed in native format too. | hexdump, will printed in native format too. | ||
− | |||
− | |||
-d --delta If set, record data is compared with the data of the | -d --delta If set, record data is compared with the data of the | ||
− | previous record of same type and client. If a | + | previous record of same type and client. If a nibble (4 |
− | unchanged, a ' | + | bits) is unchanged, a '-' is printed intead of a hex |
− | -I --index ranges Dump only bytes selected by the range list. This make the | + | digit. |
− | + | -I --index ranges Dump only bytes witn an index selected by the range list. | |
+ | This make the hex dump smaller especially for one-line | ||
+ | dumps. | ||
The parameter is a comma separated list of INDEX, | The parameter is a comma separated list of INDEX, | ||
INDEX1:, INDEX1:INDEX2 and INDEX#LENGTH elements. | INDEX1:, INDEX1:INDEX2 and INDEX#LENGTH elements. | ||
Line 354: | Line 303: | ||
used in the statstics, if NUM races has been completed. | used in the statstics, if NUM races has been completed. | ||
The default is 2 and possible values are 0..4. | The default is 2 and possible values are 0..4. | ||
+ | --drift Print drift statistics during logging. | ||
--log file Log into the file using the same output as command LOG. If | --log file Log into the file using the same output as command LOG. If | ||
Line 370: | Line 320: | ||
--sleep float Sleep 'float' seconds after a race has finished. This | --sleep float Sleep 'float' seconds after a race has finished. This | ||
option slows down a simulation run direct after logging | option slows down a simulation run direct after logging | ||
− | and printing the race statistics. | + | and printing the race statistics. Start with values of the |
+ | range from 3 to 15 seconds. | ||
--mii dir Extract Miis to the already existing directory 'dir'. | --mii dir Extract Miis to the already existing directory 'dir'. |
Revision as of 14:41, 1 June 2013
File:Wiimms-SZS-Tools.png | |
Author: | Wiimm |
---|---|
Operating Systems: | Linux (i386,x86_64), Windows (cygwin). |
Software Type: | Mario Kart Wii network analyzer |
File Formats: | PCAP 2.4 (tcpdump), BMG (text). |
Current Version: | 0.10, 2013-06-01 |
The tools mkw-ana is a new project by Wiimm to analyze the network protocol of Mario Kart Wii.
Intention
In November 2012, Wiimm decided to analyze the network protocol of Mario Kart Wii. The main goal was to discover online cheaters. Another goal is to set up his own server if any time Nintendo will shut down its servers.
So the main feature is to dump the packets of a tcpdump (done by tcpdump or wireshark) in a user-friendly format. After first experiments, it becomes also a live racing statistic tool.
Terms and definition
The Tool
Change log
mkw-ana v0.10 r1577 - 2013-06-01 - Complete new RACE command: Print a live race table of all players with the following infos: - Rank in race - Position on map - Lakitu status - Drift status - Drift counters - Friend code - Mii name - First cheat check: The new option --drift enables the checking of drift stages (drift,blue,yellow). For command LOG and RACE it is always enabled. *** This cheat check is EXPERIMENTAL! *** - Option --delta works now nibble based instead of byte based. - Several small improvements.
- Old change log
Built-in Help
Let's start with the built-in help as an overview about the tool:
General Description
The tool started as simple hex dumper reading network dumps in PCAP format. In the first phase of the tool, the textual dumps of wireshark and tcpdump were much better. But after only a few days, the tool learned to handle records, clients, users, friend codes and Miis. From this moment the tool was better to analyze the Mario Kart Wii traffic.
Now, mkw-ana split the traffic into records and scans some data to detect stages of the online meeting. Stages are for example room, prepare race, count down, racing and end of race. It is able to separate races into events (grand prix and team rand prix) and to calculate racing tables. Racing data can also be exported to support live statistics.
At the moment there are three different kinds of hexdumps. All 3 are able to dump in one line mode to have large tables. Tool less is here a very good tool for vertical and horizontal scrolling. The stages are includes into the dump as comment lines. The dumped records can be filters by sending, receiving, proxy, record types, stage types and packet length. It is also possible to select the dumped bytes by indices and ranges.
Another feature is, that mkw-ana can read comment files. If making videos of the dumped meetings, you can write such comment file. Each line starts with a timestamp followed by a comment. Virtual Dub is a good tool for this job. Then you must synchronize the comment file with the network dump. The start of the first game ("GO" in the video) is a very good point for synchronization. Here is an example of a comment file (in german):
>2012-12-05 19:10:39.745 - 12:22.792 0:00:00.000 Video Start 0:12:22.792 Rennen 1.1, GO! 0:12:54.123 Tinti wird angekündigt, T=0:31.322 0:14:17.924 Power wird angekündigt, T=1:55.120 0:15:33.633 Blitz schlägt ein, T=1:35.326 ...
- Notes
- The first line is the real time of the start of the race minus the video time stamp. This is the synchronisation. An synchronisation can be done multiple times.
- The line with video timestamp and comment follow. The focus of the comment change as the point of interest.
???
Dumping Data
Options
Download
Here is the v0.09 of the tool mkw-ana: mkw-ana-v0.09-r1532.zip (340 kB)
- It contains binaries for:
- Linux i386
- Linux x86_64
- Cygwin/Windows (A Cygwin system[1] must be installed).
- Some scripts as examples.
- Some BMG text examples.
- Some doc files.
It is an alpha distribution and and only minimal support will be given at the moment.
Capture the network data
First you must capture the network traffic of the Wii. Therefore you must redirect it to a PC running a capture software. There are 3 general ways to to this:
- If you have a manageable switch, enable port mirroring and send all Wii traffic to a PC.
- Use your PC as router.
- Use old network hubs (not switches). A hub will mirror all traffic of all ports to all others; it's just a multi port repeater and will slow down your network.
Use a software like tcpdump or wireshark to capture the data. Best is to save the captured data directly to a file or to send it to other commands like mkw-ana for a live analysis.
It's also possible to save the data to a file and to make a live analysis at the same time. Use the following command pipe:
tcpdump -w- -U -i eth1 host wii | tee save.dump | mkw-ana ...
If using wireshark, save the dump to a file and use the following command for a live analysis:
mkw-ana --follow DUMPFILE ...
Live Statistics
mkw-ana can scan the network traffic in real time and can produce makedoc or php data files. Together with ssh and an cgi script, a live statistic is created. Live means that the tables are updates 2-5 seconds after the race have finished.
How it works
The whole job is done by 3 processes:
-
First, you must capture the network traffic like described above. Then use one of the commands:
... | mkw-ana log --md DATAFILE ... | mkw-ana log --php DATAFILE mkw-ana --follow DUMPFILE log --md DATAFILE mkw-ana --follow DUMPFILE log --php DATAFILE
- Each time, a new DATAFILE is written, it must be transferred to the web server. A script using shh, sftp scp or ftp within an endless loop will do this job automatically.
- Last not least, a CGI or PHP script running at the web server must read the data files to serve a html-page to the visitors.
To see, what live means, visit the live statistics on Wednesday or Thursday between 19:10 and 20:30 CET (Central European Time).