Function at 0x401080
Capabilities:
Print debug messages

Disassembly:
sub esp, 0x114
mov ecx, 0xa
xor eax, eax
push ebx
push ebp
push esi
push edi
mov esi, str.USBSTORCdRomOEM_____Storage_________2.31
lea edi, [esp + 0xc0]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov ecx, 0xe
lea edi, [esp + 0xea]
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push str.ScanCdromAndSwitch_enter_n
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
call esi
push 0x12
push 0
push 0
push 0x40c160
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x4010e8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.GetClassDevs_All_Present_Devices__n
call esi
jmp 0x40124d
lea eax, [esp + 0x70]
mov dword [esp + 0x70], 0x1c
push eax
push 0
push ebx
mov dword [esp + 0x1c], 0
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
je 0x40124d
lea ecx, [esp + 0x14]
mov esi, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceRegistryPropertyA]
xor edi, edi
push ecx
push edi
lea edx, [esp + 0x24]
push edi
push edx
lea eax, [esp + 0x80]
push 1
push eax
push ebx
mov dword [esp + 0x30], edi
call esi
test eax, eax
jne 0x40118a
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
cmp eax, 0xd
je 0x401190
call ebp
cmp eax, 0x7a
jne 0x40124d
test edi, edi
je 0x40115a
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov ecx, dword [esp + 0x14]
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x14]
lea ecx, [esp + 0x1c]
push edx
push eax
push edi
push ecx
lea edx, [esp + 0x80]
push 1
push edx
push ebx
call esi
test eax, eax
je 0x401137
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
cmp eax, 0xd
je 0x4011ef
mov al, byte [edi]
mov esi, edi
test al, al
je 0x4011e4
mov eax, dword [esp + 0x14]
add eax, edi
cmp esi, eax
jae 0x4011e4
push esi
push 0x40e10c
call fcn.00401db0
push 0x40e108
push esi
call fcn.00401d30
lea ecx, [esp + 0xd0]
push ecx
push esi
call fcn.00401d30
add esp, 0x18
test eax, eax
jne 0x40120f
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea esi, [esi + eax + 1]
cmp byte [esi], 0
jne 0x40119f
test edi, edi
je 0x4011ef
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x70]
inc eax
push edx
push eax
push ebx
mov dword [esp + 0x1c], eax
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
test eax, eax
jne 0x40110e
jmp 0x40124d
mov ecx, dword [esp + 0x10]
lea eax, [esp + 0x8c]
push eax
push ecx
push 0x40c160
push 0
push ebx
mov dword [esp + 0xa0], 0x1c
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
test eax, eax
jne 0x401267
call ebp
cmp eax, 0x103
jne 0x40124d
push str.No_more_interfaces_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDeviceInfoList]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x114
ret
lea edx, [esp + 0x18]
push 0
push edx
push 0
lea eax, [esp + 0x98]
push 0
push eax
push ebx
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailA]
test eax, eax
jne 0x40128c
call ebp
cmp eax, 0x7a
jne 0x40124d
mov edi, dword [esp + 0x18]
push edi
call fcn.00401c77
mov esi, eax
add esp, 4
test esi, esi
jne 0x4012a6
push str.Unable_to_allocate_memory_to_get_the_interface_detail_data._n
jmp 0x401247
lea ecx, [esp + 0x18]
push 0
push ecx
push edi
lea edx, [esp + 0x98]
push esi
push edx
push ebx
mov dword [esi], 5
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailA]
test eax, eax
je 0x40124d
push 0
push 0
push 3
push 0
push 3
lea eax, [esi + 4]
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push esi
mov ebp, eax
call fcn.00401c0e
add esp, 4
cmp ebp, 0xffffffff
je 0x40124d
mov ecx, 0x14
xor eax, eax
lea edi, [esp + 0x20]
lea edx, [esp + 0x10]
rep stosd dword es:[edi], eax
mov byte [esp + 0x23], al
mov byte [esp + 0x25], al
mov eax, 0x18
lea ecx, [esp + 0xa8]
mov byte [esp + 0x27], al
mov dword [esp + 0x2c], eax
mov al, 2
push 0
mov byte [esp + 0x41], al
mov byte [esp + 0x42], al
mov byte [esp + 0x43], al
mov byte [esp + 0x44], al
mov byte [esp + 0x45], al
push edx
lea eax, [esp + 0x28]
mov dword [esp + 0x3c], ecx
push 0x50
push eax
lea ecx, [esp + 0x30]
push 0x50
push ecx
push 0x4d014
push ebp
mov word [esp + 0x40], 0x2c
mov byte [esp + 0x44], 1
mov byte [esp + 0x46], 6
mov byte [esp + 0x48], 1
mov dword [esp + 0x50], 5
mov dword [esp + 0x58], 0x30
mov byte [esp + 0x5c], 0x1b
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
test eax, eax
jne 0x401396
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x4013ab
push str.Failed_to_close_cd_rom_device._n
jmp 0x401247
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x114
ret