Function at 0x401882
Capabilities:
Get disk information via ioctl

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x388
push esi
push edi
push 0x1c
pop eax
push 0x10
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x5c], eax
mov esi, ecx
lea eax, [ebp + 8]
push 0x4051e0
xor edi, edi
push eax
mov dword [ebp - 0xc], esi
mov dword [esi + 0x6b08], edi
mov dword [ebp - 0x180], 5
call fcn.00401404
add esp, 0xc
test eax, eax
jne 0x4018cb
push str.CDROM
jmp 0x401905
push 0x10
lea eax, [ebp + 8]
push 0x4051d0
push eax
call fcn.00401404
add esp, 0xc
test eax, eax
jne 0x4018e9
push str.DISK
jmp 0x401905
push 0x10
lea eax, [ebp + 8]
push 0x4051f0
push eax
call fcn.00401404
add esp, 0xc
test eax, eax
jne 0x40190f
push str.FLOPPY
lea eax, [ebp - 0x7c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x7c]
push eax
push str.CDriveInfo::CreateSnapshot_Start__DriveType_s
push 3
call fcn.00401b00
add esp, 0xc
push 0x12
push edi
push edi
lea eax, [ebp + 8]
push eax
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsA]
mov dword [ebp - 4], eax
cmp eax, 0xffffffff
jne 0x40193f
xor eax, eax
jmp 0x401af7
lea ecx, [ebp - 0x5c]
push ecx
push edi
lea ecx, [ebp + 8]
push ecx
push edi
push eax
mov dword [ebp - 8], edi
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
test eax, eax
je 0x401ad6
push ebx
add esi, 8
mov ebx, 0x104
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 8]
lea eax, [ebp + 8]
push eax
push edi
push dword [ebp - 4]
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
lea eax, [ebp - 0x40]
push eax
push edi
push ebx
lea eax, [ebp - 0x180]
push eax
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 4]
mov dword [ebp - 0x180], 5
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailA]
test eax, eax
je 0x401aac
mov eax, dword [ebp - 0x2c]
lea ecx, [ebp - 0x17c]
push ecx
mov dword [esi - 4], eax
lea eax, [esi + 0x118]
push 0x405270
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push edi
push ebx
lea eax, [ebp - 0x284]
push eax
lea eax, [ebp - 0x14]
push eax
push 0xe
lea eax, [ebp - 0x40]
push eax
push dword [ebp - 4]
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyA]
test eax, eax
je 0x4019ff
cmp dword [ebp - 0x14], 1
jne 0x4019ff
push ebx
lea eax, [ebp - 0x284]
push eax
lea eax, [esi + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea eax, [ebp - 0x17c]
push eax
call fcn.00403ebc
push edi
push dword [ebp - 0x2c]
mov dword [esi + 0x114], eax
push esi
call dword [sym.imp.SETUPAPI.dll_CM_Get_Parent]
push edi
push dword [esi]
lea eax, [esi + 4]
push eax
call dword [sym.imp.SETUPAPI.dll_CM_Get_Parent]
or dword [esi + 8], 0xffffffff
push edi
push edi
push 3
push edi
push 3
push edi
lea eax, [esi + 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x401a7f
push edi
lea ecx, [ebp - 0x10]
push ecx
push 0xc
lea ecx, [ebp - 0x24]
push ecx
push edi
push edi
push 0x2d1080
push eax
mov dword [ebp - 0x10], edi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
je 0x401a76
mov eax, dword [ebp - 0x20]
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x1c]
mov dword [esi + 0xc], eax
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
push ebx
lea eax, [ebp - 0x388]
push eax
push dword [esi - 4]
mov dword [esi - 8], edi
call dword [sym.imp.SETUPAPI.dll_CM_Get_Device_IDA]
lea eax, [ebp - 0x388]
push eax
call fcn.004017eb
mov dword [esi - 8], eax
mov eax, dword [ebp - 0xc]
inc dword [eax + 0x6b08]
inc dword [ebp - 8]
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 8]
lea eax, [ebp + 8]
push eax
push edi
push dword [ebp - 4]
add esi, 0x224
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
test eax, eax
jne 0x401964
mov esi, dword [ebp - 0xc]
pop ebx
push dword [ebp - 4]
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
push dword [esi + 0x6b08]
push str.CDriveInfo::CreateSnapshot_Finish__DriveCount_i
push 3
call fcn.00401b00
xor eax, eax
add esp, 0xc
inc eax
pop edi
pop esi
leave
ret 0x10