Difference between revisions of "/shared2/sys/net/02/config.dat"

From WiiBrew
< /shared2‎ | sys‎ | net‎ | 02
Jump to: navigation, search
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
This file contains the Wii's Internet connection configuration. It is composed of an 8-byte header and 3 connection entries of 0x91C each.
 
This file contains the Wii's Internet connection configuration. It is composed of an 8-byte header and 3 connection entries of 0x91C each.
 +
 +
<source lang="C">
 +
typedef struct _netconfig
 +
{
 +
    u8 header0;    // 0x00
 +
    u8 header1;    // 0x00
 +
    u8 header2;    // 0x00
 +
    u8 header3;    // 0x00
 +
    u8 header4;    // 0x01  When there's at least one valid connection to the Internet.
 +
    u8 header5;    // 0x00
 +
    u8 header6;    // 0x07  Not sure.  This is always 0x07 for me (MetaFight)
 +
    u8 header7;    // 0x00
 +
 +
    connection_t connection[3];
 +
} netconfig_t;
 +
</source>
 +
 +
Where <code>connection</code> is defined as:
  
 
<source lang="C">
 
<source lang="C">
 
typedef struct _connection
 
typedef struct _connection
 
{
 
{
/*
+
    /*
u8 selected is 8 flags:
+
    *  Settings common to both wired and wireless connections
   
+
    */
  1->Connection selected  
+
    u8 flags;          // Defined below.
   | 1->Internet test passed
+
    u8 padding_1[3];
   |   |
+
 
 +
    u8 ip[4]            // Wii IP Address
 +
    u8 netmask[4];
 +
    u8 gateway[4];
 +
    u8 dns1[4];
 +
    u8 dns2[4];
 +
    u8 padding_2[2]
 +
 
 +
    u16 mtu;            //valid values are 0 and 576-1500 range
 +
    u8 padding_3[8];    // 0x00 padding?
 +
 
 +
    proxy_t proxy_settings;
 +
    u8 padding_4;      //0x00
 +
 
 +
    proxy_t proxy_settings_copy;    // Seems to be a duplicate of proxy_settings
 +
    u8 padding_5[1297];            //0x00
 +
 
 +
    /*
 +
    *  Wireless specific settings
 +
    */
 +
    u8 ssid[32];        // Access Point name.
 +
 
 +
    u8 padding_6;      // 0x00
 +
    u8 ssid_length;    // length of ssid[] (AP name) in bytes.
 +
    u8 padding_7[2];    // 0x00
 +
 
 +
    u8 padding_8;      // 0x00
 +
    u8 encryption;      // (Probably) Encryption.  OPN: 0x00, WEP64: 0x01, WEP128: 0x02 WPA-PSK (TKIP): 0x04, WPA2-PSK (AES): 0x05, WPA-PSK (AES): 0x06
 +
    u8 padding_9[2];    // 0x00
 +
 
 +
    u8 padding_10;      // 0x00
 +
    u8 key_length;      // length of key[] (encryption key) in bytes. 0x00 for WEP64 and WEP128.
 +
    u8 unknown;        // 0x00 or 0x01 toogled with a WPA-PSK (TKIP) and with a WEP entered with hex instead of ascii.
 +
    u8 padding_11;      // 0x00
 +
 
 +
    u8 key[64];        // Encryption key. For WEP, key is stored 4 times (20 bytes for WEP64 and 52 bytes for WEP128) then padded with 0x00.
 +
 
 +
    u8 padding_12[236]; // 0x00
 +
} connection_t;
 +
</source>
 +
 
 +
The <code>u8 flags</code> used above is defined as:
 +
 
 +
  Connection selected
 +
   | ?
 +
  | | Internet test passed
 +
  | | | Use Proxy (1 -> on; 0 -> off)
 +
   | | | |
 
   1 0 1 0  0 1 1 0
 
   1 0 1 0  0 1 1 0
        |   | | |
+
            | | | |
        |   | | 0->wireless 1-> wired (lan)
+
            | | | Interface (0 -> Internal wireless; 1 -> Wired LAN adapter)
        |   | 1->DHCP DNS
+
            | | DNS source (0 -> Manual; 1 -> DHCP)
        | 1->DHCP IP
+
            | IP source (0 -> Manual; 1 -> DHCP)
        |
+
            ?
      1->use proxy
+
 
+
Additional structures include:
A manual settings wireless connection without proxy looks like 1 0 1 0 0 0 0 0
+
 
+
<source lang="C">
*/
+
struct _proxy
    u8 selected;
+
{
+
     u8 use_proxy;               // 0x00 -> no proxy0x01 -> proxy
u8 padding_1[3];
+
    u8 use_proxy_userandpass   // 0x00 -> don't use username and password;  0x01 -> use username and password
+
    u8 padding_1[2]             // 0x00
u8 ip[4];//wii ip adress
+
    u8 proxy_name[255];
u8 netmask[4];
+
    u8 padding_2;               // 0x00
u8 gateway[4];
+
    u16 proxy_port;             // 0-34463 range
u8 dns1[4];
+
     u8 proxy_username[32];
u8 dns2[4];
+
     u8 padding_3;               // 0x00
+
     u8 proxy_password[32];
u8 padding_2[2];
+
} __attribute__((__packed__));
u16 mtu; //valid values are 0 and 576-1500 range
+
 
+
typedef struct _proxy proxy_t;
     u8 padding_3[8]; // 0x00 padding?
+
 
 
u8 use_proxy;           //0x00 -> no proxy //0x01 use proxy
 
u8 use_proxy_userandpass; //0x00 -> don't use user and password //0x01 use user and password
 
 
u8 padding_p1[2]; //0x00
 
   
 
u8 proxy_name[255];
 
u8 padding_p2; //0x00
 
u16 proxy_port; // 0-34463 range
 
u8 proxy_username[32];
 
u8 padding_p3; //0x00
 
u8 proxy_password[32];
 
 
u8 padding_4; //0x00
 
 
//This is a copy of the proxy settings
 
u8 use_proxy_copy;            //0x00 -> no proxy //0x01 use proxy
 
u8 use_proxy_userandpass_copy; //0x00 -> don't use user and password //0x01 use user and password
 
 
u8 padding_p1_copy[2]; //0x00
 
 
u8 proxy_name_copy[255];
 
u8 padding_p2_copy; //0x00
 
u16 proxy_port_copy; // 0-34463 range
 
u8 proxy_username_copy[32];
 
u8 padding_p3_copy; //0x00
 
u8 proxy_password_copy[32];
 
 
u8 padding_5[1297]; //0x00
 
 
//Start of wireless only settings
 
 
     u8 ssid[32]; // Access Point name.
 
 
     u8 padding_6; // 0x00
 
     u8 ssid_length; // length of ssid[] (AP name) in bytes.
 
    u8 padding_7[2]; // 0x00
 
 
    u8 padding_8; // 0x00
 
    u8 encryption; // (Probably) Encryption.  OPN: 0x00, WEP64: 0x01, WEP128: 0x02 WPA-PSK (TKIP): 0x04, WPA2-PSK (AES): 0x05, WPA-PSK (AES): 0x06
 
    u8 padding_9[2]; // 0x00
 
 
    u8 padding_10; // 0x00
 
    u8 key_length; // length of key[] (encryption key) in bytes.
 
// for WEP it's 0x00
 
    u8 padding_11[2]; // 0x00
 
 
    u8 key[64]; // Encryption key
 
//For a WEP key, they key is repeated 4 times (52 bytes) then padded with zeroes
 
 
    u8 padding_12[236]; // 0x00
 
}connection_t;
 
 
</source>
 
</source>
  
 
Wired connections follow the same structure, except all related to ssid, encryption and keys is set to 0x00.
 
Wired connections follow the same structure, except all related to ssid, encryption and keys is set to 0x00.
  
Note that all the paddings are a guess. Also, this all obtained by modifying ONLY the top wii connection (connection 1) while being the other two erassed (thus connection 1 and 2 are all set to 0x00).
+
Note that all the paddings are a guess.
 +
Also, wired information was obtained by modifying '''Connection 1''' ONLY.  During these tests '''Connection 2''' and '''Connection 3''' were left blank (set to 0x00).
  
 
More research is needed with this file.
 
More research is needed with this file.
  
 
[[Category:Wii Filesystem]]
 
[[Category:Wii Filesystem]]

Latest revision as of 17:16, 10 August 2009

This file contains the Wii's Internet connection configuration. It is composed of an 8-byte header and 3 connection entries of 0x91C each.

typedef struct _netconfig
{
    u8 header0;     // 0x00
    u8 header1;     // 0x00
    u8 header2;     // 0x00
    u8 header3;     // 0x00
    u8 header4;     // 0x01  When there's at least one valid connection to the Internet.
    u8 header5;     // 0x00
    u8 header6;     // 0x07  Not sure.  This is always 0x07 for me (MetaFight)
    u8 header7;     // 0x00

    connection_t connection[3];
} netconfig_t;

Where connection is defined as:

typedef struct _connection
{
    /*
     *  Settings common to both wired and wireless connections
     */
    u8 flags;           // Defined below.
    u8 padding_1[3];

    u8 ip[4]            // Wii IP Address
    u8 netmask[4];
    u8 gateway[4];
    u8 dns1[4];
    u8 dns2[4];
    u8 padding_2[2]

    u16 mtu;            //valid values are 0 and 576-1500 range
    u8 padding_3[8];    // 0x00 padding?

    proxy_t proxy_settings;
    u8 padding_4;       //0x00

    proxy_t proxy_settings_copy;    // Seems to be a duplicate of proxy_settings
    u8 padding_5[1297];             //0x00

    /*
     *  Wireless specific settings
     */
    u8 ssid[32];        // Access Point name.

    u8 padding_6;       // 0x00
    u8 ssid_length;     // length of ssid[] (AP name) in bytes.
    u8 padding_7[2];    // 0x00

    u8 padding_8;       // 0x00
    u8 encryption;      // (Probably) Encryption.  OPN: 0x00, WEP64: 0x01, WEP128: 0x02 WPA-PSK (TKIP): 0x04, WPA2-PSK (AES): 0x05, WPA-PSK (AES): 0x06
    u8 padding_9[2];    // 0x00

    u8 padding_10;      // 0x00
    u8 key_length;      // length of key[] (encryption key) in bytes.  0x00 for WEP64 and WEP128.
    u8 unknown;         // 0x00 or 0x01 toogled with a WPA-PSK (TKIP) and with a WEP entered with hex instead of ascii.
    u8 padding_11;      // 0x00

    u8 key[64];         // Encryption key.  For WEP, key is stored 4 times (20 bytes for WEP64 and 52 bytes for WEP128) then padded with 0x00.

    u8 padding_12[236]; // 0x00
} connection_t;

The u8 flags used above is defined as:

  Connection selected
  | ?
  | | Internet test passed
  | | | Use Proxy (1 -> on; 0 -> off)
  | | | |
  1 0 1 0  0 1 1 0
           | | | |
           | | | Interface (0 -> Internal wireless; 1 -> Wired LAN adapter)
           | | DNS source (0 -> Manual; 1 -> DHCP)
           | IP source (0 -> Manual; 1 -> DHCP)
           ?

Additional structures include:

struct _proxy
{
    u8 use_proxy;               // 0x00 -> no proxy;  0x01 -> proxy
    u8 use_proxy_userandpass    // 0x00 -> don't use username and password;  0x01 -> use username and password
    u8 padding_1[2]             // 0x00
    u8 proxy_name[255];
    u8 padding_2;               // 0x00
    u16 proxy_port;             // 0-34463 range
    u8 proxy_username[32];
    u8 padding_3;               // 0x00
    u8 proxy_password[32];
} __attribute__((__packed__));

typedef struct _proxy proxy_t;

Wired connections follow the same structure, except all related to ssid, encryption and keys is set to 0x00.

Note that all the paddings are a guess. Also, wired information was obtained by modifying Connection 1 ONLY. During these tests Connection 2 and Connection 3 were left blank (set to 0x00).

More research is needed with this file.