git-svn-id: svn://kolibrios.org@7675 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2019-08-22 16:38:09 +00:00
parent 39e98c4dca
commit e1a519a379
2 changed files with 37 additions and 147 deletions

View File

@ -5,9 +5,9 @@
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; Color scheme ; Color scheme
BLACK_ON_WHITE equ 0 BLACK_ON_WHITE = 0
MOVIEOS equ 1 MOVIEOS = 1
WHITE_ON_BLACK equ 2 WHITE_ON_BLACK = 2
; format - 0xRRGGBB ; format - 0xRRGGBB
if COLOR_THEME eq MOVIEOS if COLOR_THEME eq MOVIEOS

View File

@ -15,10 +15,10 @@ use32
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
REG_MODE_CPU equ 1 REG_MODE_CPU = 1
REG_MODE_MMX equ 2 REG_MODE_MMX = 2
REG_MODE_SSE equ 3 REG_MODE_SSE = 3
REG_MODE_AVX equ 4 REG_MODE_AVX = 4
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -200,16 +200,9 @@ OnLoadInit:
; TODO: make it local ; TODO: make it local
do_reload: do_reload:
;push 18
;pop eax
;push 7
;pop ebx
mcall 18, 7 mcall 18, 7
mov [dbgwnd], eax mov [dbgwnd], eax
xchg ecx, eax xchg ecx, eax
;push 70
;pop eax
;mov ebx, fn70_load_block
mcall 70, fn70_load_block mcall 70, fn70_load_block
test eax, eax test eax, eax
jns .load_ok jns .load_ok
@ -236,9 +229,7 @@ do_reload:
.load_ok: .load_ok:
mov [debuggee_pid], eax mov [debuggee_pid], eax
mov [bSuspended], 1 mov [bSuspended], 1
mov eax, 5 mcall 5, 20
mov ebx, 20
int 0x40
push ecx push ecx
call get_context call get_context
@ -248,9 +239,6 @@ do_reload:
; activate debugger window ; activate debugger window
pop ecx pop ecx
;mov bl, 3
;push 18
;pop eax
mcall 18, 3 mcall 18, 3
call redraw_title call redraw_title
call draw_registers.redraw call draw_registers.redraw
@ -387,15 +375,9 @@ do_reload:
mov esi, aPacked2 mov esi, aPacked2
call put_message call put_message
call hide_cursor call hide_cursor
;push 40 mcall 40, EVM_REDRAW or EVM_KEY or EVM_BUTTON
;pop eax
;push 7
;pop ebx
mcall 40, 7
.wait: .wait:
;push 10
;pop eax
mcall 10 mcall 10
dec eax dec eax
jz .redraw jz .redraw
@ -410,8 +392,7 @@ do_reload:
jmp .wait jmp .wait
.key: .key:
mov al, 2 mcall 2
mcall
cmp ah, 'y' cmp ah, 'y'
jz .yes jz .yes
cmp ah, 'Y' cmp ah, 'Y'
@ -424,19 +405,13 @@ do_reload:
jnz .wait jnz .wait
.no: .no:
;push 40 mcall 40, EVM_REDRAW or EVM_KEY or EVM_BUTTON or EVM_DEBUG
;pop eax
;mov ebx, 0x107
mcall 40, 0x107
call draw_cursor call draw_cursor
mov esi, aN_str mov esi, aN_str
jmp put_message jmp put_message
.yes: .yes:
;push 40 mcall 40, EVM_REDRAW or EVM_KEY or EVM_BUTTON or EVM_DEBUG
;pop eax
;mov ebx, 0x107
mcall 40, 0x107
call draw_cursor call draw_cursor
mov esi, aY_str mov esi, aY_str
call put_message call put_message
@ -537,11 +512,6 @@ terminate_reload:
; Terminate process event ; Terminate process event
OnTerminate: OnTerminate:
;mov ecx, [debuggee_pid]
;push 8
;pop ebx
;push 69
;pop eax
mcall 69, 8, [debuggee_pid] mcall 69, 8, [debuggee_pid]
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -558,11 +528,6 @@ AfterSuspend:
ret ret
OnSuspend: OnSuspend:
;mov ecx, [debuggee_pid]
;push 4
;pop ebx
;push 69
;pop eax
mcall 69, 4, [debuggee_pid] mcall 69, 4, [debuggee_pid]
call AfterSuspend call AfterSuspend
mov esi, aSuspended mov esi, aSuspended
@ -572,11 +537,6 @@ OnSuspend:
; Resume process event ; Resume process event
DoResume: DoResume:
;mov ecx, [debuggee_pid]
;push 5
;pop ebx
;push 69
;pop eax
mcall 69, 5, [debuggee_pid] mcall 69, 5, [debuggee_pid]
mov [bSuspended], 0 mov [bSuspended], 0
ret ret
@ -788,9 +748,9 @@ exception:
.4: .4:
call get_dump call get_dump
pop eax pop eax
; int3 command generates exception 0D, #GP ; int3 command generates exception 0x0D, #GP
push eax push eax
cmp al, 0Dh cmp al, 0x0D
jnz .notdbg jnz .notdbg
; check for 0xCC byte at eip ; check for 0xCC byte at eip
push 0 push 0
@ -936,15 +896,6 @@ OnStep:
@@: @@:
push 0 push 0
;push 69
;pop eax
;push 6
;pop ebx
;mov ecx, [debuggee_pid]
;push 3
;pop edx
;mov edi, esp
;mov esi, [_eip]
mcall 69, 6, [debuggee_pid], 3, [_eip], esp mcall 69, 6, [debuggee_pid], 3, [_eip], esp
cmp eax, edx cmp eax, edx
pop eax pop eax
@ -969,8 +920,6 @@ OnStep:
; return address is [ebp-4] ; return address is [ebp-4]
.sysenter: .sysenter:
push 0 push 0
;push 69
;pop eax
inc edx ; read 4 bytes inc edx ; read 4 bytes
mov esi, [_ebp] mov esi, [_ebp]
sub esi, 4 sub esi, 4
@ -1143,11 +1092,6 @@ get_byte_nobreak:
ret ret
.nobreak: .nobreak:
;push 69
;pop eax
;push 6
;pop ebx
;mov ecx, [debuggee_pid]
xor edx, edx xor edx, edx
push edx push edx
inc edx inc edx
@ -1398,14 +1342,9 @@ DoBpm:
.l1: .l1:
cmp [drx_break+ecx*4], 0 cmp [drx_break+ecx*4], 0
jnz .l2 jnz .l2
;push 69
;pop eax
push ecx push ecx
mov dl, cl mov dl, cl
;mov ecx, [debuggee_pid]
mov esi, ebp mov esi, ebp
;push 9
;pop ebx
mcall 69, 9, [debuggee_pid] mcall 69, 9, [debuggee_pid]
test eax, eax test eax, eax
jz .ok jz .ok
@ -1675,14 +1614,6 @@ disable_breakpoint:
test byte [edi-1], 8 test byte [edi-1], 8
jnz .dr jnz .dr
push esi push esi
;push 7
;pop ebx
;push 69
;pop eax
;mov ecx, [debuggee_pid]
;xor edx, edx
;inc edx
;mov esi, [edi-5]
mcall 69, 7, [debuggee_pid], 1, [edi-5] mcall 69, 7, [debuggee_pid], 1, [edi-5]
pop esi pop esi
@ -1693,11 +1624,6 @@ disable_breakpoint:
mov dl, [edi] mov dl, [edi]
shr dl, 6 shr dl, 6
mov dh, 80h mov dh, 80h
;push 69
;pop eax
;push 9
;pop ebx
;mov ecx, [debuggee_pid]
mcall 69, 9, [debuggee_pid] mcall 69, 9, [debuggee_pid]
ret ret
@ -1717,18 +1643,9 @@ enable_breakpoint:
and byte [edi-1], not 2 and byte [edi-1], not 2
test byte [edi-1], 8 test byte [edi-1], 8
jnz .dr jnz .dr
;push 6
;pop ebx
;push 69
;pop eax
;mov esi, [edi-5]
;mov ecx, [debuggee_pid]
;xor edx, edx
;inc edx
mcall 69, 6, [debuggee_pid], 1, [edi-5] mcall 69, 6, [debuggee_pid], 1, [edi-5]
dec eax dec eax
jnz .err jnz .err
;mov al, 69
push 0xCC push 0xCC
mov edi, esp mov edi, esp
inc ebx inc ebx
@ -1747,12 +1664,7 @@ enable_breakpoint:
ret ret
.dr: .dr:
;push 9
;pop ebx
;push 69
;pop eax
mov esi, [edi-5] mov esi, [edi-5]
;mov ecx, [debuggee_pid]
mov dl, [edi] mov dl, [edi]
shr dl, 6 shr dl, 6
mov dh, [edi] mov dh, [edi]
@ -1851,8 +1763,6 @@ OnUnpack:
pop esi pop esi
@@: @@:
;push 69
;pop eax
mcall 69 mcall 69
test eax, eax test eax, eax
jz .breakok jz .breakok
@ -1865,8 +1775,6 @@ OnUnpack:
; now wait for event ; now wait for event
.wait: .wait:
;push 10
;pop eax
mcall 10 mcall 10
dec eax dec eax
jz .redraw jz .redraw
@ -1896,11 +1804,6 @@ OnUnpack:
call put_message call put_message
pop esi edx pop esi edx
or dh, 80h or dh, 80h
;push 69
;pop eax
;push 9
;pop ebx
;mov ecx, [debuggee_pid]
mcall 69, 9, [debuggee_pid] mcall 69, 9, [debuggee_pid]
cmp esi, aUnpacked cmp esi, aUnpacked
jnz OnSuspend jnz OnSuspend
@ -1920,11 +1823,6 @@ OnUnpack:
call put_message call put_message
pop edx pop edx
or dh, 80h or dh, 80h
;push 69
;pop eax
;push 9
;pop ebx
;mov ecx, [debuggee_pid]
mcall 69, 9, [debuggee_pid] mcall 69, 9, [debuggee_pid]
jmp debugmsg jmp debugmsg
@ -1933,14 +1831,6 @@ OnUnpack:
push edx push edx
call get_context call get_context
push eax push eax
;mov al, 69
;mov bl, 6
;mov ecx, [debuggee_pid]
;mov edi, esp
;push 4
;pop edx
;push 0xC
;pop esi
mcall 69, 6, [debuggee_pid], 4, 0xC, esp mcall 69, 6, [debuggee_pid], 4, 0xC, esp
pop eax pop eax
pop edx pop edx