| ofs | hex dump | ascii |
|---|
| 0000 | 69 63 6e 73 00 01 7c 2f 69 73 33 32 00 00 02 99 00 ff 8b 00 07 ff ff 00 00 2b 7b 97 96 81 97 09 | icns..|/is32.............+{..... |
| 0020 | 79 2a 00 00 ff ff 00 00 84 1a 83 00 6c 19 81 00 00 ff ff 00 00 95 00 31 31 30 2f 2e 2d 00 94 00 | y*..........l..........110/.-... |
| 0040 | 00 ff ff 00 00 94 00 2f 2e 2d 2d 2b 2a 00 92 00 00 ff ff 00 00 91 00 2c 2b 2b 29 28 27 00 90 00 | ......./.--+*..........,++)('... |
| 0060 | 00 ff ff 00 00 90 00 29 28 27 26 25 23 00 8e 00 00 ff ff 00 00 8d 00 26 24 24 23 21 20 00 8a 00 | .......)('&%#..........&$$#!.... |
| 0080 | 00 ff ff 00 00 87 00 22 21 20 1f 1e 1d 00 85 00 00 ff ff 00 00 85 00 1f 1e 1d 80 1c 0b 00 81 00 | ......."!....................... |
| 00a0 | 00 ff ff 00 00 83 01 1c 1c 81 1b 09 00 7e 00 00 ff ff 00 00 80 00 83 1b 08 00 7b 00 00 ff ff 00 | .............~............{..... |
| 00c0 | 00 7b 85 00 18 77 00 00 ff ff 00 00 6f 41 00 02 2a 29 04 00 3e 6a 00 00 ff ff 00 00 26 75 83 7e | .{...w......oA..*)..>j......&u.~ |
| 00e0 | 05 75 26 00 00 ff ff 8b 00 00 ff 00 ff 8b 00 07 ff ff 00 00 2b 7b 97 96 81 97 09 79 2a 00 00 ff | .u&.................+{.....y*... |
| 0100 | ff 00 00 84 1a 83 00 6c 19 81 00 00 ff ff 00 00 95 00 31 31 30 2f 2e 2d 00 94 00 00 ff ff 00 00 | .......l..........110/.-........ |
| 0120 | 94 00 2f 2e 2d 2d 2b 2a 00 92 00 00 ff ff 00 00 91 00 2c 2b 2b 29 28 27 00 90 00 00 ff ff 00 00 | ../.--+*..........,++)('........ |
| 0140 | 90 00 29 28 27 26 25 23 00 8e 00 00 ff ff 00 00 8d 00 26 24 24 23 21 20 00 8a 00 00 ff ff 00 00 | ..)('&%#..........&$$#!......... |
| 0160 | 87 00 22 21 20 1f 1e 1d 00 85 00 00 ff ff 00 00 85 00 1f 1e 1d 80 1c 0b 00 81 00 00 ff ff 00 00 | .."!............................ |
| 0180 | 83 01 1c 1c 81 1b 09 00 7e 00 00 ff ff 00 00 80 00 83 1b 08 00 7b 00 00 ff ff 00 00 7b 85 00 18 | ........~............{......{... |
| 01a0 | 77 00 00 ff ff 00 00 6f 41 00 02 29 29 03 00 3e 6a 00 00 ff ff 00 00 26 75 83 7e 05 75 26 00 00 | w......oA..))..>j......&u.~.u&.. |
pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long *//*
* pervasive debugger
* www.cl.cam.ac.uk/netos/pdb
*
* alex ho
* 2004
* university of cambridge computer laboratory
*
* linux & i386 dependent code. bleech.
*/
#include <asm/pdb.h>
/* offset to the first instruction in the linux system call code
where we can safely set a breakpoint */
unsigned int pdb_linux_syscall_enter_bkpt_offset = 20;
/* offset to eflags saved on the stack after an int 80 */
unsigned int pdb_linux_syscall_eflags_offset = 48;
/* offset to the instruction pointer saved on the stack after an int 80 */
unsigned int pdb_linux_syscall_eip_offset = 40;
unsigned char
pdb_linux_set_bkpt (unsigned long addr)
{
unsigned char old_instruction = *(unsigned char *)addr;
*(unsigned char *)addr = 0xcc;
return old_instruction;
}
void
pdb_linux_clr_bkpt (unsigned long addr, unsigned char value)
{
*(unsigned char *)addr = value;
}
void
pdb_linux_syscall_enter_bkpt (struct pt_regs *regs, long error_code,
trap_info_t *ti)
{
/* set at breakpoint at the beginning of the
system call in the target domain */
pdb_system_call_enter_instr = pdb_linux_set_bkpt(ti->address +
pdb_linux_syscall_enter_bkpt_offset);
pdb_system_call = 1;
}
void
pdb_linux_syscall_exit_bkpt (struct pt_regs *regs, struct pdb_context *pdb_ctx)
{
/*
we've hit an int 0x80 in a user's program, jumped into xen
(traps.c::do_general_protection()) which re-wrote the next
instruction in the os kernel to 0xcc, and then hit that
exception.
we need to re-write the return instruction in the user's
program so that we know when we have finished the system call
and are back in the user's program.
at this point our stack should look something like this:
esp = 0x80a59f0
esp + 4 = 0x0
esp + 8 = 0x80485a0
esp + 12 = 0x2d
esp + 16 = 0x80485f4
esp + 20 = 0xbffffa48
esp + 24 = 0xd
esp + 28 = 0xc00a0833
esp + 32 = 0x833
esp + 36 = 0xd
esp + 40 = 0x804dcdd saved eip
esp + 44 = 0x82b saved cs
esp + 48 = 0x213392 saved eflags
esp + 52 = 0xbffffa2c saved esp
esp + 56 = 0x833 saved ss
esp + 60 = 0x1000000
*/
/* restore the entry instruction for the system call */
pdb_linux_clr_bkpt(regs->eip - 1, pdb_system_call_enter_instr);
/* save the address of eflags that was saved on the stack */
pdb_system_call_eflags_addr = (regs->esp +
pdb_linux_syscall_eflags_offset);
/* muck with the return instruction so that we trap back into the
debugger when re-entering user space */
pdb_system_call_next_addr = *(unsigned long *)(regs->esp +
pdb_linux_syscall_eip_offset);
pdb_linux_get_values (&pdb_system_call_leave_instr, 1,
pdb_system_call_next_addr,
pdb_ctx->process, pdb_ctx->ptbr);
pdb_linux_set_values ("cc", 1, pdb_system_call_next_addr,
pdb_ctx->process, pdb_ctx->ptbr);
}