Function at 0x4085e0
Capabilities:
Get disk information
Get disk size
Get storage device properties
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c4
mov eax, dword [0x43d004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x43e360]
push ebx
push esi
push edi
mov dword [ebp - 0x2a8], eax
mov edi, 0x41
lea eax, [ebp - 0x298]
mov dword [ebp - 0x2b0], 0
push eax
push 1
push 0
push str.SYSTEMCurrentControlSetServicesdiskEnum
push 0x80000002
mov dword [ebp - 0x2ac], 0xffffffff
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov esi, eax
push esi
push str.SYSTEMCurrentControlSetServicesdiskEnum
push str.RegOpenKeyExA___s__Ret:_ld
call fcn.0040f530
add esp, 0xc
test esi, esi
jne 0x4086dd
lea eax, [ebp - 0x2a4]
mov dword [ebp - 0x2a4], 4
push eax
lea eax, [ebp - 0x2a0]
push eax
lea eax, [ebp - 0x2c4]
push eax
push esi
push str.Count
push dword [ebp - 0x298]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 0x2a0]
push dword [ebp - 0x2a4]
push eax
push str.Count
push str.RegQueryValueExA___s__ret:_u__Size:_u_Value:_u
call fcn.0040f530
mov ebx, dword [ebp - 0x2a0]
add esp, 0x14
push dword [ebp - 0x298]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ebx
push str.GetPhysicalDriveCount:__d
call fcn.0040f530
add esp, 8
xor eax, eax
test ebx, ebx
jle 0x4086ef
cmp eax, 0x80
jge 0x4086ef
mov dword [ebp + eax*4 - 0x288], eax
inc eax
cmp eax, ebx
jl 0x4086c8
jmp 0x4086ef
xor eax, eax
mov ebx, eax
push ebx
push str.GetPhysicalDriveCount:__d
call fcn.0040f530
add esp, 8
call dword [sym.imp.KERNEL32.dll_GetLogicalDrives]
push eax
push str.Logical_Drives:_0x_x
mov dword [ebp - 0x29c], eax
call fcn.0040f530
mov eax, dword [ebp - 0x29c]
add esp, 8
test eax, eax
je 0x40877b
test al, 1
je 0x408770
xor edx, edx
mov ecx, edi
call fcn.00408490
mov esi, eax
push esi
push edi
push str._C______d
call fcn.0040f530
add esp, 0xc
test esi, esi
js 0x40876a
xor ecx, ecx
test ebx, ebx
jle 0x408754
nop dword [eax + eax]
cmp dword [ebp + ecx*4 - 0x288], esi
je 0x408750
inc ecx
cmp ecx, ebx
jl 0x408740
jmp 0x408754
cmp ecx, ebx
jl 0x40876a
push ecx
push str.Add_phy_d_to_list
call fcn.0040f530
add esp, 8
mov dword [ebp + ebx*4 - 0x288], esi
inc ebx
mov eax, dword [ebp - 0x29c]
inc edi
shr eax, 1
mov dword [ebp - 0x29c], eax
jne 0x408713
xor edi, edi
mov dword [ebp - 0x2a4], edi
test ebx, ebx
jle 0x408db1
mov esi, dword [ebp - 0x2a8]
add esi, 0x20
mov dword [ebp - 0x298], esi
nop word [eax + eax]
mov eax, dword [ebp - 0x2b0]
cmp eax, 0x80
jae 0x408c2d
mov eax, dword [ebp - 0x2ac]
cmp eax, 0xffffffff
je 0x4087c3
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp + edi*4 - 0x288]
lea eax, [ebp - 0x88]
push str..PhysicalDrive_d
push 0x80
push eax
call fcn.00401010
add esp, 0x10
lea eax, [ebp - 0x88]
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x2ac], edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x88]
push eax
push edi
push str.Create_file_Handle:_p__s_status:_u
call fcn.0040f530
add esp, 0x10
cmp edi, 0xffffffff
je 0x408c12
push 0
lea eax, [ebp - 0x29c]
push eax
push 8
lea eax, [ebp - 0x2b8]
push eax
push 0
push 0
push 0x7405c
push edi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x40886b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DeviceIoControl_IOCTL_DISK_GET_LENGTH_INFO_failed_error:_u
call fcn.0040f530
add esp, 8
jmp 0x408c12
push dword [ebp - 0x2b4]
push dword [ebp - 0x2b8]
push dword [ebp - 0x2a4]
push str.PHYSICALDRIVE_d_size__llu_bytes
call fcn.0040f530
add esp, 0x10
mov dword [ebp - 0x294], 0
lea eax, [ebp - 0x29c]
mov dword [ebp - 0x290], 0
push 0
push eax
push 8
lea eax, [ebp - 0x2c0]
push eax
push 0xc
lea eax, [ebp - 0x294]
push eax
push 0x2d1400
push edi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x4088e8
push dword [ebp - 0x29c]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DeviceIoControl1_error:_u_dwBytes:_u
call fcn.0040f530
add esp, 0xc
jmp 0x408c12
mov eax, dword [ebp - 0x2bc]
push eax
cmp eax, 0x28
jae 0x408906
push str.Invalid_DevDescHeader.Size:_u
call fcn.0040f530
add esp, 8
jmp 0x408c12
call fcn.0041c36a
mov edi, eax
add esp, 4
mov dword [ebp - 0x2a0], edi
test edi, edi
jne 0x408939
push dword [ebp - 0x2bc]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.failed_to_malloc_error:_u_len:_u
call fcn.0040f530
add esp, 0xc
jmp 0x408c12
push 0
lea eax, [ebp - 0x29c]
push eax
push dword [ebp - 0x2bc]
lea eax, [ebp - 0x294]
push edi
push 0xc
push eax
push 0x2d1400
push dword [ebp - 0x2ac]
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x40898f
push dword [ebp - 0x29c]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DeviceIoControl2_error:_u_dwBytes:_u
call fcn.0040f530
add esp, 0xc
push edi
call fcn.0041bffb
add esp, 4
jmp 0x408c12
mov eax, dword [ebp - 0x2a4]
mov ecx, dword [ebp - 0x2b4]
mov dword [esi - 0x1c], eax
mov eax, dword [ebp - 0x2b8]
mov dword [esi - 0x10], eax
mov dword [esi - 0xc], ecx
mov al, byte [edi + 8]
mov byte [esi - 8], al
movzx eax, byte [edi + 0xa]
mov dword [esi - 4], eax
mov eax, dword [edi + 0x1c]
mov dword [esi + 0x200], eax
mov eax, dword [edi + 0xc]
test eax, eax
je 0x408a50
add eax, edi
push eax
push 0x80
push esi
call fcn.0041c016
mov ecx, dword [ebp - 0x298]
add esp, 0xc
mov edx, esi
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4089e7
sub ecx, edi
je 0x408a20
dec ecx
mov edi, 1
add ecx, dword [ebp - 0x298]
sub edi, dword [ebp - 0x298]
mov al, byte [ecx]
cmp al, 0x20
je 0x408a0e
cmp al, 9
jne 0x408a20
mov byte [ecx], 0
dec ecx
lea eax, [edi + ecx]
test eax, eax
jne 0x408a04
nop dword [eax]
mov al, byte [edx]
cmp al, 0x20
je 0x408a2a
cmp al, 9
jne 0x408a2d
inc edx
jmp 0x408a20
test al, al
je 0x408a41
sub edx, dword [ebp - 0x298]
mov byte [esi], al
inc esi
mov al, byte [edx + esi]
test al, al
jne 0x408a37
mov edi, dword [ebp - 0x2a0]
mov byte [esi], 0
mov esi, dword [ebp - 0x298]
mov eax, dword [edi + 0x10]
test eax, eax
je 0x408acb
add eax, edi
sub esi, 0xffffff80
push eax
push 0x80
push esi
call fcn.0041c016
mov ecx, esi
add esp, 0xc
mov edx, esi
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408a76
sub ecx, edi
je 0x408aa5
dec ecx
mov edi, 1
add ecx, esi
sub edi, esi
nop dword [eax + eax]
mov al, byte [ecx]
cmp al, 0x20
je 0x408a9a
cmp al, 9
jne 0x408aa5
mov byte [ecx], 0
dec ecx
lea eax, [edi + ecx]
test eax, eax
jne 0x408a90
mov al, byte [edx]
cmp al, 0x20
je 0x408aaf
cmp al, 9
jne 0x408ab2
inc edx
jmp 0x408aa5
test al, al
je 0x408ac2
sub edx, esi
mov byte [esi], al
inc esi
mov al, byte [edx + esi]
test al, al
jne 0x408ab8
mov edi, dword [ebp - 0x2a0]
mov byte [esi], 0
mov eax, dword [edi + 0x14]
test eax, eax
je 0x408b56
mov esi, dword [ebp - 0x298]
add eax, edi
push eax
add esi, 0x100
push 0x80
push esi
call fcn.0041c016
mov ecx, esi
add esp, 0xc
mov edx, esi
lea edi, [ecx + 1]
nop word [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408b00
sub ecx, edi
je 0x408b30
dec ecx
mov edi, 1
add ecx, esi
sub edi, esi
mov al, byte [ecx]
cmp al, 0x20
je 0x408b1f
cmp al, 9
jne 0x408b30
mov byte [ecx], 0
dec ecx
lea eax, [edi + ecx]
test eax, eax
jne 0x408b15
nop word [eax + eax]
mov al, byte [edx]
cmp al, 0x20
je 0x408b3a
cmp al, 9
jne 0x408b3d
inc edx
jmp 0x408b30
test al, al
je 0x408b4d
sub edx, esi
mov byte [esi], al
inc esi
mov al, byte [edx + esi]
test al, al
jne 0x408b43
mov edi, dword [ebp - 0x2a0]
mov byte [esi], 0
mov eax, dword [edi + 0x18]
test eax, eax
je 0x408bdb
mov esi, dword [ebp - 0x298]
add eax, edi
push eax
add esi, 0x180
push 0x80
push esi
call fcn.0041c016
mov ecx, esi
add esp, 0xc
mov edx, esi
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x408b85
sub ecx, edi
je 0x408bb5
dec ecx
mov edi, 1
add ecx, esi
sub edi, esi
nop word [eax + eax]
mov al, byte [ecx]
cmp al, 0x20
je 0x408baa
cmp al, 9
jne 0x408bb5
mov byte [ecx], 0
dec ecx
lea eax, [edi + ecx]
test eax, eax
jne 0x408ba0
mov al, byte [edx]
cmp al, 0x20
je 0x408bbf
cmp al, 9
jne 0x408bc2
inc edx
jmp 0x408bb5
test al, al
je 0x408bd2
sub edx, esi
mov byte [esi], al
inc esi
mov al, byte [edx + esi]
test al, al
jne 0x408bc8
mov edi, dword [ebp - 0x2a0]
mov byte [esi], 0
mov esi, dword [ebp - 0x298]
inc dword [ebp - 0x2b0]
add esi, 0x4920
push edi
mov dword [ebp - 0x298], esi
call fcn.0041bffb
add esp, 4
push dword [ebp - 0x2ac]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x2ac], 0xffffffff
mov edi, dword [ebp - 0x2a4]
inc edi
mov dword [ebp - 0x2a4], edi
cmp edi, ebx
jl 0x4087a0
mov eax, dword [ebp - 0x2b0]
test eax, eax
jle 0x408db3
mov edi, dword [ebp - 0x2a8]
add edi, 0xa0
mov dword [ebp - 0x2a8], eax
nop word [eax + eax]
mov ebx, dword [edi - 0x90]
mov esi, 1
mov edx, dword [edi - 0x8c]
mov ecx, ebx
call fcn.0042c390
movaps xmm2, xmm0
mov eax, ebx
movsd xmm0, qword [0x43b198]
and eax, 0x3fffffff
or eax, 0
divsd xmm2, xmm0
divsd xmm2, xmm0
divsd xmm2, xmm0
jne 0x408c9b
mov edx, dword [edi - 0x8c]
mov esi, ebx
mov eax, edx
shrd esi, eax, 0x1e
jmp 0x408ce2
xor eax, eax
nop dword [eax]
movd xmm1, esi
cvtdq2pd xmm1, xmm1
comisd xmm1, xmm2
jbe 0x408cb7
movaps xmm0, xmm1
subsd xmm0, xmm2
jmp 0x408cbe
movaps xmm0, xmm2
subsd xmm0, xmm1
divsd xmm0, xmm1
movsd xmm1, qword [0x43b130]
comisd xmm1, xmm0
ja 0x408cdc
inc eax
add esi, esi
cmp eax, 0xc
jl 0x408ca0
cvttsd2si esi, xmm2
mov edx, dword [edi - 0x8c]
mov eax, dword [edi + 0x180]
cmp eax, 0x11
ja case.0x408cf1.0
jmp dword [eax*4 + 0x408dcc]
mov ecx, str.SCSI
jmp 0x408d74
mov ecx, str.Atapi
jmp 0x408d74
mov ecx, 0x439b08
jmp 0x408d74
mov ecx, str.1394
jmp 0x408d74
mov ecx, 0x439b14
jmp 0x408d74
mov ecx, str.Fibre
jmp 0x408d74
mov ecx, 0x439b20
jmp 0x408d74
mov ecx, str.RAID
jmp 0x408d74
mov ecx, str.iSCSI
jmp 0x408d74
mov ecx, 0x439b34
jmp 0x408d74
mov ecx, str.SATA
jmp 0x408d74
mov ecx, 0x439b40
jmp 0x408d74
mov ecx, 0x439b44
jmp 0x408d74
mov ecx, str.Virtual
jmp 0x408d74
mov ecx, str.FileBackedVirtual
jmp 0x408d74
mov ecx, str.Spaces
jmp 0x408d74
mov ecx, str.Nvme
jmp 0x408d74
mov ecx, str.unknown
push edi
lea eax, [edi - 0x80]
push eax
push edx
push ebx
push esi
push dword [edi - 0x84]
push ecx
push dword [edi - 0x9c]
push str.PhyDrv:_d_BusType:__4s_Removable:_u_Size:_dGB__llu__Name:_s__s
call fcn.0040f530
add esp, 0x24
add edi, 0x4920
sub dword [ebp - 0x2a8], 1
jne 0x408c50
mov eax, dword [ebp - 0x2b0]
jmp 0x408db3
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
mov dword [0x43e364], eax
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.00417710
mov esp, ebp
pop ebp
ret