人生有起有落,奋斗吧 官方网站:www.flameschen.com
分类: WINDOWS
2007-09-25 00:18:42
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\reader] "ErrorControl"=dword:00000000 "ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\ 74,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,72,\ 00,69,00,76,00,65,00,72,00,73,00,5c,00,72,00,65,00,61,00,64,00,65,00,72,00,\ 2e,00,73,00,79,00,73,00,00,00 "Start"=dword:00000001 "Tag"=dword:00000001 "Type"=dword:00000001 |
#include <windows.h> #include "hchange.h" BOOLEAN SetHandleAccess( HANDLE Handle, ACCESS_MASK GrantedAccess ) { HANDLE hDriver; ULONG Bytes; ULONG Buff[2]; BOOLEAN Result = FALSE; hDriver = CreateFile("\\\\.\\haccess", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); if (hDriver != INVALID_HANDLE_VALUE) { Buff[0] = (ULONG)Handle; Buff[1] = GrantedAccess; Result = DeviceIoControl(hDriver, IOCTL1, Buff, sizeof(Buff), NULL, 0, &Bytes, NULL); CloseHandle(hDriver); } return Result; } void main() { HANDLE hFile, hDest; ULONG Size, Bytes; PVOID Data; CHAR Name[MAX_PATH]; lstrcpy(Name, "C:\\Documents and Settings\\Administrator\\Local Settings\\Temp\\fla3.tmp"); hFile = CreateFile(Name, FILE_READ_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); if (hFile != INVALID_HANDLE_VALUE) { if (SetHandleAccess(hFile, AC_GENERIC_READ)) { Size = GetFileSize(hFile, NULL); Data = VirtualAlloc(NULL, Size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); if (Data) { ReadFile(hFile, Data, Size, &Bytes, NULL); hDest = CreateFile("e:\\fla3.tmp", GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, 0); if (hDest != INVALID_HANDLE_VALUE) { WriteFile(hDest, Data, Size, &Bytes, NULL); CloseHandle(hDest); } VirtualFree(Data, 0, MEM_RELEASE); } } CloseHandle(hFile); } } |
#include <winioctl.h> #define BASE_IOCTL (FILE_DEVICE_UNKNOWN << 16) | (FILE_READ_ACCESS << 14) | METHOD_BUFFERED #define IOCTL1 BASE_IOCTL | (1 << 2) #define AC_GENERIC_READ 0x120089 #define AC_GENERIC_WRITE 0x120196 #define AC_DELETE 0x110080 #define AC_READ_CONTROL 0x120080 #define AC_WRITE_DAC 0x140080 #define AC_WRITE_OWNER 0x180080 #define AC_GENERIC_ALL 0x1f01ff #define AC_STANDARD_RIGHTS_ALL 0x1f0080 |