Function at 0x20005869
Capabilities:
Get disk information
Get disk information via ioctl

Disassembly:
push ebp
lea ebp, [esp - 0x74]
sub esp, 0x6b0
push ebx
push esi
push edi
mov esi, 0x9e
xor ebx, ebx
push esi
lea eax, [ebp - 0x4a]
push ebx
xor edi, edi
push eax
inc edi
mov word [ebp - 0x4c], bx
call sub.MSVCRT.dll_memset
push dword [ebp + 0x7c]
call fcn.20004235
movzx eax, ax
push eax
mov dword [ebp + 0x64], eax
call fcn.20004614
add esp, 0x14
cmp eax, 0xffffffff
mov dword [ebp + 0x68], eax
je 0x200058f8
push eax
call fcn.20005197
pop ecx
movzx eax, ax
xor ecx, ecx
inc ecx
cmp ax, cx
mov dword [ebp + 0x60], eax
mov dword [ebp + 0x70], ebx
mov dword [ebp + 0x6c], ecx
jb 0x200058f8
push dword [ebp + 0x6c]
push dword [ebp + 0x68]
call fcn.20005206
movzx eax, ax
cmp ax, bx
pop ecx
pop ecx
je 0x200058eb
movzx ecx, word [ebp + 0x70]
inc dword [ebp + 0x70]
mov word [ebp + ecx*2 - 0x4c], ax
inc dword [ebp + 0x6c]
mov ax, word [ebp + 0x6c]
cmp ax, word [ebp + 0x60]
jbe 0x200058ca
cmp word [ebp - 0x4c], bx
je 0x20005ad6
push esi
lea eax, [ebp - 0x22a]
push ebx
push eax
mov word [ebp - 0x22c], bx
call sub.MSVCRT.dll_memset
movzx eax, word [ebp + 0x64]
mov edi, dword [sym.imp.USER32.dll_wsprintfW]
push eax
mov dword [ebp + 0x70], eax
lea eax, [ebp - 0x22c]
push 0x20002420
push eax
call edi
push esi
lea eax, [ebp - 0xea]
push ebx
push eax
mov word [ebp - 0xec], bx
call sub.MSVCRT.dll_memset
push dword [ebp + 0x70]
lea eax, [ebp - 0xec]
push 0x20002478
push eax
call edi
push esi
lea eax, [ebp - 0x18a]
push ebx
push eax
mov word [ebp - 0x18c], bx
call sub.MSVCRT.dll_memset
push dword [ebp + 0x70]
lea eax, [ebp - 0x18c]
push 0x200023c4
push eax
call edi
or dword [ebp + 0x70], 0xffffffff
add esp, 0x48
push ebx
push ebx
push 3
push ebx
push 3
push ebx
lea eax, [ebp - 0x18c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, ebx
je 0x20005a38
cmp esi, 0xffffffff
je 0x20005a38
xor eax, eax
mov dword [ebp + 0x54], ebx
lea edi, [ebp + 0x58]
stosd dword es:[edi], eax
push ebx
stosd dword es:[edi], eax
lea eax, [ebp + 0x64]
push eax
push 0xc
lea eax, [ebp + 0x54]
push eax
push ebx
push ebx
push 0x2d1080
push esi
mov dword [ebp + 0x64], ebx
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x200059de
mov eax, dword [ebp + 0x58]
mov dword [ebp + 0x70], eax
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
cmp dword [ebp + 0x70], 0xffffffff
setne al
mov edi, eax
cmp edi, ebx
je 0x20005ad6
mov esi, 0x104
push esi
lea eax, [ebp - 0x63c]
push eax
lea eax, [ebp - 0xec]
push eax
call dword [sym.imp.KERNEL32.dll_QueryDosDeviceW]
mov edi, eax
cmp edi, ebx
je 0x20005ad6
lea eax, [ebp - 0x63c]
push eax
push dword [ebp + 0x70]
call fcn.20004e88
mov edi, eax
cmp edi, ebx
pop ecx
pop ecx
je 0x20005a38
cmp edi, 0xffffffff
jne 0x20005a3f
xor edi, edi
jmp 0x20005ad6
push 0x206
lea eax, [ebp - 0x432]
push ebx
push eax
mov dword [ebp + 0x68], ebx
mov word [ebp - 0x434], bx
call sub.MSVCRT.dll_memset
add esp, 0xc
push ebx
push edi
lea eax, [ebp + 0x6c]
push eax
mov dword [ebp + 0x6c], ebx
call dword [sym.imp.SETUPAPI.dll_CM_Get_Parent]
mov edi, eax
neg edi
sbb edi, edi
inc edi
je 0x20005ad6
mov dword [ebp + 0x70], 1
push ebx
push esi
lea eax, [ebp - 0x434]
push eax
lea eax, [ebp + 0x68]
push eax
push dword [ebp + 0x6c]
mov word [ebp - 0x434], bx
call dword [sym.imp.SETUPAPI.dll_CM_Request_Device_EjectW]
test eax, eax
jne 0x20005aa3
cmp dword [ebp + 0x68], ebx
je 0x20005abb
push 0x1f4
xor edi, edi
call dword [sym.imp.KERNEL32.dll_Sleep]
inc dword [ebp + 0x70]
cmp dword [ebp + 0x70], 5
jbe 0x20005a7d
jmp 0x20005ad6
movzx eax, word [ebp - 0x4c]
xor edi, edi
inc edi
lea esi, [ebp - 0x4c]
push eax
call fcn.200053af
inc esi
inc esi
movzx eax, word [esi]
cmp ax, bx
pop ecx
jne 0x20005ac5
mov eax, edi
pop edi
pop esi
pop ebx
add ebp, 0x74
leave
ret