Уроки Iczelion'а


buy generic cialis online

Пpимеp - часть 2


VXD_PAGEABLE_DATA_SEG MID struct midInfoLevel dw 0 midSerialNum dd ? midVolLabel db 11 dup(?) midFileSysType db 8 dup(?) MID ends MediaID MID <> Handle dd ? AllocSize dd ? VXD_PAGEABLE_DATA_ENDS

end

;------------------------------------------------------------ ; Label.asm ; The win32 VxD loader. ;------------------------------------------------------------ .386 .model flat,stdcall option casemap:none

include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib

DlgProc PROTO :DWORD,:DWORD,:DWORD,:DWORD .data Failure db "Cannot load VxDLabel.VXD",0 AppName db "Get Disk Label",0 VxDName db "\\.\vxdLabel.vxd",0 OutputTemplate db "Volume Label of Drive C",0

.data? hInstance HINSTANCE ? hVxD dd ? DiskLabel db 12 dup(?) BytesReturned dd ?

.const IDD_VXDRUN equ 101 IDC_LOAD equ 1000

.code start: invoke GetModuleHandle, NULL mov hInstance,eax invoke DialogBoxParam, hInstance, IDD_VXDRUN ,NULL,addr DlgProc,NULL

invoke ExitProcess,eax

DlgProc proc hDlg:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM .IF uMsg==WM_INITDIALOG invoke CreateFile,addr VxDName,0,0,0,0,FILE_FLAG_DELETE_ON_CLOSE,0 .if eax==INVALID_HANDLE_VALUE invoke MessageBox,hDlg,addr Failure,addr AppName,MB_OK+MB_ICONERROR mov hVxD,0 invoke EndDialog,hDlg,NULL .else mov hVxD,eax .endif .elseif uMsg==WM_CLOSE .if hVxD!=0 invoke CloseHandle,hVxD .endif invoke EndDialog,hDlg,0 .ELSEIF uMsg==WM_COMMAND mov eax,wParam mov edx,wParam shr edx,16 .if dx==BN_CLICKED .IF ax==IDC_LOAD invoke DeviceIoControl,hVxD,1,NULL,0,addr DiskLabel,12,\ addr BytesReturned,NULL invoke MessageBox,hDlg,addr DiskLabel,addr OutputTemplate, \ MB_OK+MB_ICONINFORMATION .endif .endif .ELSE mov eax,FALSE ret .ENDIF mov eax,TRUE ret DlgProc endp end start




Содержание  Назад  Вперед