config.htm是一个web页面,里面显示一些主机名字等相关信息。内容如下:
This page is used for basic system configuration. To update the system configuration, enter the updated information in the gray sections below and press the "Submit Configuration" button at the bottom of the form.
Note this page contains a hidden 32 bit session id that prevents accidental (or intentional) reconfiguration by a stale copy of this HTML form. Current Status:
This section displays the hardwares's current configuration status.
[tr][tr][tr]Hostname: | 0123456789012345 | Domain: | 01234567890123456789012345678901 | Addres Type: | 0123456789 | IP Address: | 012345678901234 | Subnet Mask: | 012345678901234 | Default Gateway: | 012345678901234 | DNS Server: | 012345678901234 |
|
|
config.c文件中存储的是config.htm转换(调用binsrc)后的数据。内容如下:
#define CONFIG_SIZE 4620
unsigned char CONFIG[] = [0x3C, 0x68, 0x74, 0x6D, 0x6C, 0x3E, 0x0D, 0x0A, 0x3C, 0x74, 0x69, 0x74,***,];
webinfo.h定义了Hostname,Domain等变量的偏移量
// HOSTNAME: hostname
#define CONFIG_HOSTNAME_OFFSET 0x55b
#define CONFIG_HOSTNAME_MAXLEN 16
程序中使用下面语句给Hostname赋值。
mmCopy( CONFIG+CONFIG_HOSTNAME_OFFSET, Hostname, strlen(Hostname) );
我的问题是如何从CONFIG数组中获取CONFIG_HOSTNAME_OFFSET,偏移量的?如果我自己写个webserver的话,如何定位那些变量的偏移量?