204{
212
215 {
217 return 0;
218 }
219
220
228
233 0,
236 {
239 return 0;
240 }
241
242
248 Sector,
254 {
257 return 0;
258 }
259
260
262 {
263 printf(
"Sector 0 seems to be FAT boot sector\n");
264 }
265
267 {
268 printf(
"Sector 0 seems to be NTFS boot sector\n");
269 }
270
272 {
273 printf(
"Sector 0 might be MBR\n");
274 }
275
276 else
277 {
278 printf(
"Sector 0 not recognized\n");
279 }
280
281
289
297 {
300 return 0;
301 }
302
303
309 Sector,
314 {
317 return 0;
318 }
319
320
322 {
323 printf(
"Seems to be a FAT partittion\n");
324 }
325
327 {
328 printf(
"Seems to be a NTFS partition\n");
329 }
330
332 {
333 printf(
"Seems to be MBR\n");
334 }
335
336 else
337 {
338 printf(
"Not recognized\n");
339 }
340
342
343 return 0;
344}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define FILE_SYNCHRONOUS_IO_NONALERT
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define OBJ_CASE_INSENSITIVE
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define FILE_SHARE_DELETE
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
BOOL CheckAgainstFAT(PFATBootSector Sector)
BOOL CheckAgainstMBR(PMASTER_BOOT_RECORD Sector)
#define NT_SUCCESS(_Status)
BOOL CheckAgainstNTFS(PNTFSBootSector Sector)
NTSTATUS NTAPI NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key)