Function at 0x402f20
Capabilities:
Get disk information
Get storage device properties

Disassembly:
push ebp
lea ebp, [esp - 0x13c]
sub esp, 0x13c
push 0xffffffffffffffff
push 0x51efd8
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x565fd0]
xor eax, ebp
mov dword [ebp + 0x138], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 0x144]
xor ebx, ebx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x3c], ecx
mov byte [ebp - 0x11], bl
call dword [sym.imp.KERNEL32.dll_GetLogicalDrives]
mov dword [ebp - 0x30], eax
xor ecx, ecx
mov dword [ebp - 0x18], ecx
cmp ecx, 0x20
jae 0x4031c3
mov eax, dword [ebp - 0x30]
mov edx, 1
shl edx, cl
test eax, edx
je 0x4031bd
add ecx, 0x41
push ecx
lea ecx, [ebp + 0xc]
push 0x547b78
push ecx
call fcn.004f9c94
add esp, 0xc
push ebx
push ebx
push 3
push ebx
push 3
push SysReAllocString
lea edx, [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x38], edi
cmp edi, 0xffffffff
je 0x4031ba
push 0x227
mov dword [ebp - 4], ebx
call fcn.0040758e
add esp, 4
push ebx
mov esi, eax
lea eax, [ebp - 0x44]
push eax
push 0x227
push esi
push 0xc
lea ecx, [ebp]
push ecx
push 0x2d1400
push edi
mov dword [ebp - 0x34], esi
mov dword [esi + 4], 0x227
mov dword [ebp], ebx
mov dword [ebp + 4], ebx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
cmp eax, ebx
je 0x40317f
mov eax, dword [esi + 0xc]
cmp eax, ebx
je 0x403021
add eax, esi
jmp 0x403026
mov eax, str._NULL_
push eax
lea ecx, [ebp - 0x28]
call fcn.004021e0
mov byte [ebp - 4], 1
mov eax, dword [esi + 0x10]
cmp eax, ebx
je 0x40303e
add eax, esi
jmp 0x403043
mov eax, str._NULL_
push eax
lea ecx, [ebp - 0x2c]
call fcn.004021e0
mov edx, dword [ebp - 0x1c]
add edx, 4
push edx
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 2
call fcn.004021e0
mov eax, dword [ebp - 0x1c]
add eax, 0xd
push eax
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], 3
call fcn.004021e0
mov eax, dword [ebp - 0x20]
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40308a
push 0x80004005
call fcn.004020f0
mov ecx, dword [ebp - 0x28]
push eax
push ecx
call fcn.004f9c60
add esp, 8
cmp eax, ebx
sete al
cmp al, bl
je 0x4030f8
mov eax, dword [ebp - 0x24]
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x4030b8
push 0x80004005
call fcn.004020f0
mov edx, dword [ebp - 0x2c]
push eax
push edx
call fcn.004f9c60
add esp, 8
cmp eax, ebx
sete al
cmp al, bl
je 0x4030f8
mov edx, dword [ebp - 0x3c]
mov byte [ebp - 0x11], 1
cmp edx, ebx
je 0x4030ea
lea ecx, [ebp + 0xc]
lea esp, [esp]
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
cmp al, bl
jne 0x4030e0
mov al, byte [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
add al, 0x41
mov byte [ecx + 0x150], al
mov eax, dword [ebp - 0x24]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x403117
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40313a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40315d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], bl
mov eax, dword [ebp - 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40317f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
jmp 0x4031a5
push esi
call fcn.00407599
add esp, 4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp - 0x11], bl
jne 0x4031c3
mov ecx, dword [ebp - 0x18]
inc ecx
jmp 0x402f78
mov al, byte [ebp - 0x11]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x138]
xor ecx, ebp
call fcn.004f96cd
add ebp, 0x13c
mov esp, ebp
pop ebp
ret 4