.data
opf OPENFILENAME
lpStrFilter db "PE Files",0,"*.exe;*.dll",0
db "WDM Files",0,"*.sys",0,0
zTit db "Hume's PE checkSum 计算器,2K2",0
initial_dir db ".",0
ms000 db "File OPERATION ERR!",0
fmt db "The PE-CheckSum of Current file IS:%X",0
buf: rb 256
.code
StArT:
mov [opf.lStructSize],ofn.size
mov [opf.lpstrFile],buf
mov [opf.nMaxFile],256
mov [opf.lpstrFilter],lpStrFilter
mov [opf.lpstrTitle],zTit
mov [opf.lpstrInitialDir],initial_dir
mov [opf.Flags],81000h
invoke GetOpenFileName,opf
or eax,eax
je exit
mov eax,ofn.lpstrFile
invoke CreateFile,[opf.lpstrFile],0x80000000,0,0,3,0,0
inc eax
je err
dec eax
push eax
invoke GetFileSize,eax,0
push eax
push eax
invoke VirtualAlloc,0,eax,1000h,4
or eax,eax
je err
pop ecx
push eax