Difference between revisions of "News Channel"

From WiiBrew
Jump to: navigation, search
 
(17 intermediate revisions by 13 users not shown)
Line 1: Line 1:
News / Weather channel downloads data packages from Nintendo servers via plain http connection.
+
{{Infobox channel
 +
| title      = News Channel
 +
| image      = [[File:Newschannel.png|200px]]
 +
| desc        = News informations
 +
| type        = General channel
 +
| version    = 0.7 (7)
 +
| peripherals = {{Wiimote1}} {{Internet}}
 +
| wc24        = 1
 +
}}
 +
 
 +
The '''News Channel''' download data packages from Nintendo servers via plain HTTP connection.  Since the official servers for this were discontinued on June 28, 2013, [[RiiConnect24]] is in the works.
  
 
Some examples:
 
Some examples:
  
http://weather.wapp.wii.com/1/076/short.bin
+
http://news.wapp.wii.com/1/076/news.bin.08<br />
http://weather.wapp.wii.com/1/076/forecast.bin
 
http://news.wapp.wii.com/1/076/news.bin.08
 
  
 
Nowadays, it seems the news file has moved:
 
Nowadays, it seems the news file has moved:
Line 15: Line 23:
 
http://news.wapp.wii.com/v2/1/076/news.bin.23
 
http://news.wapp.wii.com/v2/1/076/news.bin.23
  
 +
http://news.wapp.wii.com/ displays a Red Hat Enterprise Linux Test Page.
 
File structure:
 
File structure:
  
Line 20: Line 29:
 
$0000 - $003F: padding (00)
 
$0000 - $003F: padding (00)
 
$0040 - $013F: rsa encrypted sha-1 signature of rest of the file
 
$0040 - $013F: rsa encrypted sha-1 signature of rest of the file
$0140 - $....: compressed data
+
$0140 - $0143: header
 +
$0144 - .....: compressed data
 
</pre>
 
</pre>
  
Data compression method is still unknown. If you calculate entropy of the data, you will notice that it is definitely not encrypted. Probably it uses a modified version of propieritary Nintendo compression method described here: http://everything2.com/index.pl?node_id=1469892
+
The compression is very simple:
 +
# Read one byte
 +
# For each bit of the byte, msb-to-lsb,
 +
#* if 0, copy one byte to the output
 +
#* if 1, read 16 bits msb first in v, copy n bytes at offset m from the end of the output, n=3+(v>>12), m=v & fff
 +
 
 +
Quick and very dirty C code:
 +
<source lang="c">
 +
  i = 0x144;
 +
  j = 0;
 +
  while(i < size) {
 +
    int k;
 +
    int v = data[i++];
 +
    for(k=0; k<8; k++)
 +
      if(!(v & (1 << (7-k)))) {
 +
        result_data[j++] = data[i++];
 +
      } else {
 +
        int vv = (data[i] << 8) | data[i+1];
 +
        int nb = 3+(vv >> 12);
 +
        int off = (vv & 0xfff);
 +
        int l;
 +
        i+=2;
 +
        for(l=0; l<nb; l++) {
 +
          result_data[j] = result_data[j-off-1];
 +
          j++;
 +
        }
 +
      }
 +
  }
 +
</source>
  
 
[[Category:Software]]
 
[[Category:Software]]

Latest revision as of 01:48, 4 January 2016

News Channel
Newschannel.png
Version 0.7 (7)
Description News informations
Type General channel
Peripherals Wiimote1.svg Internet
Requires WiiConnect24

The News Channel download data packages from Nintendo servers via plain HTTP connection. Since the official servers for this were discontinued on June 28, 2013, RiiConnect24 is in the works.

Some examples:

http://news.wapp.wii.com/1/076/news.bin.08

Nowadays, it seems the news file has moved:

http://news.wapp.wii.com/v2/1/076/news.bin.00

...

http://news.wapp.wii.com/v2/1/076/news.bin.23

http://news.wapp.wii.com/ displays a Red Hat Enterprise Linux Test Page. File structure:

$0000 - $003F: padding (00)
$0040 - $013F: rsa encrypted sha-1 signature of rest of the file
$0140 - $0143: header
$0144 - .....: compressed data

The compression is very simple:

  1. Read one byte
  2. For each bit of the byte, msb-to-lsb,
    • if 0, copy one byte to the output
    • if 1, read 16 bits msb first in v, copy n bytes at offset m from the end of the output, n=3+(v>>12), m=v & fff

Quick and very dirty C code:

  i = 0x144;
  j = 0;
  while(i < size) {
    int k;
    int v = data[i++];
    for(k=0; k<8; k++)
      if(!(v & (1 << (7-k)))) {
        result_data[j++] = data[i++];
      } else {
        int vv = (data[i] << 8) | data[i+1];
        int nb = 3+(vv >> 12);
        int off = (vv & 0xfff);
        int l;
        i+=2;
        for(l=0; l<nb; l++) {
          result_data[j] = result_data[j-off-1];
          j++;
        }
      }
  }