MTDBG: resizeable window

git-svn-id: svn://kolibrios.org@4908 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2014-04-27 22:13:37 +00:00
parent 1d49834274
commit 1658e3af3a
2 changed files with 219 additions and 108 deletions

View File

@ -2,14 +2,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
macro DrawRectangle x, y, w, h, color
{
mcall 13, x shl 16 + w, y shl 16 + 1, color ; top
mcall , x shl 16 + 1, y shl 16 + h, color ; left
mcall , (x+w) shl 16 +1, y shl 16 + (h+1), color ; right
mcall , x shl 16 + w, (y+h) shl 16 + 1, color ; bottom
}
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; Color scheme ; Color scheme
@ -69,7 +61,7 @@ data_x_pos equ 12
data_x_size equ data_width*6 data_x_size equ data_width*6
title_x_pos equ 30 title_x_pos equ 30
title_y_pos equ 32 title_y_pos equ 8
title_y_size equ 10 title_y_size equ 10
;dump_y_pos equ (registers_y_pos + registers_y_size + 5) ;dump_y_pos equ (registers_y_pos + registers_y_size + 5)
@ -99,7 +91,7 @@ registers_y_pos equ (title_y_pos + title_y_size - 3)
registers_x_size equ 134+2*6 registers_x_size equ 134+2*6
registers_y_size equ (cmdline_y_pos + cmdline_y_size - registers_y_pos+1) registers_y_size equ (cmdline_y_pos + cmdline_y_size - registers_y_pos+1)
wnd_x_size equ (data_x_pos + messages_x_size + data_x_pos + registers_x_size+3) wnd_x_size equ (data_x_pos + messages_x_size + data_x_pos + registers_x_size+3) + 10
wnd_y_size equ (cmdline_y_pos + cmdline_y_size + data_x_pos) wnd_y_size equ (cmdline_y_pos + cmdline_y_size + data_x_pos)
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -388,7 +380,8 @@ clear_cmdline_end:
add ebx, cmdline_x_pos add ebx, cmdline_x_pos
shl ebx, 16 shl ebx, 16
or ebx, ecx or ebx, ecx
mov ecx, cmdline_y_pos*10000h + cmdline_y_size mov ecx, [cmdline_y_pos_dd]
mov cx, cmdline_y_size
mov edx, COLOR_BG_NORMAL mov edx, COLOR_BG_NORMAL
; draw container rectangle/box for cmdline ; draw container rectangle/box for cmdline
mcall 13 mcall 13
@ -411,7 +404,8 @@ draw_cmdline_end:
imul ebx, 6 imul ebx, 6
add ebx, cmdline_x_pos add ebx, cmdline_x_pos
shl ebx, 16 shl ebx, 16
or ebx, cmdline_y_pos+1 mov bx, word[cmdline_y_pos_dd+4]
inc bx
; draw a text string in the window ; draw a text string in the window
mcall 4 mcall 4
ret ret
@ -518,12 +512,17 @@ put_message:
draw_messages: draw_messages:
; draw container rectangle/box ; draw container rectangle/box
mcall 13, messages_x_pos*10000h+messages_x_size, messages_y_pos*10000h+messages_y_size, COLOR_BG_NORMAL mov ebx, messages_x_pos shl 16
add ebx, [messages_x_size_dd+4]
mov ecx, [messages_y_pos_dd]
mov cx, messages_y_size
mcall 13, , , COLOR_BG_NORMAL
mov edx, messages mov edx, messages
push messages_width push messages_width
pop esi pop esi
mov ecx, COLOR_TXT_NORMAL mov ecx, COLOR_TXT_NORMAL
mov ebx, messages_x_pos*10000h+messages_y_pos mov ebx, messages_x_pos*10000h
mov bx, word[messages_y_pos_dd+4]
@@: @@:
; display text string in the window ; display text string in the window
@ -539,7 +538,8 @@ draw_messages:
; TODO: make it cursor.draw and cursor.hide ??? ; TODO: make it cursor.draw and cursor.hide ???
draw_cursor: draw_cursor:
mov ecx, cmdline_y_pos*10001h+cmdline_y_size-1 mov ecx, [cmdline_y_pos_dd+2]
add cx, cmdline_y_size-1
mov ebx, [cmdline_pos] mov ebx, [cmdline_pos]
imul ebx, 6 imul ebx, 6
add ebx, cmdline_x_pos add ebx, cmdline_x_pos
@ -557,7 +557,8 @@ hide_cursor:
add ebx, cmdline_x_pos add ebx, cmdline_x_pos
shl ebx, 16 shl ebx, 16
inc ebx inc ebx
mov ecx, cmdline_y_pos*10000h + cmdline_y_size mov ecx, [cmdline_y_pos_dd]
mov cx, cmdline_y_size
mov edx, COLOR_BG_NORMAL mov edx, COLOR_BG_NORMAL
; draw container rectangle/box ; draw container rectangle/box
mcall 13 mcall 13
@ -570,7 +571,8 @@ hide_cursor:
imul ebx, 6 imul ebx, 6
add ebx, cmdline_x_pos add ebx, cmdline_x_pos
shl ebx, 16 shl ebx, 16
or ebx, cmdline_y_pos+1 mov bx, word[cmdline_y_pos_dd+4]
inc bx
push 1 push 1
pop esi pop esi
; draw text string in the window ; draw text string in the window
@ -585,7 +587,9 @@ hide_cursor:
; FIXME: something wrong here ; FIXME: something wrong here
redraw_title: redraw_title:
; draw container rectangle/box ; draw container rectangle/box
mcall 13, title_x_pos*10000h+data_x_pos+data_x_size-title_x_pos, title_y_pos*10000h+title_y_size, COLOR_BG_NORMAL mov ebx, [data_x_size_dd+4]
add ebx, title_x_pos*10000h+data_x_pos-title_x_pos
mcall 13, , title_y_pos*10000h+title_y_size, COLOR_BG_NORMAL
draw_title: draw_title:
mcall 38, (data_x_pos-2)*10000h+title_x_pos-5, (title_y_pos+5)*10001h, COLOR_LINE mcall 38, (data_x_pos-2)*10000h+title_x_pos-5, (title_y_pos+5)*10001h, COLOR_LINE
@ -599,7 +603,8 @@ draw_title:
imul ebx, esi, 6 imul ebx, esi, 6
add ebx, title_x_pos+4 add ebx, title_x_pos+4
shl ebx, 16 shl ebx, 16
mov bx, data_x_pos+data_x_size-10-5-6*7 mov bx, data_x_pos-10-5-6*7
add bx, word[data_x_size_dd+4]
cmp [bSuspended], 0 cmp [bSuspended], 0
jz @f jz @f
add ebx, 6 add ebx, 6
@ -607,7 +612,8 @@ draw_title:
@@: @@:
; draw line with COLOR_LINE (in edx) ; draw line with COLOR_LINE (in edx)
mcall mcall
mov ebx, (data_x_pos+data_x_size-10+4)*0x10000 + data_x_pos+data_x_size+2 mov ebx, [data_x_size_dd+2]
add ebx, (data_x_pos-10+4)*0x10000 + data_x_pos+2
; draw line with COLOR_LINE (in edx) ; draw line with COLOR_LINE (in edx)
mcall mcall
mov al, 4 mov al, 4
@ -624,7 +630,8 @@ draw_title:
mcall mcall
cmp [debuggee_pid], 0 cmp [debuggee_pid], 0
jz .nodebuggee jz .nodebuggee
mov ebx, (data_x_pos+data_x_size-10-6*7)*10000h + title_y_pos mov ebx, [data_x_size_dd]
add ebx, (data_x_pos-10-6*7)*10000h + title_y_pos
mov edx, aRunning mov edx, aRunning
push 7 push 7
pop esi pop esi
@ -642,7 +649,8 @@ draw_title:
.nodebuggee: .nodebuggee:
mov al, 38 mov al, 38
mov ebx, (data_x_pos+data_x_size-10-6*7-5)*0x10000 + data_x_pos+data_x_size+2 mov ebx, [data_x_size_dd+2]
add ebx, (data_x_pos-10-6*7-5)*0x10000 + data_x_pos+2
mov ecx, (title_y_pos+5)*10001h mov ecx, (title_y_pos+5)*10001h
mov edx, COLOR_LINE mov edx, COLOR_LINE
jmp @b jmp @b
@ -1068,7 +1076,9 @@ draw_reg_title:
@@: @@:
mov edx, aMain mov edx, aMain
; draw a text string in the window ; draw a text string in the window
mcall 4, (registers_x_pos+4)*10000h+registers_y_pos+2 mov ebx, [registers_x_pos_dd]
add ebx, 4*10000h+registers_y_pos+2
mcall 4
cmp [reg_mode], REG_MODE_SSE cmp [reg_mode], REG_MODE_SSE
jz @f jz @f
@ -1076,7 +1086,9 @@ draw_reg_title:
@@: @@:
mov edx, aSSE mov edx, aSSE
; draw a text string in the window ; draw a text string in the window
mcall 4, (registers_x_pos+46)*10000h+registers_y_pos+2 mov ebx, [registers_x_pos_dd]
add ebx, 46*10000h+registers_y_pos+2
mcall 4
cmp [reg_mode], REG_MODE_AVX cmp [reg_mode], REG_MODE_AVX
jz @f jz @f
@ -1084,7 +1096,9 @@ draw_reg_title:
@@: @@:
mov edx, aAVX mov edx, aAVX
; draw a text string in the window ; draw a text string in the window
mcall 4, (registers_x_pos+88)*10000h+registers_y_pos+2 mov ebx, [registers_x_pos_dd]
add ebx, 88*10000h+registers_y_pos+2
mcall 4
ret ret
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -1097,33 +1111,43 @@ draw_main_registers:
push 4 push 4
pop ecx pop ecx
mov edx, regs_strs mov edx, regs_strs
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+22 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+22
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+32 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+32
add esi, _ebx-_eax add esi, _ebx-_eax
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+42 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+42
add esi, _ecx-_ebx add esi, _ecx-_ebx
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+52 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+52
add esi, _edx-_ecx add esi, _edx-_ecx
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+62 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+62
add esi, _esi-_edx add esi, _esi-_edx
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+72 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+72
add esi, _edi-_esi add esi, _edi-_esi
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+82 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+82
add esi, _ebp-_edi add esi, _ebp-_edi
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+92 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+92
add esi, _esp-_ebp add esi, _esp-_ebp
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+102 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+102
add esi, _eip-_esp add esi, _eip-_esp
call draw_register call draw_register
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+112 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+112
mov cl, 7 mov cl, 7
add esi, _eflags-_eip add esi, _eflags-_eip
@ -1136,7 +1160,8 @@ draw_main_registers:
push 8 push 8
xor ebp, ebp xor ebp, ebp
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+142 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+142
align 4 align 4
.draw_mmx_regs: .draw_mmx_regs:
@ -1154,7 +1179,8 @@ align 4
mov [esp], byte 8 mov [esp], byte 8
xor ebp, ebp xor ebp, ebp
mov ebx, (registers_x_pos+2)*10000h+registers_y_pos+232 mov ebx, [registers_x_pos_dd]
add ebx, 2*10000h+registers_y_pos+232
align 4 align 4
.draw_fpu_regs: .draw_fpu_regs:
@ -1177,7 +1203,9 @@ align 4
mov edx, aColon mov edx, aColon
xor esi, esi xor esi, esi
inc esi inc esi
mcall 4, (registers_x_pos+10)*10000h+registers_y_pos+122 mov ebx, [registers_x_pos_dd]
add ebx, 10*10000h+registers_y_pos+122
mcall 4
mov edx, flags mov edx, flags
@@: @@:
@ -1207,7 +1235,11 @@ draw_avx_registers:
draw_registers: draw_registers:
; draw container rectangle/box with COLOR_BG_NORMAL ; draw container rectangle/box with COLOR_BG_NORMAL
mcall 13, (registers_x_pos-1)*10000h+(registers_x_size+2), (registers_y_pos-1)*10000h+(registers_y_size+2), COLOR_BG_NORMAL mov ebx, [registers_x_pos_dd]
add ebx, (-1)*10000h+(registers_x_size+2)
mov ecx, [registers_y_size_dd+4]
add ecx, (registers_y_pos-1)*10000h+2
mcall 13, , , COLOR_BG_NORMAL
call draw_reg_title call draw_reg_title
.redraw: .redraw:
@ -1231,7 +1263,9 @@ draw_registers:
draw_dump: draw_dump:
; draw container rectangle/box in the window ; draw container rectangle/box in the window
mcall 13, data_x_pos*10000h+data_x_size, dump_y_pos*10000h+dump_y_size, COLOR_BG_NORMAL mov ebx, [data_x_size_dd+4]
add ebx, data_x_pos*10000h
mcall 13, , dump_y_pos*10000h+dump_y_size, COLOR_BG_NORMAL
.redraw: .redraw:
; addresses ; addresses
@ -1380,7 +1414,9 @@ draw_disasm:
; setting up background color for disassembled text ; setting up background color for disassembled text
mov edx, COLOR_BG_NORMAL mov edx, COLOR_BG_NORMAL
; draw container rectangle/box with color COLOR_BG_NORMAL (was 0xFFFFFF - white) ; draw container rectangle/box with color COLOR_BG_NORMAL (was 0xFFFFFF - white)
mcall 13, data_x_pos*10000h+data_x_size mov ebx, [data_x_size_dd+4]
add ebx, data_x_pos*10000h
mcall 13
pop ebx pop ebx
; copy color value from edx (COLOR_BG_NORMAL) ; copy color value from edx (COLOR_BG_NORMAL)
mov edi, edx mov edi, edx
@ -1407,7 +1443,8 @@ draw_disasm:
shl ecx, 16 shl ecx, 16
mov cl, 10 mov cl, 10
imul ebx, 10001h imul ebx, 10001h
sub bx, data_x_pos+data_x_size sub bx, data_x_pos
sub bx, word[data_x_size_dd+4]
neg bx neg bx
mov al, 13 mov al, 13
; copy color value from edi ; copy color value from edi
@ -1415,7 +1452,8 @@ draw_disasm:
; draw container rectangle/box for disassembled text, color in edx ; draw container rectangle/box for disassembled text, color in edx
mcall mcall
inc [disasm_cur_str] inc [disasm_cur_str]
cmp [disasm_cur_str], disasm_height mov eax, [disasm_height_dd]
cmp [disasm_cur_str], eax
jae .loopend jae .loopend
.nosymb: .nosymb:
@ -1425,7 +1463,8 @@ draw_disasm:
jc .loopend jc .loopend
mov edx, COLOR_BG_NORMAL mov edx, COLOR_BG_NORMAL
mov esi, COLOR_TXT_NORMAL mov esi, COLOR_TXT_NORMAL
mov ebx, data_x_pos*10000h + data_x_size mov ebx, data_x_pos*10000h
add ebx, [data_x_size_dd+4]
mov ecx, [disasm_cur_str] mov ecx, [disasm_cur_str]
imul ecx, 10*10000h imul ecx, 10*10000h
add ecx, (disasm_y_pos-1)*10000h + 10 add ecx, (disasm_y_pos-1)*10000h + 10
@ -1519,21 +1558,25 @@ draw_disasm:
; draw a text string in the window, color in ecx ; draw a text string in the window, color in ecx
mcall 4 mcall 4
inc [disasm_cur_str] inc [disasm_cur_str]
cmp [disasm_cur_str], disasm_height mov eax, [disasm_height_dd]
cmp [disasm_cur_str], eax
jb .loop jb .loop
.loopend: .loopend:
mov ecx, disasm_height mov ecx, [disasm_height_dd]
sub ecx, [disasm_cur_str] sub ecx, [disasm_cur_str]
jz @f jz @f
imul ecx, 10 imul ecx, 10
inc ecx inc ecx
mov eax, disasm_y_pos + disasm_y_size mov eax, disasm_y_pos
add eax, [disasm_y_size_dd+4]
sub eax, ecx sub eax, ecx
shl eax, 16 shl eax, 16
add ecx, eax add ecx, eax
; Draw filled rectangle ; Draw filled rectangle
mcall 13, data_x_pos*10000h+data_x_size, , COLOR_BG_NORMAL mov ebx, [data_x_size_dd+4]
add ebx, data_x_pos*10000h
mcall 13, , , COLOR_BG_NORMAL
@@: @@:
ret ret
@ -1543,7 +1586,7 @@ draw_disasm:
; TODO: cleanup of this function, make some global labels local ; TODO: cleanup of this function, make some global labels local
update_disasm_eip: update_disasm_eip:
; test if instruction at eip is showed ; test if instruction at eip is showed
mov ecx, disasm_height mov ecx, [disasm_height_dd+4]
mov eax, [disasm_start_pos] mov eax, [disasm_start_pos]
mov [disasm_cur_pos], eax mov [disasm_cur_pos], eax
@ -1596,82 +1639,129 @@ draw_window:
mcall 12, 1 mcall 12, 1
; define window ; define window
mcall 0, wnd_x_size, wnd_y_size, (COLOR_BG_NORMAL or 0x54000000), , caption_str mcall 0, wnd_x_size, wnd_y_size, (COLOR_BG_NORMAL or 0x33000000), ,caption_str
; clear unused areas ; Get actual window size
; get window skin height mcall 9, thread_info, -1
mcall 48, 4
cmp eax, title_y_pos
jb @f
push registers_y_pos
pop eax
@@: ; Check if window is rolled up
push registers_y_pos test [thread_info.wnd_state], 100b
pop ecx jnz .done
push eax
sub ecx, eax ; Check if window isnt smaller then permisseable
mov eax, [thread_info.box.width] ; window xsize
mov ebx, [thread_info.box.height] ; ysize
mov edx, [thread_info.client_box.width] ; work area xsize
mov esi, [thread_info.client_box.height] ; ysize
sub eax, edx
sub ebx, esi
cmp edx, wnd_x_size
jae .x_ok
mov edx, wnd_x_size
.x_ok:
add edx, eax
cmp esi, wnd_y_size
jae .y_ok
mov esi, wnd_y_size
.y_ok:
add esi, ebx
mcall 67, -1, -1 ; set the new sizes
; (re)calculate coordinates of GUI elements
mov eax, [thread_info.client_box.width]
sub eax, data_x_pos + data_x_pos + registers_x_size+3
mov [data_x_size_dd+4], eax
mov [messages_x_size_dd+4], eax
shl eax, 16 shl eax, 16
add ecx, eax mov [data_x_size_dd], eax
mov ebx, 5*10000h + (wnd_x_size-9) mov [messages_x_size_dd], eax
mov edx, COLOR_BG_NORMAL shr eax, 16
; draw container rectangle/box for registers information region add eax, data_x_pos + 4
mcall 13 mov [registers_x_pos_dd+4], eax
mov ecx, (dump_y_pos+dump_y_size)*10000h + (disasm_y_pos-dump_y_pos-dump_y_size) shl eax, 16
; draw container rectangle/box for dump memory region mov [registers_x_pos_dd], eax
mcall
mov ecx, (disasm_y_pos-1+disasm_y_size)*10000h + (messages_y_pos-disasm_y_pos+1-disasm_y_size) mov eax, [thread_info.client_box.height]
; draw container rectangle/box for disassembled code region sub eax, cmdline_y_size + data_x_pos
mcall mov [cmdline_y_pos_dd+4], eax
mov ecx, (messages_y_pos+messages_y_size)*10000h + (wnd_y_size-messages_y_pos-messages_y_size-4) shl eax, 16
; draw container rectangle/box for messages window region mov [cmdline_y_pos_dd], eax
mcall shr eax, 16
mov ebx, 5*10000h + (data_x_pos-5) sub eax, messages_y_size + 4
pop ecx mov [messages_y_pos_dd+4], eax
imul ecx, 10001h shl eax, 16
sub cx, wnd_y_size-4 mov [messages_y_pos_dd], eax
neg cx shr eax, 16
; draw container rectangle/box sub eax, disasm_y_pos + 4
mcall mov [disasm_y_size_dd+4], eax
mov ebx, (data_x_pos+data_x_size)*10000h + (wnd_x_size-data_x_pos-data_x_size-4) shl eax, 16
; draw container rectangle/box mov [disasm_y_size_dd], eax
mcall shr eax, 16
mov ebx, 5*10000h + title_x_pos - 5 mov ecx, 10
mov ecx, (title_y_pos)*10000h + (title_y_size) xor edx, edx
; draw container rectangle/box for dump memory region title div ecx
mcall mov [disasm_height_dd], eax
mov eax, [thread_info.client_box.height]
sub eax, data_x_pos + registers_y_pos-1
mov [registers_y_size_dd+4], eax
shl eax, 16
mov [registers_y_size_dd], eax
; messages frame ; messages frame
mov ebx, (messages_x_pos-2)*10000h + (messages_x_pos+messages_x_size+2) mov ebx, [messages_x_size_dd+4]
add ebx, (messages_x_pos-2)*10000h + (messages_x_pos+2)
push ebx push ebx
mov ecx, (messages_y_pos-2)*10001h mov ecx, [messages_y_pos_dd+2]
add ecx, -2*10001h
mov edx, COLOR_LINE mov edx, COLOR_LINE
mcall 38 mcall 38
mov ecx, (messages_y_pos+messages_y_size+2)*10001h add ecx, (messages_y_size+2+2)*10001h
mcall mcall
mov ebx, (messages_x_pos-2)*10001h mov ebx, (messages_x_pos-2)*10001h
push ebx push ebx
mov ecx, (messages_y_pos-2)*10000h + (messages_y_pos+messages_y_size+2) mov ecx, [messages_y_pos_dd+2]
add ecx, (-2*10000h) + (messages_y_size+2)
mcall mcall
mov ebx, (messages_x_pos+messages_x_size+2)*10001h mov ebx, [messages_x_size_dd+2]
add ebx, (messages_x_pos+2)*10001h
push ebx push ebx
mcall mcall
; command line frame ; command line frame
mov ecx, (cmdline_y_pos-2)*10000h + (cmdline_y_pos+cmdline_y_size+2) mov ecx, [cmdline_y_pos_dd+2]
add ecx, (-2*10000h) + (cmdline_y_size+2)
pop ebx pop ebx
mcall mcall
pop ebx pop ebx
mcall mcall
pop ebx pop ebx
mov ecx, (cmdline_y_pos+cmdline_y_size+2)*10001h mov ecx, [cmdline_y_pos_dd+2]
add ecx, (cmdline_y_size+2)*10001h
mcall mcall
mov ecx, (cmdline_y_pos-2)*10001h mov ecx, [cmdline_y_pos_dd+2]
add ecx, (-2*10001h)
mcall mcall
; registers frame ; registers frame
DrawRectangle (registers_x_pos-2), (registers_y_pos-2), (registers_x_size+3), (registers_y_size+3), COLOR_LINE mov ebx, [registers_x_pos_dd]
; draw container rectangle/box for registers information window region add ebx, (-2) shl 16 + (registers_x_size+3)
mov ecx, (registers_y_pos-2) shl 16 + 1
mov edx, COLOR_LINE
mcall 13 ; top
mov ebx, [registers_x_pos_dd]
add ebx, ((-2)+(registers_x_size+3)) shl 16 +1
mov ecx, [registers_y_size_dd+4]
add ecx, (registers_y_pos-2) shl 16 + (+3+1)
mcall ; right
mov ebx, [registers_x_pos_dd]
add ebx, (-2) shl 16 + (registers_x_size+3)
mov ecx, [registers_y_size_dd]
add ecx, ((registers_y_pos-2)+(+3)) shl 16 + 1
mcall ; bottom
; messages ; messages
call draw_messages call draw_messages
@ -1682,12 +1772,15 @@ draw_window:
; title & registers & dump & disasm ; title & registers & dump & disasm
mov ebx, (data_x_pos-2)*10001h mov ebx, (data_x_pos-2)*10001h
mov ecx, (title_y_pos+5)*10000h + (messages_y_pos-2) mov ecx, (title_y_pos+5)*10000h + (-2)
add ecx, [messages_y_pos_dd+4]
mov edx, COLOR_LINE mov edx, COLOR_LINE
mcall 38 mcall 38
mov ebx, (data_x_pos+data_x_size+2)*10001h mov ebx, [data_x_size_dd+2]
add ebx, (data_x_pos+2)*10001h
mcall mcall
mov ebx, (data_x_pos-2)*10000h + (data_x_pos+data_x_size+2) mov ebx, [data_x_size_dd+4]
add ebx, (data_x_pos-2)*10000h + (data_x_pos+2)
mov ecx, (disasm_y_pos-4)*10001h mov ecx, (disasm_y_pos-4)*10001h
mcall mcall
@ -1697,6 +1790,8 @@ draw_window:
call draw_dump call draw_dump
call draw_disasm call draw_disasm
.done:
; end of window redraw ; end of window redraw
mcall 12, 2 mcall 12, 2
ret ret

View File

@ -1196,7 +1196,7 @@ OnUnassemble:
cmp byte [esi], 0 cmp byte [esi], 0
jnz .param jnz .param
mov eax, [disasm_start_pos] mov eax, [disasm_start_pos]
mov ecx, disasm_height mov ecx, [disasm_height_dd]
mov [disasm_cur_pos], eax mov [disasm_cur_pos], eax
.l: .l:
@ -1969,6 +1969,20 @@ help_groups:
dd aBreakpoints, 0, 0, help_breaks_msg dd aBreakpoints, 0, 0, help_breaks_msg
db 0 db 0
;-----------------------------------------------------------------------------
; Coordinates and sizes for GUI
data_x_size_dd dd data_x_size shl 16, data_x_size
messages_x_size_dd dd messages_x_size shl 16, messages_x_size
registers_x_pos_dd dd registers_x_pos shl 16, registers_x_pos
disasm_height_dd dd 18
disasm_y_size_dd dd disasm_y_size shl 16, disasm_y_size
messages_y_pos_dd dd messages_y_pos shl 16, messages_y_pos
cmdline_y_pos_dd dd cmdline_y_pos shl 16, cmdline_y_pos
registers_y_size_dd dd registers_y_size shl 16, registers_y_size
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; Commands format definitions ; Commands format definitions
@ -2431,8 +2445,8 @@ _esi dd ?
_edi dd ? _edi dd ?
_ctx_flags: _ctx_flags:
dd ? dd ?
dd ? dd ?
_sse_flags: _sse_flags:
@ -2446,8 +2460,8 @@ _fpu_ip dd ?
dw ? dw ?
dw ? dw ?
dq ? dq ?
dq ? dq ?
fpu_context: fpu_context:
mmx_context: mmx_context:
@ -2534,6 +2548,8 @@ disasm_cur_pos dd ?
disasm_cur_str dd ? disasm_cur_str dd ?
disasm_string rb 256 disasm_string rb 256
thread_info process_information
i_param rb 256 i_param rb 256
; stack ; stack