1,5 → 1,4 |
format binary |
include '..\..\macros.inc' |
use32 |
db 'MENUET01' |
dd 1 |
68,7 → 67,7 |
push 40 |
pop eax |
mov ebx, 0x107 |
mcall |
int 40h |
; set debug messages buffer |
mov ecx, dbgbufsize |
mov dword [ecx], 256 |
75,7 → 74,7 |
xor ebx, ebx |
mov [ecx+4], ebx |
mov al, 69 |
mcall |
int 40h |
mov esi, i_param |
call skip_spaces |
test al, al |
90,7 → 89,7 |
waitevent: |
push 10 |
pop eax |
mcall |
int 40h |
cmp al, 9 |
jz debugmsg |
dec eax |
102,10 → 101,10 |
; button pressed - we have only one button (close) |
push -1 |
pop eax |
mcall |
int 40h |
keypressed: |
mov al, 2 |
mcall |
int 40h |
shr eax, 8 |
cmp al, 8 |
jz .backspace |
335,7 → 334,7 |
or ebx, ecx |
mov ecx, cmdline_y_pos*10000h + cmdline_y_size |
mov edx, 0xFFFFFF |
mcall |
int 40h |
ret |
|
draw_cmdline: |
354,7 → 353,7 |
add ebx, cmdline_x_pos |
shl ebx, 16 |
or ebx, cmdline_y_pos+1 |
mcall |
int 40h |
ret |
|
put_message_nodraw: |
450,7 → 449,7 |
mov edx, 0xFFFFFF |
mov ebx, messages_x_pos*10000h+messages_x_size |
mov ecx, messages_y_pos*10000h+messages_y_size |
mcall |
int 40h |
mov edx, messages |
push messages_width |
pop esi |
458,7 → 457,7 |
mov al, 4 |
mov ebx, messages_x_pos*10000h+messages_y_pos |
@@: |
mcall |
int 40h |
add edx, esi |
add ebx, 10 |
cmp edx, messages+messages_width*messages_height |
476,7 → 475,7 |
shl ebx, 16 |
or ebx, edx |
xor edx, edx |
mcall |
int 40h |
ret |
hide_cursor: |
mov ebx, [cmdline_pos] |
488,7 → 487,7 |
inc ebx |
mov ecx, cmdline_y_pos*10000h + cmdline_y_size |
mov edx, 0xFFFFFF |
mcall |
int 40h |
mov ebx, [cmdline_pos] |
cmp ebx, [cmdline_len] |
jae .ret |
501,7 → 500,7 |
or ebx, cmdline_y_pos+1 |
push 1 |
pop esi |
mcall |
int 40h |
.ret: |
ret |
|
511,13 → 510,13 |
mov edx, 0xFFFFFF |
mov ebx, title_x_pos*10000h + data_x_pos+data_x_size-title_x_pos |
mov ecx, title_y_pos*10000h + title_y_size |
mcall |
int 40h |
draw_title: |
mov al, 38 |
mov ebx, (data_x_pos-2)*10000h + title_x_pos-5 |
mov ecx, (title_y_pos+5)*10001h |
xor edx, edx |
mcall |
int 40h |
push NoPrgLoaded_len |
pop esi |
cmp [debuggee_pid], 0 |
531,9 → 530,9 |
jz @f |
add ebx, 6 |
@@: |
mcall |
int 40h |
mov ebx, (data_x_pos+data_x_size-10+4)*0x10000 + data_x_pos+data_x_size+2 |
mcall |
int 40h |
mov al, 4 |
mov ebx, title_x_pos*10000h+title_y_pos |
xor ecx, ecx |
542,7 → 541,7 |
jz @f |
mov edx, [prgname_ptr] |
@@: |
mcall |
int 40h |
cmp [debuggee_pid], 0 |
jz .nodebuggee |
mov ebx, (data_x_pos+data_x_size-10-6*7)*10000h + title_y_pos |
555,7 → 554,7 |
mov edx, aPaused |
dec esi |
@@: |
mcall |
int 40h |
ret |
.nodebuggee: |
mov al, 38 |
585,7 → 584,7 |
.cd: |
push 4 |
pop eax |
mcall |
int 40h |
imul esi, 60000h |
lea edx, [ebx+esi] |
mov al, 47 |
592,7 → 591,7 |
mov ebx, 80101h |
mov esi, ecx |
pop ecx |
mcall |
int 40h |
lea ebx, [edx+60000h*18] |
mov esi, ecx |
pop ecx |
623,7 → 622,7 |
mov ecx, 0x00AA00 |
.doit: |
mov ah, 0 |
mcall |
int 40h |
ret |
|
redraw_registers: |
632,7 → 631,7 |
mov edx, 0xFFFFFF |
mov ebx, data_x_pos*10000h + data_x_size |
mov ecx, registers_y_pos*10000h + registers_y_size |
mcall |
int 40h |
draw_registers: |
mov esi, _eax |
push 4 |
673,7 → 672,7 |
xor esi, esi |
inc esi |
mov ebx, (registers_x_pos+37*6)*10000h + registers_y_pos+20 |
mcall |
int 40h |
mov edx, flags |
@@: |
add ebx, 2*6*10000h |
689,7 → 688,7 |
mov edx, 0xFFFFFF |
mov ebx, data_x_pos*10000h + data_x_size |
mov ecx, dump_y_pos*10000h + dump_y_size |
mcall |
int 40h |
draw_dump: |
; addresses |
mov al, 47 |
703,7 → 702,7 |
jz @f |
xor esi, esi |
@@: |
mcall |
int 40h |
add ecx, 10h |
add edx, 10 |
cmp dl, dump_y_pos + dump_y_size |
717,7 → 716,7 |
cmp [dumpread], edi |
jz .hexdumpdone1 |
.hexdumploop1: |
mcall |
int 40h |
add edx, 3*6*10000h |
inc ecx |
inc edi |
741,7 → 740,7 |
.hexdumploop2: |
cmp edi, dump_height*10h |
jae .hexdumpdone2 |
mcall |
int 40h |
add ebx, 3*6*10000h |
inc edi |
test edi, 15 |
758,7 → 757,7 |
mov ebx, (data_x_pos+8*6)*10000h + dump_y_pos |
mov edx, aColon |
@@: |
mcall |
int 40h |
add ebx, 10 |
cmp bl, dump_y_pos+dump_height*10 |
jb @b |
765,7 → 764,7 |
mov ebx, (data_x_pos+(12+3*8)*6)*10000h + dump_y_pos |
mov edx, aMinus |
@@: |
mcall |
int 40h |
add ebx, 10 |
cmp bl, dump_y_pos+dump_height*10 |
jb @b |
779,7 → 778,7 |
jae @f |
mov edx, aPoint |
@@: |
mcall |
int 40h |
pop edx |
inc edx |
add ebx, 6*10000h |
798,7 → 797,7 |
mov edx, 0xFFFFFF |
mov ebx, data_x_pos*10000h + data_x_size |
mov ecx, (disasm_y_pos-1)*10000h + (disasm_y_size+1) |
mcall |
int 40h |
draw_disasm: |
mov eax, [disasm_start_pos] |
mov [disasm_cur_pos], eax |
821,7 → 820,7 |
push 13 |
pop eax |
mov edx, 0xFF0000 |
mcall |
int 40h |
.nored: |
mov eax, [_eip] |
cmp eax, ebp |
829,7 → 828,7 |
push 13 |
pop eax |
mov edx, 0x0000FF |
mcall |
int 40h |
mov esi, 0xFFFFFF ; on blue bgr, use white color |
.noblue: |
push 47 |
839,7 → 838,7 |
imul edx, 10 |
add edx, data_x_pos*10000h + disasm_y_pos |
mov ecx, ebp |
mcall |
int 40h |
mov al, 4 |
lea ebx, [edx+8*6*10000h] |
mov ecx, esi |
846,7 → 845,7 |
push 1 |
pop esi |
mov edx, aColon |
mcall |
int 40h |
push 9 |
pop edi |
lea edx, [ebx+2*6*10000h] |
857,7 → 856,7 |
sub ecx, [disasm_start_pos] |
add ecx, disasm_buffer |
.drawhex: |
mcall |
int 40h |
add edx, 6*3*10000h |
inc ecx |
inc ebp |
877,7 → 876,7 |
push 3 |
pop esi |
mov edx, aDots |
mcall |
int 40h |
mov esi, ecx |
.hexdone: |
xor eax, eax |
892,7 → 891,7 |
imul ebx, 10 |
add ebx, (data_x_pos+6*40)*10000h+disasm_y_pos |
mov al, 4 |
mcall |
int 40h |
inc [disasm_cur_str] |
cmp [disasm_cur_str], disasm_height |
jb .loop |
928,7 → 927,7 |
mov edi, disasm_buffer |
mov edx, 256 |
mov esi, [disasm_start_pos] |
mcall |
int 40h |
cmp eax, -1 |
jnz @f |
mov esi, read_mem_err |
946,13 → 945,13 |
pop eax |
push 1 |
pop ebx |
mcall |
int 40h |
; define window |
xor eax, eax |
mov ebx, wnd_x_size |
mov ecx, wnd_y_size |
mov edx, 3FFFFFFh |
mcall |
int 40h |
; caption |
mov al, 4 |
mov ecx, 0xFFFFFF |
960,7 → 959,7 |
mov edx, caption_str |
push caption_len |
pop esi |
mcall |
int 40h |
; messages frame |
mov al, 38 |
mov ebx, (messages_x_pos-2)*10000h + (messages_x_pos+messages_x_size+2) |
967,27 → 966,27 |
push ebx |
mov ecx, (messages_y_pos-2)*10001h |
xor edx, edx |
mcall |
int 40h |
mov ecx, (messages_y_pos+messages_y_size+2)*10001h |
mcall |
int 40h |
mov ebx, (messages_x_pos-2)*10001h |
push ebx |
mov ecx, (messages_y_pos-2)*10000h + (messages_y_pos+messages_y_size+2) |
mcall |
int 40h |
mov ebx, (messages_x_pos+messages_x_size+2)*10001h |
push ebx |
mcall |
int 40h |
; command line frame |
mov ecx, (cmdline_y_pos-2)*10000h + (cmdline_y_pos+cmdline_y_size+2) |
pop ebx |
mcall |
int 40h |
pop ebx |
mcall |
int 40h |
pop ebx |
mov ecx, (cmdline_y_pos+cmdline_y_size+2)*10001h |
mcall |
int 40h |
mov ecx, (cmdline_y_pos-2)*10001h |
mcall |
int 40h |
; messages |
call draw_messages |
; command line & cursor |
997,14 → 996,14 |
mov al, 38 |
mov ebx, (data_x_pos-2)*10001h |
mov ecx, (title_y_pos+5)*10000h + (messages_y_pos-2) |
mcall |
int 40h |
mov ebx, (data_x_pos+data_x_size+2)*10001h |
mcall |
int 40h |
mov ebx, (data_x_pos-2)*10000h + (data_x_pos+data_x_size+2) |
mov ecx, (dump_y_pos-3)*10001h |
mcall |
int 40h |
mov ecx, (disasm_y_pos-4)*10001h |
mcall |
int 40h |
call draw_title |
call draw_registers |
call draw_dump |
1013,7 → 1012,7 |
mov al, 12 |
push 2 |
pop ebx |
mcall |
int 40h |
ret |
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1038,7 → 1037,7 |
OnQuit: |
xor eax, eax |
dec eax |
mcall |
int 40h |
|
get_new_context: |
mov esi, context |
1054,7 → 1053,7 |
mov esi, context |
push 28h |
pop edx |
mcall |
int 40h |
ret |
set_context: |
push 2 |
1065,7 → 1064,7 |
mov esi, context |
push 28h |
pop edx |
mcall |
int 40h |
ret |
|
get_dump: |
1081,7 → 1080,7 |
mov al, 69 |
push 6 |
pop ebx |
mcall |
int 40h |
cmp eax, -1 |
jnz @f |
mov esi, read_mem_err |
1142,13 → 1141,13 |
pop eax |
push 7 |
pop ebx |
mcall |
int 40h |
mov [dbgwnd], eax |
xchg ecx, eax |
push 70 |
pop eax |
mov ebx, fn70_load_block |
mcall |
int 40h |
test eax, eax |
jns .load_ok |
.load_err: |
1181,7 → 1180,7 |
mov bl, 3 |
push 18 |
pop eax |
mcall |
int 40h |
call redraw_title |
call redraw_registers |
call get_dump |
1274,17 → 1273,17 |
pop eax |
push 7 |
pop ebx |
mcall |
int 40h |
.wait: |
push 10 |
pop eax |
mcall |
int 40h |
dec eax |
jz .redraw |
dec eax |
jz .key |
or eax, -1 |
mcall |
int 40h |
.redraw: |
call draw_window |
call hide_cursor |
1291,7 → 1290,7 |
jmp .wait |
.key: |
mov al, 2 |
mcall |
int 40h |
cmp ah, 'y' |
jz .yes |
cmp ah, 'Y' |
1306,7 → 1305,7 |
push 40 |
pop eax |
mov ebx, 0x107 |
mcall |
int 40h |
call draw_cursor |
mov esi, aN_str |
jmp put_message |
1314,7 → 1313,7 |
push 40 |
pop eax |
mov ebx, 0x107 |
mcall |
int 40h |
call draw_cursor |
mov esi, aY_str |
call put_message |
1403,7 → 1402,7 |
pop ebx |
push 69 |
pop eax |
mcall |
int 40h |
ret |
|
AfterSuspend: |
1422,7 → 1421,7 |
pop ebx |
push 69 |
pop eax |
mcall |
int 40h |
call AfterSuspend |
mov esi, aSuspended |
jmp put_message |
1432,7 → 1431,7 |
pop ebx |
push 69 |
pop eax |
mcall |
int 40h |
mov [bSuspended], 0 |
ret |
OnResume: |
1482,7 → 1481,7 |
pop ebx |
push 69 |
pop eax |
mcall |
int 40h |
and [debuggee_pid], 0 |
call redraw_title |
call redraw_registers |
1621,7 → 1620,7 |
mov esi, [_eip] |
push 1 |
pop edx |
mcall |
int 40h |
pop eax |
cmp al, 0xCC |
jnz .notdbg |
1658,7 → 1657,7 |
push 3 |
pop ebx |
mov ecx, [dbgwnd] |
mcall ; activate dbg window |
int 40h ; activate dbg window |
call redraw_title |
call redraw_registers |
call redraw_dump |
1714,7 → 1713,7 |
pop edx |
mov edi, esp |
mov esi, [_eip] |
mcall |
int 40h |
cmp eax, edx |
pop eax |
jnz .doit |
1851,7 → 1850,7 |
push edx |
inc edx |
mov edi, esp |
mcall |
int 40h |
dec eax |
clc |
jz @f |
2339,7 → 2338,7 |
mov esi, ebp |
push 9 |
pop ebx |
mcall |
int 40h |
test eax, eax |
jz .ok |
pop ecx |
2571,7 → 2570,7 |
xor edx, edx |
inc edx |
mov esi, [edi-5] |
mcall |
int 40h |
pop esi |
.ret: |
ret |
2584,7 → 2583,7 |
push 9 |
pop ebx |
mov ecx, [debuggee_pid] |
mcall |
int 40h |
ret |
|
enable_breakpoint: |
2608,7 → 2607,7 |
mov ecx, [debuggee_pid] |
xor edx, edx |
inc edx |
mcall |
int 40h |
dec eax |
jnz .err |
mov al, 69 |
2615,7 → 2614,7 |
push 0xCC |
mov edi, esp |
inc ebx |
mcall |
int 40h |
pop eax |
.ret: |
pop esi |
2637,7 → 2636,7 |
shr dl, 6 |
mov dh, [edi] |
and dh, 0xF |
mcall |
int 40h |
test eax, eax |
jnz .err |
pop esi |
2713,7 → 2712,7 |
@@: |
push 69 |
pop eax |
mcall |
int 40h |
test eax, eax |
jz .breakok |
inc edx |
2725,7 → 2724,7 |
.wait: |
push 10 |
pop eax |
mcall |
int 40h |
dec eax |
jz .redraw |
dec eax |
2734,13 → 2733,13 |
jnz .debug |
; button; we have only one button, close |
or eax, -1 |
mcall |
int 40h |
.redraw: |
call draw_window |
jmp .wait |
.key: |
mov al, 2 |
mcall |
int 40h |
cmp ah, 3 ; Ctrl+C |
jnz .wait |
.userbreak: |
2755,7 → 2754,7 |
push 9 |
pop ebx |
mov ecx, [debuggee_pid] |
mcall |
int 40h |
cmp esi, aUnpacked |
jnz OnSuspend |
jmp AfterSuspend |
2777,7 → 2776,7 |
push 9 |
pop ebx |
mov ecx, [debuggee_pid] |
mcall |
int 40h |
jmp debugmsg |
.our: |
and [dbgbuflen], 0 |
2792,7 → 2791,7 |
pop edx |
push 0xC |
pop esi |
mcall |
int 40h |
pop eax |
pop edx |
cmp eax, [_eip] |