Function at 0x40d653
Capabilities:
Get disk information
Get disk information via ioctl
Read file on windows

Disassembly:
push ebp
mov eax, 0x118c
mov ebp, esp
push edi
push esi
push ebx
call fcn.00487b00
mov ecx, 0x40
sub esp, eax
lea edi, [ebp - 0x1118]
xor eax, eax
cmp dword [ebp + 0xc], 0
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x1018]
mov ecx, 0x400
mov ebx, dword [ebp + 8]
rep stosd dword es:[edi], eax
mov dword [ebp - 0x1120], 0x7060401
mov dword [ebp - 0x111c], 0xef0e0c0b
je 0x40d7de
xor esi, esi
mov ecx, 0x20
mov dword [0x4e2240], esi
mov esi, 0x4e2248
mov edi, esi
rep stosd dword es:[edi], eax
mov ecx, 0x20
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0xc]
xor edi, edi
mov byte [eax], 0
xor eax, eax
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 1
mov dword [esp + 4], eax
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.00408b0c
mov esi, eax
test eax, eax
jne 0x40d703
cmp dword [ebp + 0x14], 0
jne 0x40d737
mov dword [esp + 4], ebx
mov dword [esp], str.No_volume_information_for_drive_0x_02x
call fcn.0043efa9
jmp 0x40d737
mov eax, dword [ebp + 0x10]
xor ecx, ecx
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], ecx
mov dword [esp + 8], ecx
mov dword [esp + 4], ecx
mov dword [esp], esi
call dword [sym.imp.KERNEL32.DLL_GetVolumeInformationA]
sub esp, 0x20
test eax, eax
je 0x40d6eb
mov dword [esp], esi
call sub.msvcrt.dll_free
xor edx, edx
mov dword [esp + 0xc], 1
mov dword [esp + 8], edx
mov dword [esp + 4], edx
mov dword [esp], ebx
call fcn.00408902
mov edi, eax
cmp eax, 0xffffffff
je 0x40d7de
xor eax, eax
mov dword [esp + 0x14], 0x100
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x1124]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x1118]
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
mov dword [esp + 4], 0x700a0
mov dword [esp], edi
call dword [sym.imp.KERNEL32.DLL_DeviceIoControl]
sub esp, 0x20
test eax, eax
je 0x40d7ad
cmp dword [ebp - 0x1124], 0
jne 0x40d7eb
cmp dword [ebp + 0x14], 0
jne 0x40d7cc
call fcn.0043f53d
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov dword [esp], str.Could_not_get_geometry_for_drive_0x_02x:__s
call fcn.0043efa9
lea eax, [edi - 1]
cmp eax, 0xfffffffd
ja 0x40d7de
mov dword [esp], edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push eax
xor eax, eax
mov dword [ebp - 0x1134], eax
jmp 0x40e18a
mov eax, dword [ebp - 0x1100]
mov edx, dword [ebp - 0x10fc]
mov dword [0x4e2234], 0xffffffff
mov dword [0x4e2220], eax
mov eax, dword [ebp - 0x1104]
mov dword [0x4e2224], edx
mov dword [0x4e2230], eax
cmp eax, 0x1ff
ja 0x40d842
cmp dword [ebp + 0x14], 0
jne 0x40d838
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], str.Warning:_Drive_0x_02x_reports_a_sector_size_of__d___Correcting_to_512_bytes.
call fcn.0043efa9
mov dword [0x4e2230], 0x200
mov eax, dword [ebp - 0x1108]
cmp dword [ebp + 0x14], 0
mov dword [0x4e222c], eax
mov eax, dword [ebp - 0x1110]
mov dword [0x4e2238], eax
jne 0x40d8ef
xor eax, eax
mov esi, dword [0x4e2230]
mov dword [esp + 0xc], 1
mov dword [esp + 8], eax
mov edx, dword [0x4e2224]
mov eax, dword [0x4e2220]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0043f9fb
cmp dword [0x4e2238], 0xc
mov ecx, str.FIXED
mov dword [esp + 0xc], esi
mov edx, eax
mov eax, str.Removable
mov dword [esp], str.Disk_type:__s__Disk_size:__s__Sector_size:__d_bytes
cmove eax, ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
call fcn.0043efa9
mov eax, dword [ebp - 0x1108]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x110c]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x1118]
mov edx, dword [ebp - 0x1114]
mov dword [esp], str.Cylinders:__I64i__Tracks_per_cylinder:__d__Sectors_per_track:__d
mov dword [esp + 4], eax
mov dword [esp + 8], edx
call fcn.0043efa9
lea eax, [ebp - 0x1124]
xor ecx, ecx
xor esi, esi
mov dword [esp], edi
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x1018]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x14], 0x1000
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], esi
mov dword [esp + 8], esi
mov dword [esp + 4], 0x70050
call dword [sym.imp.KERNEL32.DLL_DeviceIoControl]
sub esp, 0x20
test eax, eax
je 0x40d93c
cmp dword [ebp - 0x1124], 0
jne 0x40d95f
cmp dword [ebp + 0x14], 0
jne 0x40d7cc
call fcn.0043f53d
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov dword [esp], str.Could_not_get_layout_for_drive_0x_02x:__s
jmp 0x40d7c7
mov eax, dword [ebp - 0x1018]
test eax, eax
je 0x40d975
dec eax
je 0x40de1a
jmp 0x40e139
xor edx, edx
mov ebx, dword [ebp - 0x1014]
xor eax, eax
xor ecx, ecx
mov dword [0x4e223c], edx
mov edx, dword [0x4e2240]
cmp ebx, eax
je 0x40d9a7
imul esi, eax, 0x90
cmp byte [ebp + esi - 0xfc8], 0
je 0x40d9a4
inc edx
mov cl, 1
inc eax
jmp 0x40d98d
test cl, cl
je 0x40d9b1
mov dword [0x4e2240], edx
cmp byte [ebp - 0xfc8], 0
je 0x40d9f8
cmp dword [ebp - 0xfdc], 0
jne 0x40d9f8
cmp dword [ebp - 0xfe0], 0
jne 0x40d9f8
cmp dword [ebp + 0x14], 0
je 0x40d9e1
mov dword [ebp - 0x1148], 1
jmp 0x40da74
mov eax, dword [str.Super_Floppy_Disk]
mov dword [esp], str.Partition_type:_SFD___s__or_unpartitioned
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x40d9d2
cmp dword [ebp + 0x14], 0
jne 0x40da13
mov eax, dword [0x4e2240]
mov dword [esp], str.Partition_type:_MBR__NB_Partitions:__d
mov dword [esp + 4], eax
call fcn.0043efa9
mov eax, dword [ebp - 0x1010]
xor edx, edx
cmp eax, 0x49464555
sete dl
cmp dword [ebp + 0x14], 0
mov dword [0x4e2360], edx
jne 0x40da55
cmp eax, 0x49464555
mov edx, 0x498840
mov ecx, str._UEFI_target_
mov dword [esp + 4], eax
cmove edx, ecx
mov dword [esp], str.Disk_ID:_0x_08X__s
mov dword [esp + 8], edx
call fcn.0043efa9
mov eax, dword [ebp + 0x14]
mov dword [esp + 4], 0x499713
mov dword [esp], edi
mov dword [esp + 8], eax
call fcn.0040adbb
xor eax, eax
mov dword [ebp - 0x1148], eax
xor eax, eax
lea ebx, [ebp - 0x1018]
mov dword [ebp - 0x1130], eax
mov dword [ebp - 0x1134], eax
mov eax, dword [ebp - 0x1130]
cmp eax, dword [ebp - 0x1014]
jae 0x40e15f
mov al, byte [ebx + 0x50]
mov byte [ebp - 0x112c], al
test al, al
je 0x40de09
cmp al, 4
jne 0x40dad9
cmp dword [ebp - 0x1148], 0
je 0x40dad9
mov eax, 0x1000000
cmp eax, dword [0x4e2220]
mov eax, 0
sbb eax, dword [0x4e2224]
jge 0x40e173
jmp 0x40e15f
cmp byte [ebp - 0x112c], 0xef
jne 0x40e173
mov dword [esp + 4], 1
mov eax, dword [0x4e2230]
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov esi, eax
test eax, eax
je 0x40e173
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], eax
imul eax, dword [ebp - 0x1130], 0x90
mov edx, dword [ebp + eax - 0xfdc]
mov eax, dword [ebp + eax - 0xfe0]
mov dword [esp], edi
mov dword [esp + 4], eax
mov dword [esp + 8], edx
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
sub esp, 0x14
test eax, eax
jne 0x40db49
xor eax, eax
mov dword [ebp - 0x1140], eax
jmp 0x40db9f
xor eax, eax
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x1124]
mov dword [esp + 0xc], eax
mov eax, dword [0x4e2230]
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.DLL_ReadFile]
sub esp, 0x14
test eax, eax
je 0x40db3f
lea eax, [esi + 0x2b]
mov dword [esp + 8], 9
mov dword [esp + 4], str.UEFI_NTFS
mov dword [esp], eax
call sub.msvcrt.dll_strncmp
test eax, eax
sete al
movzx eax, al
mov dword [ebp - 0x1140], eax
mov dword [esp], esi
call sub.msvcrt.dll_free
cmp dword [ebp + 0x14], 0
jne 0x40dbed
cmp dword [ebp - 0x1140], 0
mov eax, str.__UEFI:NTFS_
jne 0x40dbc8
xor esi, esi
mov eax, 0x498840
mov dword [ebp - 0x1140], esi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x1148]
mov esi, dword [ebp - 0x1130]
mov dword [esp], str.Partition__d_s:
xor eax, 1
add eax, esi
mov dword [esp + 4], eax
call fcn.0043efa9
xor eax, eax
mov dl, byte [ebp - 0x112c]
cmp dl, byte [eax + ebp - 0x1120]
je 0x40dc06
inc eax
cmp eax, 8
jne 0x40dbef
jmp 0x40dc10
mov dword [ebp - 0x1134], 1
mov eax, dword [ebx + 0x38]
mov edx, dword [ebx + 0x3c]
cmp dword [ebp - 0x1130], 0xf
mov dword [ebp - 0x1150], eax
mov dword [ebp - 0x114c], edx
ja 0x40dc61
mov eax, dword [ebp - 0x1130]
mov edx, dword [ebp - 0x1150]
mov ecx, dword [ebp - 0x114c]
mov dword [eax*8 + 0x4e2248], edx
mov esi, eax
mov edx, dword [ebx + 0x44]
mov dword [eax*8 + 0x4e224c], ecx
mov eax, dword [ebx + 0x40]
mov dword [esi*8 + 0x4e22cc], edx
mov dword [esi*8 + 0x4e22c8], eax
cmp dword [ebp + 0x14], 0
jne 0x40ddad
cmp byte [ebx + 0x51], 0
mov eax, dword [0x4e2230]
mov ecx, 0x499593
mov esi, 0x499597
cmovne esi, ecx
xor edx, edx
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov eax, dword [ebp - 0x1150]
mov edx, dword [ebp - 0x114c]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00487b30
xor ecx, ecx
mov dword [ebp - 0x1158], eax
mov eax, dword [ebx + 0x40]
mov dword [ebp - 0x1154], edx
mov edx, dword [ebx + 0x44]
mov dword [ebp - 0x1150], eax
mov dword [ebp - 0x114c], edx
mov dword [esp + 0xc], ecx
mov dword [esp + 4], edx
mov dword [esp + 8], 1
mov dword [esp], eax
call fcn.0043f9fb
mov dword [ebp - 0x1138], eax
imul eax, dword [ebp - 0x1130], 0x90
mov edx, dword [ebp + eax - 0xfdc]
mov eax, dword [ebp + eax - 0xfe0]
mov dword [esp], edi
mov dword [esp + 4], eax
mov dword [esp + 8], edx
call fcn.0040b073
xor ecx, ecx
cmp dword [ebp - 0x1148], 0
mov dword [ebp - 0x115c], eax
mov al, byte [ebp - 0x112c]
cmove ecx, eax
cmp byte [ebp - 0x112c], 7
movzx eax, cl
mov dword [ebp - 0x1160], eax
je 0x40dd3c
cmp dword [ebp - 0x1148], 0
je 0x40dd44
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0
jne 0x40dd53
movzx eax, byte [ebp - 0x112c]
mov dword [esp], eax
call fcn.0040d5e0
mov dword [esp + 0x24], esi
mov edx, dword [ebp - 0x1158]
mov ecx, dword [ebp - 0x1154]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], ecx
mov ecx, dword [ebp - 0x114c]
mov edx, dword [ebp - 0x1150]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], edx
mov esi, dword [ebp - 0x1138]
mov dword [esp + 0x10], esi
mov ecx, dword [ebp - 0x115c]
mov dword [esp + 0xc], ecx
mov esi, dword [ebp - 0x1160]
mov dword [esp + 4], eax
mov dword [esp + 8], esi
mov dword [esp], str.__Type:__s__0x_02x__r_n__Detected_File_System:__s_r_n__Size:__s___lld_bytes__r_n__Start_Sector:__lld__Boot:__s
call fcn.0043efa9
mov eax, dword [0x4e2230]
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 0x38]
mov edx, dword [ebx + 0x3c]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00487b30
mov edx, dword [0x4e2234]
cmp edx, eax
cmovbe eax, edx
cmp byte [ebp - 0x112c], 0xea
mov dword [0x4e2234], eax
je 0x40ddf0
cmp dword [ebp - 0x1140], 0
je 0x40ddf6
dec dword [0x4e2240]
cmp byte [ebp - 0x112c], 0xee
jne 0x40de09
mov dword [0x4e235c], 1
inc dword [ebp - 0x1130]
add ebx, 0x90
jmp 0x40da88
mov dword [0x4e223c], 1
cmp dword [ebp + 0x14], 0
jne 0x40dea4
mov eax, dword [ebp - 0x1014]
mov dword [esp], str.Partition_type:_GPT__NB_Partitions:__d
mov dword [esp + 4], eax
call fcn.0043efa9
lea eax, [ebp - 0x1010]
mov dword [esp + 4], 1
mov dword [esp], eax
call fcn.0043f8b4
mov dword [esp], str.Disk_GUID:__s
mov dword [esp + 4], eax
call fcn.0043efa9
mov eax, dword [ebp - 0xff8]
mov edx, dword [ebp - 0xff4]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
mov eax, dword [ebp - 0x1000]
mov edx, dword [ebp - 0xffc]
mov dword [esp + 8], eax
mov dword [esp + 0xc], edx
mov eax, dword [ebp - 0xff0]
mov dword [esp], str.Max_parts:__d__Start_Offset:__I64i__Usable___I64i_bytes
mov dword [esp + 4], eax
call fcn.0043efa9
xor eax, eax
lea ebx, [ebp - 0xfa0]
xor esi, esi
mov dword [ebp - 0x1134], eax
cmp esi, dword [ebp - 0x1014]
jae 0x40e15f
cmp esi, 0xf
ja 0x40deed
mov eax, dword [ebx - 0x40]
mov edx, dword [ebx - 0x3c]
mov dword [esi*8 + 0x4e2248], eax
mov eax, dword [ebx - 0x38]
mov dword [esi*8 + 0x4e224c], edx
mov edx, dword [ebx - 0x34]
mov dword [esi*8 + 0x4e22c8], eax
mov dword [esi*8 + 0x4e22cc], edx
inc dword [0x4e2240]
mov dword [esp + 4], 0x499318
mov dword [esp], ebx
call sub.msvcrt.dll_wcscmp
cmp dword [ebp + 0x14], 0
mov dword [ebp - 0x1130], eax
lea eax, [ebx - 0x28]
mov dword [ebp - 0x112c], eax
jne 0x40df51
mov dword [esp], eax
call fcn.0040d609
cmp dword [ebp - 0x1130], 0
mov ecx, str.__UEFI:NTFS_
mov dword [esp], str.Partition__d_s:_r_n__Type:__s
mov edx, eax
mov eax, 0x498840
cmove eax, ecx
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
lea eax, [esi + 1]
mov dword [esp + 4], eax
call fcn.0043efa9
cmp word [ebx], 0
je 0x40df73
cmp dword [ebp + 0x14], 0
jne 0x40e08d
mov dword [esp + 4], ebx
mov dword [esp], str.__Name:__S
call fcn.0043efa9
jmp 0x40df7d
cmp dword [ebp + 0x14], 0
jne 0x40e08d
imul ecx, esi, 0x90
mov edx, dword [ebp + ecx - 0xfdc]
mov eax, dword [ebp + ecx - 0xfe0]
mov dword [ebp - 0x1158], ecx
mov dword [esp], edi
mov dword [esp + 8], edx
mov dword [esp + 4], eax
call fcn.0040b073
mov dword [esp], str.__Detected_File_System:__s
mov dword [esp + 4], eax
call fcn.0043efa9
mov eax, dword [ebx - 8]
mov edx, dword [ebx - 4]
mov dword [ebp - 0x1140], eax
mov eax, dword [0x4e2230]
mov dword [ebp - 0x113c], edx
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 0xc], eax
mov eax, dword [ebx - 0x40]
mov edx, dword [ebx - 0x3c]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00487b30
mov dword [ebp - 0x1148], eax
xor eax, eax
mov dword [ebp - 0x1144], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov edx, dword [ebx - 0x34]
mov eax, dword [ebx - 0x38]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0043f9fb
mov dword [ebp - 0x1150], eax
lea eax, [ebx - 0x18]
mov dword [esp + 4], 1
mov dword [esp], eax
call fcn.0043f8b4
mov edx, dword [ebp - 0x1140]
mov ecx, dword [ebp - 0x113c]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], ecx
mov edx, dword [ebp - 0x1148]
mov ecx, dword [ebp - 0x1144]
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ecx
mov ecx, dword [ebp - 0x1158]
mov edx, dword [ebp + ecx - 0xfd8]
mov ecx, dword [ebp + ecx - 0xfd4]
mov dword [esp + 0xc], edx
mov dword [esp + 0x10], ecx
mov edx, dword [ebp - 0x1150]
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov dword [esp], str.__ID:__s_r_n__Size:__s___I64i_bytes__r_n__Start_Sector:__I64i__Attributes:_0x_016I64X
call fcn.0043efa9
mov eax, dword [0x4e2230]
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 0xc], eax
mov eax, dword [ebx - 0x40]
mov edx, dword [ebx - 0x3c]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00487b30
mov edx, dword [0x4e2234]
cmp edx, eax
cmovbe eax, edx
cmp dword [ebp - 0x1130], 0
mov dword [0x4e2234], eax
jne 0x40e0cf
dec dword [0x4e2240]
jmp 0x40e103
mov dword [esp + 4], 0x4cabec
mov eax, dword [ebp - 0x112c]
mov dword [esp], eax
call fcn.0043e378
test eax, eax
jne 0x40e0c7
mov dword [esp + 4], 0x4caa3c
mov eax, dword [ebp - 0x112c]
mov dword [esp], eax
call fcn.0043e378
test eax, eax
jne 0x40e0c7
mov dword [esp + 4], 0x4cabac
mov eax, dword [ebp - 0x112c]
mov dword [esp], eax
call fcn.0043e378
test eax, eax
mov eax, 1
cmove eax, dword [ebp - 0x1134]
inc esi
add ebx, 0x90
mov dword [ebp - 0x1134], eax
jmp 0x40deb4
xor ebx, ebx
cmp dword [ebp + 0x14], 0
mov dword [0x4e223c], ebx
je 0x40e151
xor ecx, ecx
mov dword [ebp - 0x1134], ecx
jmp 0x40e15f
mov dword [esp], str.Partition_type:_RAW
call fcn.0043efa9
jmp 0x40e147
lea eax, [edi - 1]
cmp eax, 0xfffffffd
ja 0x40e18a
mov dword [esp], edi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push edx
jmp 0x40e18a
cmp dword [ebp + 0x14], 0
je 0x40dbbb
xor eax, eax
mov dword [ebp - 0x1140], eax
jmp 0x40dbed
mov eax, dword [ebp - 0x1134]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret