Function at 0x4050d7
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.00403ab0
movzx eax, ax
push eax
mov dword [ebp + 0x64], eax
call fcn.00403e84
add esp, 0x14
cmp eax, 0xffffffff
mov dword [ebp + 0x68], eax
je 0x405166
push eax
call fcn.004049f6
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 0x405166
push dword [ebp + 0x6c]
push dword [ebp + 0x68]
call fcn.00404a65
movzx eax, ax
cmp ax, bx
pop ecx
pop ecx
je 0x405159
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 0x405138
cmp word [ebp - 0x4c], bx
je 0x405344
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 0x402198
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 0x402238
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 0x40213c
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 0x4052a6
cmp esi, 0xffffffff
je 0x4052a6
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 0x40524c
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 0x405344
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 0x405344
lea eax, [ebp - 0x63c]
push eax
push dword [ebp + 0x70]
call fcn.004046e7
mov edi, eax
cmp edi, ebx
pop ecx
pop ecx
je 0x4052a6
cmp edi, 0xffffffff
jne 0x4052ad
xor edi, edi
jmp 0x405344
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 0x405344
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 0x405311
cmp dword [ebp + 0x68], ebx
je 0x405329
push 0x1f4
xor edi, edi
call dword [sym.imp.KERNEL32.DLL_Sleep]
inc dword [ebp + 0x70]
cmp dword [ebp + 0x70], 5
jbe 0x4052eb
jmp 0x405344
movzx eax, word [ebp - 0x4c]
xor edi, edi
inc edi
lea esi, [ebp - 0x4c]
push eax
call fcn.00404c0e
inc esi
inc esi
movzx eax, word [esi]
cmp ax, bx
pop ecx
jne 0x405333
mov eax, edi
pop edi
pop esi
pop ebx
add ebp, 0x74
leave
ret