- static unsigned char buf[2048];
-
- sprintf(buf,
- "<html><head><title>Registers</title></head><body>"
- "<p>At the time you requested this page, the system's registers were:</p>"
- "<tt><pre>"
- "%%eax: 0x%08x %%ebx: 0x%08x %%ecx: 0x%08x %%edx: 0x%08x\n"
- "%%ebp: 0x%08x %%esi: 0x%08x %%edi: 0x%08x %%esp: 0x%08x\n"
- "%%cr0: 0x%08x %%cr3: 0x%08x %%eip: 0x%08x %%eflags: 0x%08x\n"
- "</pre></tt></body></html>",
- *(unsigned long*)0xAFFD0,
- *(unsigned long*)0xAFFDC,
- *(unsigned long*)0xAFFD4,
- *(unsigned long*)0xAFFD8,
- *(unsigned long*)0xAFFE4,
- *(unsigned long*)0xAFFE8,
- *(unsigned long*)0xAFFEC,
- *(unsigned long*)0xAFFE0,
- *(unsigned long*)0xAFFFC,
- *(unsigned long*)0xAFFF8,
- *(unsigned long*)0xAFFF0,
- *(unsigned long*)0xAFFF4);
-
-
- file->data = buf;
- file->len = strlen(buf)-1;
+ int i;
+ int len;
+
+ len = snprintf(http_output_buffer, sizeof(http_output_buffer), "<html><pre>");
+
+ for (i = 0; i < state_num_regs(); i++) {
+ len += state_dump_reg(http_output_buffer + len, sizeof(http_output_buffer) - len, i);
+ }
+
+ file->len = len;
+ file->data = http_output_buffer;