Function at 0x401140
Capabilities:
Get disk information

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
lea esi, [ebp - 0x28]
mov ebx, eax
sub esp, 0x50
mov eax, dword [0x404238]
mov edx, dword [0x40423c]
mov dword [esp], esi
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], edx
mov word [ebp - 0x28], bx
call sub.kernel32.dll_GetDriveTypeW
sub esp, 4
cmp eax, 5
je 0x401190
movsx ebx, bl
mov dword [esp], str.Drive__c:_is_not_a_CD_or_is_not_mounted_n
mov dword [esp + 4], ebx
call fcn.00401000
xor eax, eax
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret
mov eax, dword [str.._a:]
mov dword [esp], esi
mov dword [esp + 0x18], 0
mov dword [ebp - 0x28], eax
mov eax, dword [0x40422c]
mov dword [esp + 0x14], 0
mov dword [ebp - 0x24], eax
mov eax, dword [0x404230]
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0
mov dword [ebp - 0x20], eax
movzx eax, word [0x404234]
mov word [ebp - 0x20], bx
mov word [ebp - 0x1c], ax
call sub.kernel32.dll_CreateFileW
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x401400
test byte [section..data], 8
jne 0x401340
lea ebx, [ebp - 0x2c]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x90020
mov dword [esp], esi
call sub.kernel32.dll_DeviceIoControl
sub esp, 0x20
test eax, eax
jne 0x40125d
test byte [section..data], 4
jne 0x401308
lea eax, [ebp - 0x2d]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 1
mov dword [esp + 8], eax
mov dword [esp + 4], 0x2d4804
mov dword [esp], esi
mov byte [ebp - 0x2d], 0
call sub.kernel32.dll_DeviceIoControl
sub esp, 0x20
test eax, eax
jne 0x4012ac
test byte [section..data], 4
jne 0x4012d0
mov eax, dword [0x406004]
test eax, eax
je 0x401370
mov dword [esp], esi
call sub.kernel32.dll_CloseHandle
mov eax, 1
sub esp, 4
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.IOCTL_STORAGE_MEDIA_REMOVAL_failed_with_err__d_n
mov dword [esp + 8], str.eject_cd
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004010b0
jmp 0x4012ac
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.FSCTL_DISMOUNT_VOLUME_failed_with_err__d_n
mov dword [esp + 8], str.eject_cd
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004010b0
jmp 0x40125d
movsx ebx, bl
mov dword [esp + 0xc], str.ejecting__c:_n
mov dword [esp + 0x10], ebx
mov dword [esp + 8], str.eject_cd
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call fcn.004010b0
jmp 0x40120a
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x2d4808
mov dword [esp], esi
call sub.kernel32.dll_DeviceIoControl
sub esp, 0x20
test eax, eax
jne 0x4012b9
test byte [section..data], 4
je 0x4012b9
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.IOCTL_STORAGE_EJECT_MEDIA_failed_with_err__d_n
mov dword [esp + 8], str.eject_cd
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x403000
mov dword [esp], 2
call fcn.004010b0
jmp 0x4012b9
movsx ebx, bl
mov dword [esp], str.Cannot_open_device_for_drive__c:_n
mov dword [esp + 4], ebx
call fcn.00401000
xor eax, eax
jmp 0x401187