IDD_DLG1 DIALOGEX 50,10,579,411
CAPTION "基址搜索器 作者:【残々剑】---->QQ:50325232"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX
BEGIN
CONTROL "选择进程",-1,"Button",WS_CHILDWINDOW|WS_VISIBLE|BS_GROUPBOX,6,3,222,27
CONTROL "范围",-1,"Button",WS_CHILDWINDOW|WS_VISIBLE|BS_GROUPBOX,231,3,159,27
CONTROL "进程例表:",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE,9,15,42,12
CONTROL "",IDC_CBO1,"ComboBox",WS_CHILDWINDOW|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|CBS_HASSTRINGS|CBS_SORT|CBS_DROPDOWNLIST,51,12,123,312,WS_EX_NOPARENTNOTIFY
CONTROL "刷新进程",IDC_BTN1,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,180,12,42,15
CONTROL "添加特征码",-1,"Button",WS_CHILDWINDOW|WS_VISIBLE|BS_GROUPBOX,6,33,384,78
CONTROL "基址",IDC_RBN1,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTORADIOBUTTON,12,45,33,12
CONTROL "Call地址",IDC_RBN2,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTORADIOBUTTON,93,45,42,12
CONTROL "OFFSET+1",IDC_RBN3,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTORADIOBUTTON,174,45,51,12
CONTROL "OFFSET+2",IDC_RBN4,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTORADIOBUTTON,255,45,51,12
CONTROL "OFFSET+4",IDC_RBN5,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTORADIOBUTTON,327,45,54,12
CONTROL "搜索范围",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE,237,15,36,12
CONTROL "0400000",IDC_EDT1,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_CENTER,276,15,45,12,WS_EX_CLIENTEDGE
CONTROL "到",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE|SS_CENTER,324,15,12,12
CONTROL "07FFFFF",IDC_EDT2,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_CENTER,339,15,45,12,WS_EX_CLIENTEDGE
CONTROL "名称:",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE,12,60,24,12
CONTROL "",IDC_EDT3,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,39,60,150,12,WS_EX_CLIENTEDGE
CONTROL "备注:",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE,198,60,24,12
CONTROL "",IDC_EDT4,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,228,60,156,12,WS_EX_CLIENTEDGE
CONTROL "特征码",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE,9,78,27,12
CONTROL "",IDC_EDT5,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_BORDER|WS_TABSTOP|ES_AUTOHSCROLL,39,78,345,12,WS_EX_CLIENTEDGE|WS_EX_NOPARENTNOTIFY
CONTROL "偏移值",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE,9,96,27,12
CONTROL "0",IDC_EDT6,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_UPPERCASE|ES_CENTER,39,96,18,12,WS_EX_CLIENTEDGE
CONTROL "计算偏移",IDC_BTN2,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,60,96,42,12
CONTROL "测试",IDC_BTN3,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,105,96,33,12
CONTROL "测试值",IDC_EDT7,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|ES_READONLY,144,96,51,12,WS_EX_CLIENTEDGE
CONTROL "插入行",IDC_BTN4,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,243,96,36,12
CONTROL "删除行",IDC_BTN5,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,282,96,36,12
CONTROL "特征码列表",-1,"Button",WS_CHILDWINDOW|WS_VISIBLE|BS_GROUPBOX,6,117,384,288
CONTROL "",-1,"Button",WS_CHILDWINDOW|WS_VISIBLE|BS_GROUPBOX,396,3,180,48
CONTROL "开始搜索",IDC_BTN6,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,399,12,42,33
CONTROL "导入特征码",IDC_BTN7,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,444,12,51,15
CONTROL "保存特征码",IDC_BTN8,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,444,30,51,15
CONTROL "",IDC_CBO2,"ComboBox",WS_CHILDWINDOW|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|CBS_DROPDOWNLIST,498,12,72,39
CONTROL "生成代码",IDC_BTN9,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,498,30,72,15
CONTROL "搜索结果",-1,"Button",WS_CHILDWINDOW|WS_VISIBLE|BS_GROUPBOX,396,57,180,348
CONTROL "",IDC_LSV1,"SysListView32",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|LVS_NOLABELWRAP|LVS_SHOWSELALWAYS|LVS_SINGLESEL|LVS_REPORT,9,126,378,273,WS_EX_CLIENTEDGE|WS_EX_NOPARENTNOTIFY
CONTROL "",IDC_LSV2,"SysListView32",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|LVS_NOLABELWRAP|LVS_SHOWSELALWAYS|LVS_SINGLESEL|LVS_REPORT,402,69,168,330,WS_EX_CLIENTEDGE|WS_EX_NOPARENTNOTIFY
CONTROL "启用选择范围",IDC_CHK1,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,321,96,60,12
CONTROL "编辑行",IDC_BTN10,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,201,96,39,12
END
IDR_XPMANIFEST1 MANIFEST "xpmanifest.xml"
IDD_SUB1 DIALOGEX 30,115,129,66
CAPTION "计算偏移"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_VISIBLE|WS_THICKFRAME
BEGIN
CONTROL "计算差值",-1,"Button",WS_VISIBLE|BS_GROUPBOX,3,3,123,63
CONTROL "低地址:",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE,6,15,36,12
CONTROL "高地址:",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE,6,30,36,12
CONTROL "0",IDC_EDT201,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,45,12,45,12,WS_EX_CLIENTEDGE
CONTROL "0",IDC_EDT202,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,45,30,45,12,WS_EX_CLIENTEDGE
CONTROL "+",-1,"Static",WS_CHILDWINDOW|WS_VISIBLE|SS_CENTERIMAGE|SS_CENTER,93,30,9,12
CONTROL "0",IDC_EDT203,"Edit",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,105,30,18,12,WS_EX_CLIENTEDGE
CONTROL "确 定",IDC_BTN201,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,9,48,54,15
CONTROL "关 闭",IDC_BTN205,"Button",WS_CHILDWINDOW|WS_VISIBLE|WS_TABSTOP,66,48,54,15
END
;>>>>>>>>源文件
MANIFEST equ 24
IDD_DLG1 equ 1000
IDC_CBO1 equ 1091
IDC_BTN1 equ 1021
IDC_RBN1 equ 1081
IDC_RBN2 equ 1082
IDC_RBN3 equ 1083
IDC_RBN4 equ 1084
IDC_RBN5 equ 1085
IDC_EDT1 equ 1061
IDC_EDT2 equ 1062
IDC_EDT3 equ 1063
IDC_EDT4 equ 1064
IDC_EDT5 equ 1065
IDC_EDT6 equ 1066
IDC_BTN2 equ 1022
IDC_BTN3 equ 1023
IDC_EDT7 equ 1067
IDC_BTN4 equ 1024
IDC_BTN5 equ 1025
IDC_BTN6 equ 1026
IDC_BTN7 equ 1027
IDC_BTN8 equ 1028
IDC_CBO2 equ 1092
IDC_BTN9 equ 1029
IDC_LSV1 equ 1011
IDC_LSV2 equ 1012
IDC_CHK1 equ 1031
IDC_BTN10 equ 1030
IDD_SUB1 equ 2000
IDC_EDT201 equ 2001
IDC_EDT202 equ 2002
IDC_EDT203 equ 2003
IDC_BTN201 equ 2004
IDC_BTN205 equ 2005
ICO_MAIN equ 2
IDR_XPMANIFEST1 equ 1
L macro @var:VARARG
LOCAL @lbl
.const
@lbl db @var,0
.code
exitm <offset @lbl>
endm
;>>>>>>>>>>>>>>
;主调用程序
;作者残剑-<50325232> 转载请注明原著
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.386
.model flat, stdcall
option casemap :none
include windows.inc
include user32.inc
include gdi32.inc
include kernel32.inc
include comctl32.inc
includelib user32.lib
includelib gdi32.lib
includelib kernel32.lib
includelib comctl32.lib
include comdlg32.inc
includelib comdlg32.lib
include stream.inc
includelib stream.lib
include Shlwapi.inc
includelib Shlwapi.lib ;strstr
include BaseSearch.inc
ID_MENU_JG equ 301
ID_MENU_NAME equ 300
ID_MENU_NOTE equ 302
ID_Timer equ 80
.data?
hWnd0 dd ?
hRichEdit dd ?
hInstanc dd ?
NoMsgCountLvs1 dd ?
NoMsgCountLvs2 dd ?
FileBase dd ?
FileSize1 dd ?
ProhWnd dd ?
DataBuf db 300 dup (?)
szFileName db MAX_PATH dup (?)
hPopMenu dd ?
szIcce INITCOMMONCONTROLSEX <?>
dwNum dd ?
dwLen dd ?
.data
.const
FmtOffsetDis db '%04d',0
FmtSyS db '%X',0
FmtSyS01 db '%08X',0
szFmtHexToDec db '%u',0
FmtLsvSave db '%s|::|%s|::|%s|::|%s|::|%s|::|',0Dh,0Ah,0
FmtSaveCodeAsm db '%s equ %08sh ;%s',0dh,0ah,0
FmtSaveCodeC db '#define %s %08s //%s',0dh,0ah,0
FmtSaveDelphi db 's% = %08s //%s',0dh,0ah,0
szProt db '是否要改变第 %d 行的数据',0
szFilter db 'Text Files(*.ini)',0,'*.ini',0,'All Files(*.*)',0,'*.*',0,0
szDefExt db 'ini',0
szFilter1 db 'Text Files(*.txt)',0,'*.txt',0,'All Files(*.*)',0,'*.*',0,0
szDefExt1 db 'txt',0
szSaveCaption db '请输入文件名',0
szB db '基址搜索器 作者:【残々剑】---->QQ:50325232',0
szA db 0BBh,0F9h,0D6h,0B7h,0CBh,0D1h,0CBh,0F7h,0C6h,0F7h,0A1h,0A1h,0D7h,0F7h,0D5h,0DFh,0A3h,0BAh,0A1h,0BEh,0B2h,0D0h,0A1h,0A9h,0BDh,0A3h,0A1h,0BFh,2Dh,2Dh,2Dh,2Dh,3Eh,51h,51h,0A3h,0BAh,35h,30h,33h,32h,35h,32h,33h,32h,0,0
;>>>>>>右击
szCopyName db '复制名称...',0
szCopyJG db '复制结果...',0
szCopyNote db '复制注释...',0
.code
.if eax
; add dwNum,2
; lea eax,szA
; add eax,dwNum
; invoke lstrcpy,offset szA,eax
; ;先将后面的复制过去
; invoke lstrlen,offset szA ;返回剩余长度
; ;shl eax,1h
; lea ecx,buf01
; add ecx,eax ;指向刚才复制的字符串的末尾
; sub eax,dwLen
; neg eax ;求出剩下的长度 eax==2
; invoke lstrcpyn,ecx,offset szA,eax ;实现开头接到未尾
; mov eax,dwNum
; .if eax >= dwLen ;若当前位置大于长度则重新开始
; xor eax,eax
; mov dwNum,eax
; .endif
; invoke SetWindowText,hWnd,addr buf01
.endif
ListViewAddColumn proc uses ebx esi edi hWin,_hDlgID,_dwColumn,_dwWidth,_lpszHead
local @stLVC:LV_COLUMN
pushad
invoke RtlZeroMemory,addr @stLVC,sizeof LV_COLUMN
mov @stLVC.imask,LVCF_TEXT or LVCF_WIDTH or LVCF_FMT
mov @stLVC.fmt,LVCFMT_LEFT
invoke lstrlen,_lpszHead
mov @stLVC.cchTextMax,20
push _lpszHead
pop @stLVC.pszText
push _dwWidth
pop @stLVC.lx
invoke SendDlgItemMessage,hWin,_hDlgID,LVM_INSERTCOLUMN,_dwColumn,addr @stLVC
popad
ret
ListViewAddColumn endp
ListViewSetItem proc uses ebx esi edi hWin,_hDlgID,_dwItem,_dwSubItem,_lpszText
local @stLVI:LV_ITEM
invoke RtlZeroMemory,addr @stLVI,sizeof LV_ITEM
invoke lstrlen,_lpszText
mov @stLVI.cchTextMax,eax
mov @stLVI.imask,LVIF_TEXT
push _lpszText
pop @stLVI.pszText
push _dwItem
pop @stLVI.iItem
push _dwSubItem
pop @stLVI.iSubItem
.if _dwSubItem == -1
mov @stLVI.iSubItem,0
invoke SendDlgItemMessage,hWin,_hDlgID,LVM_INSERTITEM,NULL,addr @stLVI
.else
invoke SendDlgItemMessage,hWin,_hDlgID,LVM_SETITEM,NULL,addr @stLVI
.endif
ret
ListViewSetItem endp
ListViewClear proc uses ebx esi edi hWin,hDlgID,Flags ;参数1:对话框句柄 参数2:控件ID 参数3:是否删除列 非零时为删除列
pushad
invoke SendDlgItemMessage,hWin,hDlgID,LVM_DELETEALLITEMS,0,0
.if Flags
.while TRUE
invoke SendDlgItemMessage,hWin,hDlgID,LVM_DELETECOLUMN,0,0
.break .if ! eax
.endw
.endif
popad
ret
ListViewClear endp
InitRButton proc uses ebx esi edi
invoke CreatePopupMenu
mov hPopMenu,eax
invoke AppendMenu,hPopMenu,MF_STRING,ID_MENU_JG,addr szCopyJG
invoke AppendMenu,hPopMenu,MF_STRING,ID_MENU_NAME,addr szCopyName
invoke AppendMenu,hPopMenu,MF_STRING,ID_MENU_NOTE,addr szCopyNote
ret
InitRButton endp
HexToDec proc uses ebx esi edi lpString:dword,IstrLen:dword
LOCAL intShu:dword
.if IstrLen <= 4
mov esi,lpString
push esi
cld
xor eax,eax
mov ebx,16
.while TRUE
movzx ecx,byte ptr [esi]
inc esi
.break .if ! ecx
.if ecx != '-'
.if cl > 60h
sub cl,57h
.elseif cl > '9'
sub cl,'A' - 0ah
.else
sub cl,'0'
.endif
mul ebx
add eax,ecx
.endif
mov intShu,eax
.endw
pop ecx
movzx eax,byte ptr [ecx]
.if eax == '-'
not intShu
add intShu,1
.endif
mov eax,intShu
.else
mov eax,-1
.endif
ret
HexToDec endp
StringToHex proc uses ebx esi edi EsiString:dword,StriLen:dword ;字符串到内存数据转换 ->返回字符串的长度
LOCAL @inc,@Cont
invoke RtlZeroMemory,addr DataBuf,sizeof DataBuf
mov @inc,0
xor edx,edx
mov esi,EsiString
lea edi,DataBuf
inc StriLen
mov ebx,StriLen
shr ebx,1
.while ebx
mov dl,byte ptr [esi]
.if dl != 20h
mov ecx,2
@@: mov dl,byte ptr [esi]
.if dl == 2Bh