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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1164
call fcn.00492020
mov eax, dword [0x4f22ec]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0x10], 0x7060401
push 0x100
push eax
mov dword [ebp - 0x1120], eax
mov ebx, edx
lea eax, [ebp - 0x110]
mov dword [ebp - 0x113c], ebx
push eax
mov esi, ecx
mov dword [ebp - 0xc], 0xef0e0c0b
mov dword [ebp - 0x1128], 0
call fcn.00493600
add esp, 0xc
lea eax, [ebp - 0x1110]
push 0x1000
push 0
push eax
call fcn.00493600
add esp, 0xc
test ebx, ebx
je 0x407dcc
push 0x80
push 0
push 0x543788
mov dword [0x543780], 0
call fcn.00493600
add esp, 0xc
push 0x80
push 0
push 0x543808
call fcn.00493600
add esp, 0xc
mov byte [ebx], 0
mov edx, 1
mov ecx, esi
push 0
push 0
push 0
call fcn.00404230
mov edi, eax
add esp, 0xc
test edi, edi
je 0x407220
push dword [ebp + 8]
push ebx
push 0
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetVolumeInformationA]
test eax, eax
jne 0x407234
cmp dword [ebp + 0xc], 0
jne 0x407234
push esi
push str.No_volume_information_for_drive_0x_02x
call fcn.004407e0
add esp, 8
push edi
call fcn.004998ec
add esp, 4
xor edx, edx
mov ecx, esi
push 1
push 0
call fcn.00404180
mov edi, eax
add esp, 8
mov dword [ebp - 0x111c], edi
cmp edi, 0xffffffff
je 0x407dcc
mov ebx, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
lea eax, [ebp - 0x1124]
push 0
push eax
push 0x100
lea eax, [ebp - 0x110]
push eax
push 0
push 0
push 0x700a0
push edi
call ebx
test eax, eax
je 0x407da7
cmp dword [ebp - 0x1124], 0
jbe 0x407da7
mov ecx, dword [ebp - 0xfc]
mov edx, dword [ebp - 0xf8]
mov edi, dword [ebp - 0xf4]
mov dword [0x543760], edx
mov dword [0x543764], edi
mov dword [0x543770], ecx
mov dword [0x543774], 0xffffffff
cmp ecx, 0x200
jae 0x4072fc
cmp dword [ebp + 0xc], 0
jne 0x4072f1
push ecx
push esi
push str.Warning:_Drive_0x_02x_reports_a_sector_size_of__d___Correcting_to_512_bytes.
call fcn.004407e0
mov edi, dword [0x543764]
add esp, 0xc
mov edx, dword [0x543760]
mov ecx, 0x200
mov dword [0x543770], ecx
cmp dword [ebp + 0xc], 0
mov eax, dword [ebp - 0x100]
mov dword [0x54376c], eax
mov eax, dword [ebp - 0x108]
mov dword [0x543778], eax
jne 0x407370
push ecx
push ecx
push edi
push edx
mov edx, 1
xor ecx, ecx
call fcn.00440d90
add esp, 0xc
mov ecx, str.Removable
cmp dword [0x543778], 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.004407e0
push dword [ebp - 0x100]
push dword [ebp - 0x104]
push dword [ebp - 0x10c]
push dword [ebp - 0x110]
push str.Cylinders:__lli__Tracks_per_cylinder:__d__Sectors_per_track:__d
call fcn.004407e0
add esp, 0x24
mov edi, dword [ebp - 0x111c]
lea eax, [ebp - 0x1124]
push 0
push eax
push 0x1000
lea eax, [ebp - 0x1110]
push eax
push 0
push 0
push 0x70050
push edi
call ebx
test eax, eax
je 0x407d93
cmp dword [ebp - 0x1124], 0
jbe 0x407d93
mov eax, dword [ebp - 0x1110]
sub eax, 0
je 0x4078fb
sub eax, 1
je 0x4073e6
cmp dword [ebp + 0xc], 0
mov dword [0x54377c], 0
jne 0x407d71
push str.Partition_type:_RAW
call fcn.004407e0
add esp, 4
jmp 0x407d71
mov esi, dword [ebp + 0xc]
mov dword [0x54377c], 1
test esi, esi
jne 0x4074ad
push dword [ebp - 0x110c]
push str.Partition_type:_GPT__NB_Partitions:__d
call fcn.004407e0
movzx eax, byte [ebp - 0x10f9]
push eax
movzx eax, byte [ebp - 0x10fa]
push eax
movzx eax, byte [ebp - 0x10fb]
push eax
movzx eax, byte [ebp - 0x10fc]
push eax
movzx eax, byte [ebp - 0x10fd]
push eax
movzx eax, byte [ebp - 0x10fe]
push eax
movzx eax, byte [ebp - 0x10ff]
push eax
movzx eax, byte [ebp - 0x1100]
push eax
movzx eax, word [ebp - 0x1102]
push eax
movzx eax, word [ebp - 0x1104]
push eax
push dword [ebp - 0x1108]
push str._08X__04X__04X__02X_02X__02X_02X_02X_02X_02X_02X
push 0x53df90
call fcn.00440690
add esp, 0x3c
push 0x53df90
push str.Disk_GUID:__s
call fcn.004407e0
push dword [ebp - 0x10ec]
push dword [ebp - 0x10f0]
push dword [ebp - 0x10f4]
push dword [ebp - 0x10f8]
push dword [ebp - 0x10e8]
push str.Max_parts:__d__Start_Offset:__lli__Usable___lli_bytes
call fcn.004407e0
add esp, 0x20
mov ebx, dword [ebp - 0x110c]
xor edx, edx
mov dword [ebp - 0x1114], edx
test ebx, ebx
je 0x407d71
lea edi, [ebp - 0x10b2]
lea esp, [esp]
cmp edx, 0x10
jae 0x4074fd
mov eax, dword [edi - 0x26]
mov ecx, dword [edi - 0x22]
mov dword [edx*8 + 0x543788], eax
mov eax, dword [edi - 0x1e]
mov dword [edx*8 + 0x54378c], ecx
mov ecx, dword [edi - 0x1a]
mov dword [edx*8 + 0x543808], eax
mov dword [edx*8 + 0x54380c], ecx
inc dword [0x543780]
lea eax, [edi + 0x1a]
mov ecx, 0x4cef74
jmp 0x407510
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40753e
test dx, dx
je 0x407532
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40753e
add eax, 4
add ecx, 4
test dx, dx
jne 0x407510
mov dword [ebp - 0x1118], 0
jmp 0x407549
sbb eax, eax
or eax, 1
mov dword [ebp - 0x1118], eax
test esi, esi
jne 0x4077f5
xor ebx, ebx
lea eax, [edi - 0xe]
test eax, eax
je 0x407591
mov ecx, dword [ebx*8 + 0x4f2f90]
test ecx, ecx
je 0x407591
lea edx, [edi - 0xe]
mov esi, 0xc
lea ecx, [ecx]
mov eax, dword [edx]
cmp eax, dword [ecx]
jne 0x407588
add edx, 4
add ecx, 4
sub esi, 4
jae 0x407570
mov eax, 1
jmp 0x40758a
xor eax, eax
test eax, eax
jne 0x40759d
lea eax, [edi - 0xe]
inc ebx
cmp ebx, 0x68
jb 0x407553
test eax, eax
jne 0x4075ab
jmp 0x4075f6
cmp ebx, 0x68
jae 0x4075ab
mov eax, dword [ebx*8 + 0x4f2f94]
jmp 0x4075f6
movzx eax, byte [edi + 1]
push eax
movzx eax, byte [edi]
push eax
movzx eax, byte [edi - 1]
push eax
movzx eax, byte [edi - 2]
push eax
movzx eax, byte [edi - 3]
push eax
movzx eax, byte [edi - 4]
push eax
movzx eax, byte [edi - 5]
push eax
movzx eax, byte [edi - 6]
push eax
movzx eax, word [edi - 8]
push eax
movzx eax, word [edi - 0xa]
push eax
push dword [edi - 0xe]
push str._08X__04X__04X__02X_02X__02X_02X_02X_02X_02X_02X
push 0x53df90
call fcn.00440690
add esp, 0x34
mov eax, 0x53df90
cmp dword [ebp - 0x1118], 0
mov ecx, 0x4ce59a
push eax
mov eax, str.__UEFI:NTFS_
cmovne eax, ecx
push eax
mov eax, dword [ebp - 0x1114]
inc eax
push eax
push str.Partition__d_s:_r_n__Type:__s
call fcn.004407e0
lea eax, [edi + 0x1a]
add esp, 0x10
cmp word [eax], 0
je 0x407638
push eax
push str.__Name:__S
call fcn.004407e0
add esp, 8
push dword [edi - 0x22]
mov ecx, dword [ebp - 0x111c]
push dword [edi - 0x26]
call fcn.00406d10
push eax
push str.__Detected_File_System:__s
call fcn.004407e0
mov eax, dword [edi - 0x1e]
add esp, 0x10
mov ecx, dword [edi - 0x1a]
mov dword [ebp - 0x10], eax
mov eax, ecx
and ecx, 0x7fffffff
mov dword [ebp - 0x1140], 0
and eax, 0x80000000
mov dword [ebp - 0xc], ecx
fild qword [ebp - 0x10]
mov dword [ebp - 0x113c], eax
xor esi, esi
fild qword [ebp - 0x1140]
fchs
faddp st(1)
fst qword [ebp - 0x1138]
fld qword [0x4ebae8]
fld qword [0x4ebb88]
jmp 0x4076a5
fxch st(2)
fcomi st(2)
ja 0x4076ed
inc esi
fxch st(2)
fmul st(1)
cmp esi, 5
jl 0x4076a3
fstp st(1)
fstp st(1)
fst qword [ebp - 0x1138]
test esi, esi
jne 0x4076f3
push dword [0x4f3d28]
push 0x4ce59a
call fcn.004b9bc0
push eax
push 0x4ce59a
push str._s_d_s__s
push 0x20
push 0x53df70
call fcn.00403820
add esp, 0x1c
jmp 0x40775e
fstp st(1)
fstp st(0)
jmp 0x4076b7
fld st(0)
sub esp, 8
fmul qword [0x4ebb40]
fstp qword [ebp - 0x1148]
fstp qword [esp]
call fcn.004bb6d0
fmul qword [0x4ebb40]
add esp, 8
mov eax, str._s_0.0f_s__s
fsubr qword [ebp - 0x1148]
fld qword [0x4ebb08]
fcompi st(1)
fstp st(0)
ja 0x407731
mov eax, str._s_0.1f_s__s
push dword [esi*4 + 0x4f3d28]
fld qword [ebp - 0x1138]
push 0x4ce59a
sub esp, 8
fstp qword [esp]
push 0x4ce59a
push eax
push 0x20
push 0x53df70
call fcn.00403820
add esp, 0x20
lea ecx, [edi + 2]
mov byte [0x53df8f], 0
test ecx, ecx
jne 0x407770
xor esi, esi
jmp 0x4077bb
movzx eax, byte [edi + 0x11]
push eax
movzx eax, byte [edi + 0x10]
push eax
movzx eax, byte [edi + 0xf]
push eax
movzx eax, byte [edi + 0xe]
push eax
movzx eax, byte [edi + 0xd]
push eax
movzx eax, byte [edi + 0xc]
push eax
movzx eax, byte [edi + 0xb]
push eax
movzx eax, byte [edi + 0xa]
push eax
movzx eax, word [edi + 8]
push eax
movzx eax, word [edi + 6]
push eax
push dword [ecx]
push str._08X__04X__04X__02X_02X__02X_02X_02X_02X_02X_02X
push 0x53df90
call fcn.00440690
add esp, 0x34
mov esi, 0x53df90
push dword [edi + 0x16]
push dword [edi + 0x12]
push 0
push dword [0x543770]
push dword [edi - 0x22]
push dword [edi - 0x26]
call fcn.004b9940
push edx
push eax
push dword [edi - 0x1a]
push dword [edi - 0x1e]
push 0x53df70
push esi
push str.__ID:__s_r_n__Size:__s___lli_bytes__r_n__Start_Sector:__lli__Attributes:_0x_016llX
call fcn.004407e0
mov ebx, dword [ebp - 0x110c]
add esp, 0x24
push 0
push dword [0x543770]
push dword [edi - 0x22]
push dword [edi - 0x26]
call fcn.004b9940
mov ecx, dword [0x543774]
cmp ecx, eax
cmovae ecx, eax
cmp dword [ebp - 0x1118], 0
mov dword [0x543774], ecx
je 0x40788e
lea eax, [edi - 0xe]
test eax, eax
je 0x4078d8
lea ecx, [edi - 0xe]
mov edx, 0x4cfb78
mov esi, 0xc
lea ebx, [ebx]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x407858
add ecx, 4
add edx, 4
sub esi, 4
jae 0x407840
mov eax, 1
jmp 0x40785a
xor eax, eax
test eax, eax
jne 0x40788e
lea ecx, [edi - 0xe]
mov edx, 0x4cf6a8
lea esi, [eax + 0xc]
lea esp, [esp]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x407888
add ecx, 4
add edx, 4
sub esi, 4
jae 0x407870
mov eax, 1
jmp 0x40788a
xor eax, eax
test eax, eax
je 0x40789b
dec dword [0x543780]
lea eax, [edi - 0xe]
test eax, eax
je 0x4078d8
lea ecx, [edi - 0xe]
mov edx, 0x4cfb88
mov esi, 0xc
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x4078c0
add ecx, 4
add edx, 4
sub esi, 4
jae 0x4078a8
mov eax, 1
jmp 0x4078c2
xor eax, eax
mov ecx, dword [ebp - 0x1128]
test eax, eax
mov eax, 1
cmovne ecx, eax
mov dword [ebp - 0x1128], ecx
mov edx, dword [ebp - 0x1114]
add edi, 0x90
mov esi, dword [ebp + 0xc]
inc edx
mov dword [ebp - 0x1114], edx
cmp edx, ebx
jb 0x4074d0
jmp 0x407d6b
mov ecx, dword [ebp - 0x110c]
mov dword [0x54377c], 0
test ecx, ecx
je 0x40792a
lea eax, [ebp - 0x10c0]
cmp byte [eax], 0
je 0x407920
inc dword [0x543780]
add eax, 0x90
sub ecx, 1
jne 0x407915
cmp byte [ebp - 0x10c0], 0
mov esi, 0x4ce59a
je 0x40796a
mov eax, dword [ebp - 0x10d8]
or eax, dword [ebp - 0x10d4]
jne 0x40796a
cmp dword [ebp + 0xc], eax
jne 0x40795d
push str.Super_Floppy_Disk
push str.Partition_type:_SFD___s__or_unpartitioned
call fcn.004407e0
add esp, 8
mov eax, 1
mov dword [ebp - 0x1120], eax
jmp 0x4079d6
mov ebx, dword [ebp + 0xc]
test ebx, ebx
jne 0x4079b0
push dword [0x543780]
push str.Partition_type:_MBR__NB_Partitions:__d
call fcn.004407e0
mov ecx, dword [ebp - 0x1108]
xor eax, eax
cmp ecx, 0x49464555
sete al
mov dword [0x5438a0], eax
mov eax, str._UEFI_target_
cmovne eax, esi
push eax
push ecx
push str.Disk_ID:_0x_08X__s
call fcn.004407e0
add esp, 0x14
jmp 0x4079c4
xor eax, eax
cmp dword [ebp - 0x1108], 0x49464555
sete al
mov dword [0x5438a0], eax
push ebx
mov edx, str.Drive
mov ecx, edi
call fcn.00406230
add esp, 4
xor eax, eax
xor esi, esi
mov dword [ebp - 0x1118], esi
cmp dword [ebp - 0x110c], esi
jbe 0x407d71
lea edi, [ebp - 0x10d8]
mov bl, byte [edi + 0x18]
xor ecx, ecx
mov dword [ebp - 0x1114], ecx
test bl, bl
je 0x407d4c
cmp bl, 4
jne 0x407a37
test eax, eax
je 0x407ac2
cmp dword [0x543764], ecx
jg 0x407d6b
jl 0x407ac2
cmp dword [0x543760], 0x1000000
ja 0x407d6b
jmp 0x407ac2
cmp bl, 0xef
jne 0x407ac2
push 1
push dword [0x543770]
call fcn.0049570f
mov esi, eax
add esp, 8
test esi, esi
je 0x407ab6
push 0
push 0
push dword [edi + 4]
push dword [edi]
push dword [ebp - 0x111c]
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x407aad
push 0
lea eax, [ebp - 0x1124]
push eax
push dword [0x543770]
push esi
push dword [ebp - 0x111c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x407aad
push 9
lea eax, [esi + 0x2b]
push str.UEFI_NTFS
push eax
call fcn.0049f5e0
add esp, 0xc
neg eax
sbb eax, eax
inc eax
mov dword [ebp - 0x1114], eax
push esi
call fcn.004998ec
add esp, 4
mov esi, dword [ebp - 0x1118]
mov ecx, dword [ebp - 0x1114]
mov edx, dword [ebp + 0xc]
test edx, edx
jne 0x407af5
test ecx, ecx
mov eax, str.__UEFI:NTFS_
mov ecx, 0x4ce59a
cmove eax, ecx
push eax
mov eax, dword [ebp - 0x1120]
xor eax, 1
add eax, esi
push eax
push str.Partition__d_s:
call fcn.004407e0
mov edx, dword [ebp + 0xc]
add esp, 0xc
xor eax, eax
cmp bl, byte [ebp + eax - 0x10]
je 0x407b05
inc eax
cmp eax, 8
jb 0x407af7
jmp 0x407b0f
mov dword [ebp - 0x1128], 1
cmp esi, 0x10
jae 0x407b3b
mov eax, dword [edi]
mov ecx, dword [edi + 4]
mov dword [esi*8 + 0x543788], eax
mov eax, dword [edi + 8]
mov dword [esi*8 + 0x54378c], ecx
mov ecx, dword [edi + 0xc]
mov dword [esi*8 + 0x543808], eax
mov dword [esi*8 + 0x54380c], ecx
test edx, edx
jne 0x407d00
mov eax, dword [ebp - 0x1120]
test eax, eax
je 0x407b55
mov dword [ebp - 0x112c], edx
jmp 0x407b64
movzx eax, bl
mov dword [ebp - 0x112c], eax
mov eax, dword [ebp - 0x1120]
cmp bl, 7
je 0x407b6d
test eax, eax
je 0x407b78
mov eax, dword [ebp - 0x113c]
cmp byte [eax], 0
jne 0x407b7f
mov cl, bl
call fcn.00409920
mov ecx, dword [edi + 0xc]
mov dword [ebp - 0x1134], eax
mov eax, dword [edi + 8]
mov dword [ebp - 0x1150], eax
mov eax, ecx
and ecx, 0x7fffffff
mov dword [ebp - 0x1158], 0
and eax, 0x80000000
mov dword [ebp - 0x114c], ecx
fild qword [ebp - 0x1150]
mov dword [ebp - 0x1154], eax
xor esi, esi
fild qword [ebp - 0x1158]
fchs
faddp st(1)
fst qword [ebp - 0x1148]
fld qword [0x4ebae8]
fld qword [0x4ebb88]
jmp 0x407bdc
fxch st(2)
fcomi st(2)
ja 0x407c24
inc esi
fxch st(2)
fmul st(1)
cmp esi, 5
jl 0x407bda
fstp st(1)
fstp st(1)
fst qword [ebp - 0x1148]
test esi, esi
jne 0x407c2a
push dword [0x4f3d28]
push 0x4ce59a
call fcn.004b9bc0
push eax
push 0x4ce59a
push str._s_d_s__s
push 0x20
push 0x53df70
call fcn.00403820
add esp, 0x1c
jmp 0x407c95
fstp st(1)
fstp st(0)
jmp 0x407bee
fld st(0)
sub esp, 8
fmul qword [0x4ebb40]
fstp qword [ebp - 0x1160]
fstp qword [esp]
call fcn.004bb6d0
fmul qword [0x4ebb40]
add esp, 8
mov eax, str._s_0.0f_s__s
fsubr qword [ebp - 0x1160]
fld qword [0x4ebb08]
fcompi st(1)
fstp st(0)
ja 0x407c68
mov eax, str._s_0.1f_s__s
push dword [esi*4 + 0x4f3d28]
fld qword [ebp - 0x1148]
push 0x4ce59a
sub esp, 8
fstp qword [esp]
push 0x4ce59a
push eax
push 0x20
push 0x53df70
call fcn.00403820
add esp, 0x20
cmp byte [edi + 0x19], 0
mov ecx, 0x4cee90
mov eax, 0x4cee8c
mov byte [0x53df8f], 0
cmove eax, ecx
push eax
push 0
push dword [0x543770]
push dword [edi + 4]
push dword [edi]
call fcn.004b9940
mov ecx, dword [ebp - 0x111c]
push edx
push eax
push dword [edi + 0xc]
push dword [edi + 8]
push 0x53df70
push dword [edi + 4]
push dword [edi]
call fcn.00406d10
add esp, 8
push eax
push dword [ebp - 0x112c]
push dword [ebp - 0x1134]
push 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.004407e0
mov esi, dword [ebp - 0x1118]
add esp, 0x28
push 0
push dword [0x543770]
push dword [edi + 4]
push dword [edi]
call fcn.004b9940
mov ecx, dword [0x543774]
cmp ecx, eax
cmovae ecx, eax
mov dword [0x543774], ecx
cmp bl, 0xea
je 0x407d31
cmp dword [ebp - 0x1114], 0
je 0x407d37
dec dword [0x543780]
mov eax, dword [0x54389c]
cmp bl, 0xee
mov ecx, 1
cmove eax, ecx
mov dword [0x54389c], eax
mov eax, dword [ebp - 0x1120]
inc esi
add edi, 0x90
mov dword [ebp - 0x1118], esi
cmp esi, dword [ebp - 0x110c]
jb 0x4079f0
mov edi, dword [ebp - 0x111c]
test edi, edi
je 0x407d7c
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x1128]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00491940
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 0xc], 0
jne 0x407dc1
call fcn.00440bb0
push eax
push esi
push str.Could_not_get_layout_for_drive_0x_02x:__s
jmp 0x407db9
cmp dword [ebp + 0xc], 0
jne 0x407dc1
call fcn.00440bb0
push eax
push esi
push str.Could_not_get_geometry_for_drive_0x_02x:__s
call fcn.004407e0
add esp, 0xc
test edi, edi
je 0x407dcc
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00491940
mov esp, ebp
pop ebp
ret