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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1134
call fcn.00476660
mov eax, dword [0x4d8300]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
xor eax, eax
mov dword [ebp - 0x112f], 0xb070604
inc eax
mov word [ebp - 0x112b], 0xe0c
push edi
mov byte [ebp - 0x1130], al
mov ebx, edx
xor eax, eax
mov dword [ebp - 0x1128], ebx
push 0x100
push eax
mov dword [ebp - 0x1124], eax
mov esi, ecx
mov dword [ebp - 0x111c], eax
lea eax, [ebp - 0x108]
push eax
mov byte [ebp - 0x1129], 0xef
call fcn.00478bc0
add esp, 0xc
xor eax, eax
push 0x1000
push eax
lea eax, [ebp - 0x1108]
push eax
call fcn.00478bc0
add esp, 0xc
test ebx, ebx
je 0x406608
xor eax, eax
mov edi, 0x80
push edi
push eax
push 0x522948
mov dword [0x522940], eax
call fcn.00478bc0
add esp, 0xc
xor eax, eax
push edi
push eax
push 0x5229c8
call fcn.00478bc0
add esp, 0xc
xor eax, eax
mov ecx, esi
mov byte [ebx], al
push eax
push eax
push eax
lea edx, [eax + 1]
call fcn.00403d46
mov edi, dword [ebp + 0xc]
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x405e74
push dword [ebp + 8]
xor eax, eax
push dword [ebp - 0x1128]
push eax
push eax
push eax
push eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetVolumeInformationA]
test eax, eax
jne 0x405e85
test edi, edi
jne 0x405e85
push esi
push str.No_volume_information_for_drive_0x_02x
call fcn.0042ed57
pop ecx
pop ecx
push ebx
call fcn.004812c6
xor eax, eax
xor edx, edx
pop ecx
inc eax
mov ecx, esi
push eax
xor eax, eax
push eax
call fcn.00403d18
mov ebx, eax
mov dword [ebp - 0x1114], ebx
pop ecx
pop ecx
cmp ebx, 0xffffffff
je 0x406608
xor ecx, ecx
lea eax, [ebp - 0x1120]
push ecx
push eax
push 0x100
lea eax, [ebp - 0x108]
push eax
push ecx
push ecx
push 0x700a0
push ebx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x4065e5
cmp dword [ebp - 0x1120], 0
jbe 0x4065e5
mov ecx, dword [ebp - 0xf4]
mov eax, dword [ebp - 0xec]
or dword [0x522934], 0xffffffff
mov edx, dword [ebp - 0xf0]
mov dword [ebp - 0x1110], eax
mov dword [0x522920], edx
mov dword [0x522924], eax
mov dword [0x522930], ecx
cmp ecx, 0x200
jae 0x405f4f
test edi, edi
jne 0x405f44
push ecx
push esi
push str.Warning:_Drive_0x_02x_reports_a_sector_size_of__d___Correcting_to_512_bytes.
call fcn.0042ed57
mov eax, dword [0x522924]
add esp, 0xc
mov edx, dword [0x522920]
mov dword [ebp - 0x1110], eax
mov ecx, 0x200
mov dword [0x522930], ecx
mov eax, dword [ebp - 0xf8]
mov dword [0x52292c], eax
mov eax, dword [ebp - 0x100]
mov dword [0x522938], eax
test edi, edi
jne 0x405fc6
push ecx
push ecx
push dword [ebp - 0x1110]
xor eax, eax
xor ecx, ecx
push edx
lea edx, [eax + 1]
call fcn.0042fdeb
add esp, 0xc
mov ecx, str.Removable
cmp dword [0x522938], 0xc
push eax
mov eax, str.FIXED
cmovne eax, ecx
push eax
push str.Disk_type:__s__Disk_size:__s__Sector_size:__d_bytes
call fcn.0042ed57
push dword [ebp - 0xf8]
push dword [ebp - 0xfc]
push dword [ebp - 0x104]
push dword [ebp - 0x108]
push str.Cylinders:__lli__Tracks_per_cylinder:__d__Sectors_per_track:__d
call fcn.0042ed57
add esp, 0x24
xor ecx, ecx
lea eax, [ebp - 0x1120]
push ecx
push eax
push 0x1000
lea eax, [ebp - 0x1108]
push eax
push ecx
push ecx
push 0x70050
push ebx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x4065d3
cmp dword [ebp - 0x1120], 0
jbe 0x4065d3
mov eax, dword [ebp - 0x1108]
xor esi, esi
sub eax, esi
je 0x406254
sub eax, 1
je 0x406032
mov dword [0x52293c], esi
test edi, edi
jne 0x4065c0
push str.Partition_type:_RAW
call fcn.0042ed57
pop ecx
jmp 0x4065c0
xor eax, eax
inc eax
mov dword [0x52293c], eax
test edi, edi
jne 0x40608f
push dword [ebp - 0x1104]
push str.Partition_type:_GPT__NB_Partitions:__d
call fcn.0042ed57
lea ecx, [ebp - 0x1100]
call fcn.0042fd96
push eax
push str.Disk_GUID:__s
call fcn.0042ed57
push dword [ebp - 0x10e4]
push dword [ebp - 0x10e8]
push dword [ebp - 0x10ec]
push dword [ebp - 0x10f0]
push dword [ebp - 0x10e0]
push str.Max_parts:__d__Start_Offset:__lli__Usable___lli_bytes
call fcn.0042ed57
add esp, 0x28
mov edx, esi
mov dword [ebp - 0x1118], edx
cmp dword [ebp - 0x1104], edx
jbe 0x4065c0
lea esi, [ebp - 0x1090]
cmp edx, 0x10
jae 0x4060d6
mov eax, dword [esi - 0x40]
mov ecx, dword [esi - 0x3c]
mov dword [edx*8 + 0x522948], eax
mov eax, dword [esi - 0x38]
mov dword [edx*8 + 0x52294c], ecx
mov ecx, dword [esi - 0x34]
mov dword [edx*8 + 0x5229c8], eax
mov dword [edx*8 + 0x5229cc], ecx
inc dword [0x522940]
push 0x4b5728
push esi
call fcn.00487588
mov ebx, eax
mov dword [ebp - 0x1128], ebx
pop ecx
pop ecx
test edi, edi
jne 0x4061bc
xor eax, eax
mov edi, eax
mov edx, dword [edi*8 + 0x4d8ff0]
lea ecx, [esi - 0x28]
call fcn.0042e248
test eax, eax
jne 0x406116
inc edi
cmp edi, 0x68
jb 0x4060fd
cmp edi, 0x68
jae 0x406124
mov eax, dword [edi*8 + 0x4d8ff4]
jmp 0x40612c
lea ecx, [esi - 0x28]
call fcn.0042fd96
mov ebx, dword [ebp - 0x1128]
mov ecx, 0x4b4dda
push eax
test ebx, ebx
mov eax, str.__UEFI:NTFS_
cmovne eax, ecx
push eax
mov eax, dword [ebp - 0x1118]
inc eax
push eax
push str.Partition__d_s:_r_n__Type:__s
call fcn.0042ed57
mov edi, dword [ebp + 0xc]
xor eax, eax
add esp, 0x10
cmp word [esi], ax
je 0x406171
push esi
push str.__Name:__S
call fcn.0042ed57
pop ecx
pop ecx
xor eax, eax
push dword [esi - 4]
push dword [esi - 8]
push eax
push dword [0x522930]
push dword [esi - 0x3c]
push dword [esi - 0x40]
call fcn.004a2600
push edx
push eax
push dword [esi - 0x34]
xor eax, eax
xor edx, edx
push dword [esi - 0x38]
push dword [esi - 0x34]
lea ecx, [eax + 1]
push dword [esi - 0x38]
call fcn.0042fdeb
pop ecx
pop ecx
push eax
lea ecx, [esi - 0x18]
call fcn.0042fd96
push eax
push str.__ID:__s_r_n__Size:__s___lli_bytes__r_n__Start_Sector:__lli__Attributes:_0x_016llX
call fcn.0042ed57
add esp, 0x24
xor eax, eax
push eax
push dword [0x522930]
push dword [esi - 0x3c]
push dword [esi - 0x40]
call fcn.004a2600
cmp dword [0x522934], eax
jb 0x4061dd
mov dword [0x522934], eax
test ebx, ebx
je 0x406203
lea ecx, [esi - 0x28]
mov edx, 0x4b6310
call fcn.0042e248
test eax, eax
jne 0x406203
mov edx, 0x4b5e40
lea ecx, [esi - 0x28]
call fcn.0042e248
test eax, eax
je 0x406209
dec dword [0x522940]
lea ecx, [esi - 0x28]
mov edx, 0x4b6320
call fcn.0042e248
mov ecx, dword [ebp - 0x1124]
test eax, eax
mov edx, dword [ebp - 0x1118]
push 1
pop eax
cmovne ecx, eax
inc edx
add esi, 0x90
mov dword [ebp - 0x1124], ecx
mov dword [ebp - 0x1118], edx
cmp edx, dword [ebp - 0x1104]
jb 0x4060a9
mov ebx, dword [ebp - 0x1114]
jmp 0x4065c0
mov eax, dword [ebp - 0x1104]
mov dword [0x52293c], esi
test eax, eax
je 0x406280
lea ecx, [ebp - 0x10b8]
cmp byte [ecx], 0
je 0x406275
inc dword [0x522940]
add ecx, 0x90
sub eax, 1
jne 0x40626a
cmp byte [ebp - 0x10b8], 0
mov ecx, 0x4b4dda
je 0x4062bc
mov eax, dword [ebp - 0x10d0]
or eax, dword [ebp - 0x10cc]
jne 0x4062bc
test edi, edi
jne 0x4062b1
push str.Super_Floppy_Disk
push str.Partition_type:_SFD___s__or_unpartitioned
call fcn.0042ed57
pop ecx
pop ecx
xor eax, eax
inc eax
mov dword [ebp - 0x111c], eax
jmp 0x406320
test edi, edi
jne 0x4062d7
push dword [0x522940]
push str.Partition_type:_MBR__NB_Partitions:__d
call fcn.0042ed57
pop ecx
pop ecx
mov ecx, 0x4b4dda
xor eax, eax
mov edx, 0x49464555
cmp dword [ebp - 0x1100], edx
sete al
mov dword [0x522a60], eax
test edi, edi
jne 0x406312
cmp dword [ebp - 0x1100], edx
mov eax, str._UEFI_target_
cmovne eax, ecx
push eax
push dword [ebp - 0x1100]
push str.Disk_ID:_0x_08X__s
call fcn.0042ed57
add esp, 0xc
push edi
mov edx, str.Drive
mov ecx, ebx
call fcn.00405848
pop ecx
mov ecx, esi
mov dword [ebp - 0x1114], ecx
cmp dword [ebp - 0x1104], ecx
jbe 0x4065c0
lea esi, [ebp - 0x10d0]
xor eax, eax
mov edx, eax
mov al, byte [esi + 0x18]
mov dword [ebp - 0x1118], edx
mov byte [ebp - 0x1109], al
test al, al
je 0x4065a7
cmp al, 4
jne 0x406383
cmp dword [ebp - 0x111c], edx
je 0x406417
cmp dword [0x522924], edx
jg 0x4065c0
jl 0x406383
cmp dword [0x522920], 0x1000000
ja 0x4065c0
cmp al, 0xef
jne 0x406417
xor eax, eax
inc eax
push eax
push dword [0x522930]
call fcn.0047b53f
mov dword [ebp - 0x1110], eax
pop ecx
pop ecx
test eax, eax
je 0x40640b
xor eax, eax
push eax
push eax
push dword [esi + 4]
push dword [esi]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x4063ff
xor eax, eax
push eax
lea eax, [ebp - 0x1120]
push eax
push dword [0x522930]
push dword [ebp - 0x1110]
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4063ff
mov eax, dword [ebp - 0x1110]
push 9
add eax, 0x2b
push str.UEFI_NTFS
push eax
call fcn.00487510
add esp, 0xc
neg eax
sbb eax, eax
inc eax
mov dword [ebp - 0x1118], eax
push dword [ebp - 0x1110]
call fcn.004812c6
pop ecx
mov edx, dword [ebp - 0x1118]
mov ecx, dword [ebp - 0x1114]
test edi, edi
jne 0x406444
test edx, edx
mov eax, str.__UEFI:NTFS_
mov edx, 0x4b4dda
cmove eax, edx
push eax
mov eax, dword [ebp - 0x111c]
xor eax, 1
add eax, ecx
push eax
push str.Partition__d_s:
call fcn.0042ed57
add esp, 0xc
mov cl, byte [ebp - 0x1109]
xor eax, eax
cmp cl, byte [ebp + eax - 0x1130]
je 0x40645d
inc eax
cmp eax, 8
jb 0x40644c
jmp 0x406466
xor eax, eax
inc eax
mov dword [ebp - 0x1124], eax
mov edx, dword [ebp - 0x1114]
cmp edx, 0x10
jae 0x40649e
mov ecx, dword [esi + 4]
mov eax, dword [esi]
mov dword [edx*8 + 0x52294c], ecx
mov ecx, dword [esi + 0xc]
mov dword [edx*8 + 0x522948], eax
mov eax, dword [esi + 8]
mov dword [edx*8 + 0x5229cc], ecx
mov cl, byte [ebp - 0x1109]
mov dword [edx*8 + 0x5229c8], eax
test edi, edi
jne 0x40655c
cmp cl, 7
je 0x4064b3
cmp dword [ebp - 0x111c], edi
je 0x4064c6
mov eax, dword [ebp - 0x1128]
cmp byte [eax], 0
je 0x4064c6
mov dword [ebp - 0x1110], eax
jmp 0x4064f2
xor eax, eax
mov edx, 0x8f
cmp byte [eax*8 + 0x4d9330], cl
je 0x4064db
inc eax
cmp eax, edx
jb 0x4064cd
cmp eax, edx
jae 0x4064e8
mov eax, dword [eax*8 + 0x4d9334]
jmp 0x4064be
mov dword [ebp - 0x1110], str.Unknown
cmp byte [esi + 0x19], 0
mov ecx, 0x4b5660
mov eax, 0x4b565c
cmove eax, ecx
push eax
xor eax, eax
push eax
push dword [0x522930]
push dword [esi + 4]
push dword [esi]
call fcn.004a2600
push edx
push eax
push dword [esi + 0xc]
xor eax, eax
xor edx, edx
push dword [esi + 8]
push ecx
push dword [esi + 0xc]
lea ecx, [eax + 1]
push dword [esi + 8]
call fcn.0042fdeb
add esp, 0xc
xor ecx, ecx
cmp dword [ebp - 0x111c], ecx
push eax
movzx eax, byte [ebp - 0x1109]
cmovne eax, ecx
push eax
push dword [ebp - 0x1110]
push str.__Type:__s__0x_02x__r_n__Size:__s___lli_bytes__r_n__Start_Sector:__lli__Boot:__s
call fcn.0042ed57
add esp, 0x24
xor eax, eax
push eax
push dword [0x522930]
push dword [esi + 4]
push dword [esi]
call fcn.004a2600
cmp dword [0x522934], eax
jb 0x40657c
mov dword [0x522934], eax
mov al, byte [ebp - 0x1109]
cmp al, 0xea
je 0x40658f
cmp dword [ebp - 0x1118], 0
je 0x406595
dec dword [0x522940]
mov ecx, dword [ebp - 0x1114]
cmp al, 0xee
jne 0x4065a7
xor eax, eax
inc eax
mov dword [0x522a5c], eax
inc ecx
add esi, 0x90
mov dword [ebp - 0x1114], ecx
cmp ecx, dword [ebp - 0x1104]
jb 0x40633a
test ebx, ebx
je 0x4065cb
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1124]
jmp 0x40660a
test edi, edi
jne 0x4065fd
call fcn.0042fc51
push eax
push esi
push str.Could_not_get_layout_for_drive_0x_02x:__s
jmp 0x4065f5
test edi, edi
jne 0x4065fd
call fcn.0042fc51
push eax
push esi
push str.Could_not_get_geometry_for_drive_0x_02x:__s
call fcn.0042ed57
add esp, 0xc
test ebx, ebx
je 0x406608
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00475c80
leave
ret