Function at 0x40f040
Capabilities:
Get disk information
Get disk size
Query or enumerate registry value
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x4361ed
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x4b4
mov eax, dword [0x4540d0]
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov dword [esp + 0x20], esi
mov dword [esp + 0x58], eax
lea ecx, [esp + 0x1c4]
xor edi, edi
push ecx
push 0xff
mov dword [esp + 0x4d4], edi
call dword [sym.imp.KERNEL32.dll_GetLogicalDriveStringsA]
test eax, eax
je 0x40f303
lea edx, [esp + 0x14]
push edi
lea eax, [esp + 0x1c8]
push edx
push eax
call fcn.0040f010
add esp, 0xc
cmp eax, edi
mov dword [esp + 0x34], eax
je 0x40f303
jmp 0x40f0ba
mov esi, dword [esp + 0x20]
mov ebp, dword [esi + 0x1ee8]
inc ebp
mov eax, ebp
mov dword [esi + 0x1ee8], ebp
lea ecx, [eax + eax*8]
lea edx, [eax + ecx*2]
mov al, byte [esp + 0x14]
shl edx, 4
lea ecx, [esp + 0x14]
lea ebp, [edx + esi - 0x128]
push ecx
mov byte [ebp + 0x80], al
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 6
ja case.default.0x40f0f3
jmp dword [eax*4 + 0x40f61c]
mov byte [ebp + 0x119], 5
jmp case.default.0x40f0f3
mov byte [ebp + 0x119], 6
jmp case.default.0x40f0f3
mov byte [ebp + 0x119], 2
jmp case.default.0x40f0f3
mov byte [ebp + 0x119], 0
jmp case.default.0x40f0f3
mov byte [ebp + 0x119], 3
jmp case.default.0x40f0f3
mov byte [ebp + 0x119], 1
jmp case.default.0x40f0f3
mov byte [ebp + 0x119], 4
mov al, byte [ebp + 0x80]
cmp al, 0x41
je 0x40f232
cmp al, 0x42
je 0x40f232
push str.kernel32.dll
xor bl, bl
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
cmp esi, edi
je 0x40f1dc
push str.GetDiskFreeSpaceExA
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, edi
je 0x40f1d1
lea edx, [esp + 0x5c]
lea ecx, [esp + 0x64]
push edx
push ecx
lea edx, [esp + 0xc4]
lea ecx, [esp + 0x1c]
push edx
push ecx
call eax
test eax, eax
je 0x40f1b7
mov edx, dword [esp + 0x64]
mov ecx, dword [esp + 0x5c]
mov eax, dword [esp + 0x68]
mov dword [ebp + 0x88], edx
mov edx, dword [esp + 0x60]
mov dword [ebp + 0x90], ecx
mov dword [ebp + 0x8c], eax
mov dword [ebp + 0x94], edx
jmp 0x40f1cf
mov dword [ebp + 0x88], edi
mov dword [ebp + 0x90], edi
mov dword [ebp + 0x8c], edi
mov dword [ebp + 0x94], edi
mov bl, 1
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
test bl, bl
jne 0x40f24a
lea eax, [esp + 0x30]
lea ecx, [esp + 0xb8]
push eax
lea edx, [esp + 0x3c]
push ecx
lea eax, [esp + 0x44]
push edx
lea ecx, [esp + 0x20]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceA]
test eax, eax
je 0x40f24a
mov edx, dword [esp + 0x3c]
imul edx, dword [esp + 0x38]
imul edx, dword [esp + 0x30]
mov dword [ebp + 0x88], edx
mov dword [ebp + 0x8c], edi
mov eax, dword [esp + 0x3c]
imul eax, dword [esp + 0x38]
imul eax, dword [esp + 0x30]
mov dword [ebp + 0x90], eax
jmp 0x40f244
mov dword [ebp + 0x88], edi
mov dword [ebp + 0x8c], edi
mov dword [ebp + 0x90], edi
mov dword [ebp + 0x94], edi
lea ecx, [esp + 0x2c4]
push 0x100
lea edx, [esp + 0x58]
push ecx
lea eax, [esp + 0x30]
push edx
push eax
push edi
lea ecx, [esp + 0x3d8]
push 0xff
lea edx, [esp + 0x2c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetVolumeInformationA]
test eax, eax
je 0x40f2dd
lea edi, [esp + 0x2c4]
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp + 0x98]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x3c4]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x54]
shr eax, 0xf
and al, 1
xor edi, edi
mov byte [ebp + 0x118], al
mov ecx, dword [esp + 0x34]
lea edx, [esp + 0x14]
push ecx
lea eax, [esp + 0x1c8]
push edx
push eax
call fcn.0040f010
add esp, 0xc
cmp eax, edi
mov dword [esp + 0x34], eax
jne 0x40f0b6
mov ecx, dword [0x4540d0]
mov dword [esp + 0x24], ecx
push str.SystemCurrentControlSetControlFileSystemCDFS
lea ecx, [esp + 0x28]
mov byte [esp + 0x4d0], 1
call fcn.0042b993
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x1c]
push edx
push 1
push edi
mov ebx, 0x100
push eax
push reloc.WSOCK32.dll_bind
mov dword [esp + 0x24], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
cmp eax, edi
jne 0x40f5da
mov eax, 2
push str.No_read_ahead
lea ecx, [esp + 0x44]
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], 0x1b
mov dword [esp + 0x78], 0x34
mov dword [esp + 0x7c], 0x42
mov dword [esp + 0x80], 0x66
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], 8
mov dword [esp + 0x8c], 0x10
mov dword [esp + 0x90], 0x20
mov dword [esp + 0x94], 0x40
mov dword [esp + 0x98], 0x60
mov dword [esp + 0x9c], 0x80
mov dword [esp + 0xa0], edi
mov dword [esp + 0xa4], 6
mov dword [esp + 0xa8], 0xe
mov dword [esp + 0xac], 0x1e
mov dword [esp + 0xb0], 0x3e
mov dword [esp + 0xb4], 0x5e
mov dword [esp + 0xb8], 0x7e
call fcn.0042b8c4
push str.Single_speed_drives
lea ecx, [esp + 0x48]
mov byte [esp + 0x4d0], 2
call fcn.0042b8c4
push str.Double_speed_drives
lea ecx, [esp + 0x4c]
mov byte [esp + 0x4d0], 3
call fcn.0042b8c4
push str.Triple_speed_drives
lea ecx, [esp + 0x50]
mov byte [esp + 0x4d0], 4
call fcn.0042b8c4
push str.Quad_speed_or_higher
lea ecx, [esp + 0x54]
mov byte [esp + 0x4d0], 5
call fcn.0042b8c4
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea ecx, [esp + 0x10]
lea edx, [esp + 0xc4]
push ecx
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x30]
push edx
push eax
push edi
push str.PrefetchTail
push ecx
mov byte [esp + 0x4e4], 6
mov dword [esp + 0x28], ebx
call esi
mov ebp, dword [esp + 0xc4]
test eax, eax
je 0x40f4b0
mov ebp, dword [esp + 0x28]
lea edx, [esp + 0x10]
lea eax, [esp + 0xc4]
push edx
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x30]
push eax
push ecx
push edi
push str.CacheSize
push edx
mov dword [esp + 0x28], ebx
call esi
test eax, eax
jne 0x40f4ea
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0xc4]
mov dword [ebx + 0x1eec], eax
jmp 0x40f4ee
mov ebx, dword [esp + 0x20]
lea ecx, [esp + 0x10]
lea edx, [esp + 0xc4]
push ecx
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x30]
push edx
push eax
push edi
push str.Prefetch
push ecx
call esi
mov edx, dword [esp + 0xc4]
cmp eax, edi
je 0x40f51c
mov edx, dword [esp + 0x28]
xor eax, eax
lea ecx, [esp + 0x80]
cmp ebp, dword [ecx]
je 0x40f534
inc eax
add ecx, 4
cmp eax, 7
jl 0x40f525
jmp 0x40f56c
cmp eax, 7
jge 0x40f56c
mov ecx, dword [esp + eax*4 + 0x9c]
sub edx, ecx
xor eax, eax
lea ecx, [esp + 0x6c]
cmp edx, dword [ecx]
je 0x40f557
inc eax
add ecx, 4
cmp eax, 5
jl 0x40f548
jmp 0x40f56c
cmp eax, 5
jge 0x40f56c
lea edx, [esp + eax*4 + 0x40]
lea ecx, [ebx + 0x1ef0]
push edx
call fcn.0042b943
mov eax, dword [ebx + 0x1eec]
mov ecx, dword [esp + 0x1c]
shl eax, 1
push ecx
mov dword [ebx + 0x1eec], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [esp + 0x50]
mov byte [esp + 0x4cc], 5
call fcn.0042b856
lea ecx, [esp + 0x4c]
mov byte [esp + 0x4cc], 4
call fcn.0042b856
lea ecx, [esp + 0x48]
mov byte [esp + 0x4cc], 3
call fcn.0042b856
lea ecx, [esp + 0x44]
mov byte [esp + 0x4cc], 2
call fcn.0042b856
lea ecx, [esp + 0x40]
mov byte [esp + 0x4cc], 1
call fcn.0042b856
lea ecx, [esp + 0x24]
mov byte [esp + 0x4cc], 0
call fcn.0042b856
lea ecx, [esp + 0x58]
mov dword [esp + 0x4cc], 0xffffffff
call fcn.0042b856
mov ecx, dword [esp + 0x4c4]
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x4c0
ret 4