📄 sdisassm.asm
字号:
@@tab: mov ecx,ebx
not ecx
and ecx,07h
@@ltab: mov bptr [edi+ebx],20h
inc ebx
jecxz @@loop
loop @@ltab
jmp @@loop
@@done: mov [edi+ebx],al
cmp _commmode_flag,0
jz @@xxxx
mov esi,offs commbuf
cmp byte ptr [esi],20h
jz @@xxxx
mov byte ptr [edi+ebx],20h
push edi
mov edi,esi
mov ecx,80
xor al,al
repne scasb
lea esi,[edi-3]
pop edi
mov ecx,59
sub ecx,ebx
jbe @@xxxx
mov ebx,59
@@1: mov al,[esi]
dec esi
test al,al
jz @@2
cmp al,20h
jz @@1
mov [edi+ebx],al
dec ebx
loop @@1
@@2: cmp esi,offs commbuf-1
jbe @@xxxx
mov byte ptr [edi+ebx],0AEh
@@xxxx: mov edi,offs textbuf
mov byte ptr [edi+60],0
popad
ret
;=============================================================================
_group0:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type0tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type0tab[ebx*8+4] ; goto command offset inside group
_group1:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type1tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type1tab[ebx*8+4] ; goto command offset inside group
_group2:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type2tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type2tab[ebx*8+4] ; goto command offset inside group
_group3:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type3tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type3tab[ebx*8+4] ; goto command offset inside group
_group4:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type4tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type4tab[ebx*8+4] ; goto command offset inside group
_group5:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type5tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type5tab[ebx*8+4] ; goto command offset inside group
_group6:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type6tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type6tab[ebx*8+4] ; goto command offset inside group
_group7:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type7tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type7tab[ebx*8+4] ; goto command offset inside group
_group8:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type8tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type8tab[ebx*8+4] ; goto command offset inside group
_group9:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type9tab[ebx*8] ; get command keyword (text)
call put_string
jmp _type9tab[ebx*8+4] ; goto command offset inside group
_groupA:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeAtab[ebx*8] ; get command keyword (text)
call put_string
jmp _typeAtab[ebx*8+4] ; goto command offset inside group
_groupB:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeBtab[ebx*8] ; get command keyword (text)
call put_string
jmp _typeBtab[ebx*8+4] ; goto command offset inside group
_groupC:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeCtab[ebx*8] ; get command keyword (text)
call put_string
jmp _typeCtab[ebx*8+4] ; goto command offset inside group
_groupD:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeDtab[ebx*8] ; get command keyword (text)
call put_string
jmp _typeDtab[ebx*8+4] ; goto command offset inside group
_groupE:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeEtab[ebx*8] ; get command keyword (text)
call put_string
jmp _typeEtab[ebx*8+4] ; goto command offset inside group
_groupF:mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeFtab[ebx*8] ; get command keyword (text)
call put_string
jmp _typeFtab[ebx*8+4] ; goto command offset inside group
;-----------------------------------------------------------------------------
_type_0F: ; group op-codes with 0Fh header
call put_textal
mov bl,al
shr ebx,4
and ebx,0Fh
jmp _group0Ftab[ebx*4]
_group0F0:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type0tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type0tab0F[ebx*8+4] ; goto command offset inside group
_group0F1:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type1tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type1tab0F[ebx*8+4] ; goto command offset inside group
_group0F2:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type2tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type2tab0F[ebx*8+4] ; goto command offset inside group
_group0F3:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type3tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type3tab0F[ebx*8+4] ; goto command offset inside group
_group0F4:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type4tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type4tab0F[ebx*8+4] ; goto command offset inside group
_group0F5:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type5tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type5tab0F[ebx*8+4] ; goto command offset inside group
_group0F6:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type6tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type6tab0F[ebx*8+4] ; goto command offset inside group
_group0F7:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type7tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type7tab0F[ebx*8+4] ; goto command offset inside group
_group0F8:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type8tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type8tab0F[ebx*8+4] ; goto command offset inside group
_group0F9:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_type9tab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _type9tab0F[ebx*8+4] ; goto command offset inside group
_group0FA:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeAtab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _typeAtab0F[ebx*8+4] ; goto command offset inside group
_group0FB:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeBtab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _typeBtab0F[ebx*8+4] ; goto command offset inside group
_group0FC:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeCtab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _typeCtab0F[ebx*8+4] ; goto command offset inside group
_group0FD:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeDtab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _typeDtab0F[ebx*8+4] ; goto command offset inside group
_group0FE:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeEtab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _typeEtab0F[ebx*8+4] ; goto command offset inside group
_group0FF:
mov bl,al
and ebx,0Fh ; ebx = 0Fh masked opcode
mov edx,_typeFtab0F[ebx*8] ; get command keyword (text)
call put_string
jmp _typeFtab0F[ebx*8+4] ; goto command offset inside group
;-----------------------------------------------------------------------------
_type_grp1c80:
mov ebp,offs _grp1tab
call decode_by_grp
jmp _type_EbIb
_type_grp1c81:
mov ebp,offs _grp1tab
call decode_by_grp
jmp _type_EvIv
_type_grp1c83:
mov ebp,offs _grp1tab
call decode_by_grp
jmp _type_EvIb
_type_grp2cC0:
mov ebp,offs _grp2tab
call decode_by_grp
cmp al,06h
jz _invalid
jmp _type_EbIb
_type_grp2cC1:
mov ebp,offs _grp2tab
call decode_by_grp
cmp al,06h
jz _invalid
jmp _type_EvIb
_type_grp2cD0:
mov ebp,offs _grp2tab
call decode_by_grp
cmp al,06h
jz _invalid
call _type_Eb
call put_comma
jmp put_one
_type_grp2cD1:
mov ebp,offs _grp2tab
call decode_by_grp
cmp al,06h
jz _invalid
call _type_Ev
call put_comma
jmp put_one
_type_grp2cD2:
mov ebp,offs _grp2tab
call decode_by_grp
cmp al,06h
jz _invalid
call _type_Eb
call put_comma
jmp put_cl
_type_grp2cD3:
mov ebp,offs _grp2tab
call decode_by_grp
cmp al,06h
jz _invalid
call _type_Ev
call put_comma
jmp put_cl
_type_grp3cF6:
mov ebp,offs _grp3tab
call decode_by_grp
test al,al
jz _type_EbIb
cmp al,01h
jz _invalid
jmp _type_Eb
_type_grp3cF7:
mov ebp,offs _grp3tab
call decode_by_grp
test al,al
jz _type_EvIv
cmp al,01h
jz _invalid
jmp _type_Ev
_type_grp4cFE:
mov ebp,offs _grp4tab
call decode_by_grp
cmp al,02h
jae _invalid
jmp _type_Eb
_type_grp5cFF:
mov ebp,offs _grp5tab
call decode_by_grp
cmp al,07h
jz _invalid
cmp al,03h
jz _type_farEv
cmp al,05h
jz _type_farjumpEv
cmp al,04h
jz _type_jumpEv
jmp _type_Ev
_type_grp6c:
mov ebp,offs _grp6tab
call decode_by_grp
cmp al,06h
jae _invalid
jmp _type_Ew
_type_grp7c:
mov ebp,offs _grp7tab
call decode_by_grp
cmp al,05h
jz _invalid
jmp _type_Ew
_type_grp8c:
mov ebp,offs _grp8tab
call decode_by_grp
cmp al,04h
jb _invalid
jmp _type_EvIb
;=============================================================================
_type_esc0:
call put_textal
call decode_mode
movzx ebx,ch
cmp ah,3
jz @@mod3
mov edx,_esc0tab0[ebx*4]
call put_string
call put_tab
call decode_by_mod
jmp put_memd
@@mod3: mov edx,_esc0tab1[ebx*4]
call put_string
call put_tab
mov edx,offs _fpureg
call put_string
call put_comma
movzx ebx,cl
lea edx,_fputab87[ebx*8]
jmp put_string
_type_esc1:
call put_textal
call decode_mode
movzx ebx,ch
cmp ah,3
jz @@mod3
mov edx,_esc1tab0[ebx*4]
test edx,edx
jz _escape
call put_string
call put_tab
cmp ch,5
jz @@l0
cmp ch,7
jz @@l0
call decode_by_mod
jmp put_memd
@@l0: call decode_by_mod
jmp put_memw
@@mod3: movzx eax,cl
shl eax,3
add ebx,eax
mov edx,_esc1tab1[ebx*4]
test edx,edx
jz _escape
call put_string
cmp ch,1
jbe @@l1
ret
@@l1: call put_tab
movzx ebx,cl
lea edx,_fputab87[ebx*8]
jmp put_string
_type_esc2:
call put_textal
call decode_mode
movzx ebx,ch
cmp ah,3
jz @@mod3
mov edx,_esc2tab0[ebx*4]
call put_string
call put_tab
call decode_by_mod
jmp put_memd
@@mod3: mov edx,_esc2tab1[ebx*4]
test edx,edx
jz _escape
jmp put_string
_type_esc3:
call put_textal
call decode_mode
movzx ebx,ch
cmp ah,3
jz @@mod3
mov edx,_esc3tab0[ebx*4]
test edx,edx
jz _escape
call put_string
call put_tab
cmp ch,3
ja @@l1
call decode_by_mod
jmp put_memd
@@l1: mov edx,offs _text_temp
call put_string
call decode_by_mod
jmp put_memd
@@mod3: cmp ch,4
jnz _escape
movzx ebx,cl
mov edx,_esc3tab1[ebx*4]
test edx,edx
jz _escape
jmp put_string
_type_esc4:
call put_textal
call decode_mode
movzx ebx,ch
cmp ah,3
jz @@mod3
mov edx,_esc4tab0[ebx*4]
call put_string
call put_tab
mov edx,offs _text_long
call put_string
call decode_by_mod
jmp put_memd
@@mod3: mov edx,_esc4tab1[ebx*4]
call put_string
call put_tab
movzx ebx,cl
lea edx,_fputab87[ebx*8]
call put_string
call put_comma
mov edx,offs _fpureg
jmp put_string
_type_esc5:
call put_textal
call decode_mode
movzx ebx,ch
cmp ah,3
jz @@mod3
mov edx,_esc5tab0[ebx*4]
test edx,edx
jz _escape
call put_string
call put_tab
cmp ch,4
jz @@l1
cmp ch,6
jz @@l1
cmp ch,7
jz @@l2
mov edx,offs _text_long
call put_string
@@l1: call decode_by_mod
jmp put_memd
@@l2: call decode_by_mod
jmp put_memw
@@mod3: mov edx,_esc5tab1[ebx*4]
test edx,edx
jz _escape
call put_string
call put_tab
movzx ebx,cl
lea edx,_fputab87[ebx*8]
jmp put_string
_type_esc6:
call put_textal
call decode_mode
movzx ebx,ch
cmp ah,3
jz @@mod3
mov edx,_esc6tab0[ebx*4]
call put_string
call put_tab
mov edx,offs _text_short
call put_string
call decode_by_mod
jmp put_memw
@@mod3: mov edx,_esc6tab1[ebx*4]
test edx,edx
jz _escape
call put_string
call put_tab
movzx ebx,cl
lea edx,_fputab87[ebx*8]
call put_string
call put_comma
mov edx,offs _fpureg
jmp put_string
_type_esc7:
call put_textal
call decode_mode
movzx ebx,ch
cmp ah,3
jz @@mod3
mov edx,_esc7tab0[ebx*4]
test edx,edx
jz _escape
call put_string
call put_tab
cmp ch,3
ja @@l1
mov edx,offs _text_short
call put_string
call decode_by_mod
jmp put_memw
@@l1: cmp ch,4
jz @@l2
cmp ch,6
jz @@l2
mov edx,offs _text_long
call put_string
call decode_by_mod
jmp put_memd
@@l2: mov edx,offs _text_temp
call put_string
call decode_by_mod
jmp put_memd
@@mod3: mov edx,_esc7tab1[ebx*4]
test edx,edx
jz _escape
call put_string
call put_tab
mov edx,offs _regtab16
jmp put_string
;=============================================================================
decode_mode:
mov ah,al
mov cx,ax
and cl,7 ; cl = mask r/m field
shr ch,3
and ch,7 ; ch = mask reg field
shr ah,6 ; ah = mask mod field
ret
decode_by_mod:
clr edx
mov _refshow,dl
mov _refaddr,edx
mov _prefix_esp,dl
mov __temp_addr,edx
cmp _adrsiz,0
jnz decode_by_mod86
cmp ah,03h
jz @@l3 ; mod=11
call put_prefix
call put_open
@@l0: cmp ah,02h
jz @@l2 ; mod=10
cmp ah,01h
jz @@l1 ; mod=01
;---------------------------------------------------------------------------
cmp cl,05h ; [ addr ],reg
jnz @@l01
call put_texteax
call makehexeax
call put_commaddr
jmp put_close
@@l01: cmp cl,04h ; is s-i-b present?
jnz @@l02 ; no, jump
push ecx ; yes, do [ reg * index ]
call put_textal
call decode_mode
cmp cl,4
setz _prefix_esp ; reference to SS:[ xxx ]
cmp cl,05h ; [ d32 + reg * index ]
jnz @@l01e
push eax
call put_texteax ; get d32
add __temp_addr,eax
test eax,eax ; don't print if zero
jz @@l01w
call makehexeax
pop eax
jmp @@l01d
@@l01w: pop eax
jmp @@l01v
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -