OrglastScainfo SCN_INFO <>
NewScnInfo SCN_INFO <>
PeInfo PE_INFO <>
ExtraData EXTRADATA_INFO <>
.data
szCaption db 'Info',0
szText db '成功完成',0
ScnFlagsDefault dd 0E0000020h
szAbout db ' AddSection 1.0',0dh,0ah
db ' by:moonife',0dh,0ah
db ' QQ:765496322',0dh,0ah
db 'E-mail:moonife@163.com',0
szAboutCaption db 'About',0
szFilter db 'All Files(*.*)',0,'*.*',0,0
szNotPe db '不是PE文件,请重新选择!',0
szNotPeCap db 'Error',0
szNoFile db '请先选择PE文件',0
szScnSize db '请填写字节大小',0
szScnName db '请填写节区名字',0
szData db '请先选择数据文件',0
szFormat db '%lXh',0
;***********************************************************************
.code
;>>>>>>>>>>>>>>>
ErrorReport proc
invoke MessageBox,NULL,offset szText,offset szCaption,MB_ICONERROR or MB_OK
ret
ErrorReport endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_OpenFile proc @lpFileName:dword
local @stOF:OPENFILENAME
invoke RtlZeroMemory,addr @stOF,sizeof @stOF
mov @stOF.lStructSize,sizeof @stOF
push hWinMain
pop @stOF.hwndOwner
mov @stOF.lpstrFilter,offset szFilter
push @lpFileName
pop @stOF.lpstrFile
mov @stOF.nMaxFile,MAX_PATH
mov @stOF.Flags,OFN_FILEMUSTEXIST or OFN_PATHMUSTEXIST
invoke GetOpenFileName,addr @stOF
ret
set path=\masm32\bin;%path%
set include=\masm32\include
ml /c /coff /nologo addsection.asm
rc addsection.rc
set lib=\masm32\lib
link /subsystem:windows /nologo addsection.obj addsection.res
hi,
There are Very few Chinese characters in the source code,
You can use Google to translating.
szText db 'successful completion', 0 ScnFlagsDefault dd 0E0000020h szAbout db 'AddSection 1.0', 0dh, 0ah db 'by: moonife', 0dh, 0ah db 'QQ: 765496322', 0dh, 0ah db 'E-mail: moonife@163.com', 0 szAboutCaption db 'About', 0 szFilter db 'All Files (*.*)', 0 ,'*.*', 0,0 szNotPe db 'is not a PE file, please re-select! ', 0 szNotPeCap db 'Error', 0 szNoFile db 'Please select PE file', 0 szScnSize db 'Please fill in the byte size', 0 szScnName db 'Please fill in the name of section', 0 szData db 'Please select the data file', 0
IDD_DLGMain DIALOGEX 6,5,227,152
CAPTION "MSango"
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX
BEGIN
CONTROL "Destination File",IDC_BDesFile,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,4,9,54,13
CONTROL "",IDC_GRP1,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,-2,0,234,135
CONTROL "",IDC_EDesFile,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,64,9,148,13,WS_EX_CLIENTEDGE
CONTROL "section name:",IDC_GRP2,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,6,42,70,26
CONTROL "",IDC_EScnName,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,8,51,64,13,WS_EX_CLIENTEDGE
CONTROL "Bytes:",IDC_GRP3,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,78,42,62,26
CONTROL "Data File",IDC_BData,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,4,25,54,13
CONTROL "",IDC_EData,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,64,25,148,13,WS_EX_CLIENTEDGE
CONTROL "",IDC_EScnSize,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,82,51,54,13,WS_EX_CLIENTEDGE
CONTROL "write data file",IDC_CHKWrite,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,150,46,66,9
CONTROL "Update entry address",IDC_CHKUpEntry,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,150,59,64,9
CONTROL "PE Info:",IDC_GRP5,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,0,75,104,56
CONTROL "Results Report:",IDC_GRP6,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,112,75,104,56
CONTROL "Entry Point",IDC_STC1,"Static",WS_CHILD|WS_VISIBLE,6,90,40,9
CONTROL "",IDC_EEntry,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,42,88,54,13,WS_EX_CLIENTEDGE
CONTROL "Image Base",IDC_STC2,"Static",WS_CHILD|WS_VISIBLE,6,103,34,9
CONTROL "",IDC_EBase,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,42,101,54,13,WS_EX_CLIENTEDGE
CONTROL "Number Of Sections",IDC_STC3,"Static",WS_CHILD|WS_VISIBLE,6,118,36,9
CONTROL "",IDC_EScnNum,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,42,114,54,13,WS_EX_CLIENTEDGE
CONTROL "Virtual Offset",IDC_STC4,"Static",WS_CHILD|WS_VISIBLE,118,90,36,9
CONTROL "",IDC_EVOffset,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,154,88,54,13,WS_EX_CLIENTEDGE
CONTROL "File Offset",IDC_STC5,"Static",WS_CHILD|WS_VISIBLE,118,103,36,9
CONTROL "",IDC_EFOffset,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,154,101,54,13,WS_EX_CLIENTEDGE
CONTROL "Actual Size",IDC_STC6,"Static",WS_CHILD|WS_VISIBLE,118,116,34,9
CONTROL "",IDC_ERSize,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,154,114,54,13,WS_EX_CLIENTEDGE
CONTROL "About",IDC_BAbout,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,4,136,54,13
CONTROL "Generate",IDC_BMake,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,110,136,54,13
CONTROL "Exit",IDC_BExit,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,168,136,54,13
CONTROL "By:moonife",IDC_STC7,"Static",WS_CHILD|WS_VISIBLE|WS_DISABLED|SS_SUNKEN,62,138,38,9
END