Function at 0x4016b8
Capabilities:
Get disk information via ioctl

Disassembly:
mov eax, 0x403127
call fcn.00402dd0
sub esp, 0x15c
push ebx
push esi
mov ebx, ecx
movzx eax, word [ebx + 4]
push edi
mov dword [ebp - 0x10], esp
push eax
lea eax, [ebp - 0x168]
push str.._c:
push eax
mov dword [ebp - 0x18], ebx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
xor esi, esi
push esi
push esi
push 3
push esi
push 3
push esi
lea eax, [ebp - 0x168]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0x20], eax
je 0x401765
xor eax, eax
mov dword [ebp - 0x44], esi
lea edi, [ebp - 0x40]
stosd dword es:[edi], eax
push esi
stosd dword es:[edi], eax
lea eax, [ebp - 0x48]
push eax
push 0xc
lea eax, [ebp - 0x44]
push eax
push esi
push esi
push 0x2d1080
push dword [ebp - 0x20]
mov dword [ebp - 0x48], esi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push dword [ebp - 0x20]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, esi
je 0x401765
mov eax, dword [ebp - 0x44]
push 2
pop edi
sub eax, edi
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x20], esi
je 0x4017eb
sub eax, 5
je 0x401778
sub eax, 0x2c
je 0x4017eb
xor eax, eax
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret 8
cmp dword [ebp - 0x3c], 0xffffffff
mov dword [ebp - 0x1c], esi
jae 0x4017c3
push dword [ebp - 0x40]
lea eax, [ebp - 0x168]
push str.Select_PNPDeviceID_From_Win32_DiskDrive_Where_DeviceID_.PhysicalDrive_d_
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
push dword [ebp + 0xc]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x168]
push eax
mov dword [ebp - 4], esi
call fcn.004014f1
add esp, 0x18
mov dword [ebp - 0x1c], eax
jmp 0x4017c3
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x1c], esi
jne 0x401827
lea eax, [ebp - 0x14]
push eax
xor eax, eax
mov ax, word [ebx + 4]
push eax
call fcn.0040111a
cmp eax, esi
pop ecx
pop ecx
je 0x401765
mov dword [ebp - 0x20], 1
jmp 0x401827
movzx eax, word [ebx + 4]
push eax
lea eax, [ebp - 0x168]
push str.Select_PNPDeviceID_From_Win32_CDROMDrive_Where_Drive__c:_
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
push dword [ebp + 0xc]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x168]
push eax
mov dword [ebp - 4], edi
call fcn.004014f1
add esp, 0x18
cmp eax, esi
je 0x401765
or dword [ebp - 4], 0xffffffff
xor eax, eax
cmp dword [ebx], esi
je 0x401833
inc eax
jmp 0x401767
push 6
pop ecx
mov dword [ebp - 0x68], 0x1c
lea edi, [ebp - 0x64]
rep stosd dword es:[edi], eax
mov eax, dword [ebp - 0x18]
push esi
mov edi, 0x100
push edi
add eax, 6
push eax
push dword [ebp - 0x14]
add ebx, 0x406
mov dword [ebp - 0x1c], 1
mov dword [ebp - 4], 4
mov word [ebx], si
call dword [sym.imp.SETUPAPI.dll_CM_Get_Device_IDW]
cmp eax, esi
je 0x401885
or dword [ebp - 0x4c], 0xffffffff
push 0x4048dc
lea eax, [ebp - 0x4c]
jmp 0x40198f
lea eax, [ebp - 0x68]
push eax
mov eax, dword [ebp - 0x18]
push 2
push esi
add eax, 6
push eax
push dword [ebp + 8]
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDeviceInfoW]
test eax, eax
jne 0x4018b1
or dword [ebp - 0x30], 0xffffffff
push 0x4048dc
lea eax, [ebp - 0x30]
jmp 0x40198f
push esi
push edi
push ebx
mov ebx, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyW]
push esi
push 0xc
lea eax, [ebp - 0x68]
push eax
push dword [ebp + 8]
call ebx
cmp dword [ebp - 0x20], esi
je 0x4018f4
push esi
push dword [ebp - 0x14]
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp + 0xc]
push eax
mov dword [ebp + 0xc], esi
mov dword [ebp - 0x24], esi
call dword [sym.imp.SETUPAPI.dll_CM_Get_DevNode_Status]
cmp eax, esi
jne 0x4018f4
test byte [ebp + 0xd], 0x40
je 0x4018f4
mov ecx, dword [ebp - 0x14]
cmp ecx, esi
jne 0x40191f
xor eax, eax
cmp dword [ebp - 0x20], esi
sete al
push eax
push dword [ebp - 0x14]
push dword [ebp + 8]
call fcn.004012b6
mov ecx, eax
add esp, 0xc
cmp ecx, esi
jne 0x40191f
or dword [ebp - 0x38], 0xffffffff
push 0x4048dc
lea eax, [ebp - 0x38]
jmp 0x40198f
mov eax, dword [ebp - 0x18]
push esi
push edi
add eax, 6
push eax
push ecx
mov dword [ebp + 0xc], eax
call dword [sym.imp.SETUPAPI.dll_CM_Get_Device_IDW]
cmp eax, esi
je 0x401944
or dword [ebp - 0x28], 0xffffffff
push 0x4048dc
lea eax, [ebp - 0x28]
jmp 0x40198f
lea eax, [ebp - 0x68]
push eax
push 2
push esi
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.SETUPAPI.dll_SetupDiOpenDeviceInfoW]
test eax, eax
jne 0x401969
or dword [ebp - 0x2c], 0xffffffff
push 0x4048dc
lea eax, [ebp - 0x2c]
jmp 0x40198f
mov eax, dword [ebp - 0x18]
push esi
push edi
add eax, 0x206
push eax
push esi
push esi
lea eax, [ebp - 0x68]
push eax
push dword [ebp + 8]
call ebx
test eax, eax
jne 0x4019a7
or dword [ebp - 0x34], 0xffffffff
push 0x4048dc
lea eax, [ebp - 0x34]
push eax
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [ebp - 0x18]
xor esi, esi
mov word [eax + 6], si
mov dword [ebp - 0x1c], esi
mov eax, 0x4019a7
ret
mov eax, dword [ebp - 0x1c]
jmp 0x401767