Function at 0x402c4f
Capabilities:
Read file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x188
mov eax, dword [ecx]
mov dword [ebp - 0x168], eax
xor eax, eax
mov dword [esp + 0xc], 0x12
mov dword [esp + 8], eax
mov dword [esp + 4], eax
mov dword [esp], 0x4c50dc
call dword [sym.imp.SETUPAPI.dll_SetupDiGetClassDevsA]
sub esp, 0x10
cmp eax, 0xffffffff
jne 0x402caf
call fcn.0043f53d
mov dword [esp], str.SetupDiGetClassDevs__Interface__failed:__s
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x403171
mov dword [ebp - 0x150], 0x1c
mov esi, eax
xor eax, eax
mov dword [ebp - 0x15c], 0xffffffff
mov dword [ebp - 0x170], eax
lea ebx, [ebp - 0x150]
mov dword [esp + 8], ebx
mov eax, dword [ebp - 0x170]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInfo]
sub esp, 0xc
test eax, eax
je 0x403171
mov edx, 0x4e20c0
xor eax, eax
mov ecx, 0x41
mov edi, edx
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x158]
mov dword [esp], edx
mov edx, ebx
mov dword [esp + 4], eax
lea ecx, [ebp - 0x154]
mov eax, esi
call fcn.00402631
test eax, eax
jne 0x402d5c
call fcn.0043f53d
mov dword [esp], str.SetupDiGetDeviceRegistryProperty__Friendly_Name__failed:__s
mov dword [esp + 4], eax
call fcn.0043efa9
movups xmm0, xmmword [str.Generic_Optical__:EFIRufus_ntfus_ntfs_x64.efi]
mov dword [0x4e20d2], 0x657669
movups xmmword [0x4e20c0], xmm0
mov dword [0x4e20ce], 0x7244206c
mov dword [esp + 4], 0x4e20c0
mov dword [esp], str.Found__s_optical_device
call fcn.0043efa9
xor eax, eax
mov dword [ebp - 0x134], 0x1c
mov dword [ebp - 0x160], eax
mov dword [ebp - 0x174], eax
mov eax, dword [ebp - 0x15c]
dec eax
cmp eax, 0xfffffffd
ja 0x402dae
mov eax, dword [ebp - 0x15c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push eax
mov dword [ebp - 0x15c], 0xffffffff
mov eax, dword [ebp - 0x160]
lea ebx, [ebp - 0x134]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp + 0x10], ebx
mov eax, dword [ebp - 0x174]
mov dword [esp + 8], 0x4c50dc
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x150]
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
sub esp, 0x14
test eax, eax
jne 0x402e1d
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x103
je 0x403166
call fcn.0043f53d
mov dword [esp], str.SetupDiEnumDeviceInterfaces_failed:__s
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x403166
xor eax, eax
xor edi, edi
mov dword [esp + 4], ebx
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
mov eax, dword [sym.imp.SETUPAPI.dll_SetupDiGetDeviceInterfaceDetailA]
mov dword [esp + 0x14], edi
lea edi, [ebp - 0x158]
mov dword [esp + 0x10], edi
mov dword [esp], esi
mov dword [ebp - 0x164], eax
call eax
mov dword [ebp - 0x16c], eax
sub esp, 0x18
test eax, eax
jne 0x402f10
call dword [sym.imp.KERNEL32.DLL_GetLastError]
cmp eax, 0x7a
jne 0x402eee
mov edx, dword [ebp - 0x158]
mov dword [esp + 4], edx
mov dword [ebp - 0x178], edx
mov dword [esp], 1
call sub.msvcrt.dll_calloc
mov edx, dword [ebp - 0x178]
test eax, eax
mov dword [ebp - 0x160], eax
jne 0x402ea0
mov dword [esp], str.Unable_to_allocate_data_for_SP_DEVICE_INTERFACE_DETAIL_DATA
jmp 0x402f17
mov eax, dword [ebp - 0x160]
xor ecx, ecx
mov dword [eax], 5
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], esi
mov eax, dword [ebp - 0x164]
call eax
sub esp, 0x18
test eax, eax
jne 0x402f1e
call fcn.0043f53d
mov dword [esp], str.SetupDiGetDeviceInterfaceDetail__actual__failed:__s
mov dword [esp + 4], eax
call fcn.0043efa9
jmp 0x40315b
call fcn.0043f53d
mov dword [esp], str.SetupDiGetDeviceInterfaceDetail__dummy__failed:__s
mov dword [esp + 4], eax
call fcn.0043efa9
xor ebx, ebx
mov dword [ebp - 0x160], ebx
jmp 0x40315b
mov dword [esp], str.SetupDiGetDeviceInterfaceDetail__dummy____no_data_was_allocated
call fcn.0043efa9
jmp 0x402f03
mov eax, dword [ebp - 0x160]
xor edx, edx
xor ecx, ecx
add eax, 4
mov dword [ebp - 0x164], eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], 0x8000000
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov dword [ebp - 0x15c], eax
sub esp, 0x1c
inc eax
je 0x40315b
xor eax, eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x118]
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0x14], 0x100
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
mov dword [esp + 4], 0x700a0
mov eax, dword [ebp - 0x15c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_DeviceIoControl]
sub esp, 0x20
test eax, eax
je 0x40315b
mov eax, 0x1000
cmp eax, dword [ebp - 0x100]
mov eax, dword [ebp - 0x16c]
sbb eax, dword [ebp - 0xfc]
jge 0x40315b
mov dword [esp], 0x800
call sub.msvcrt.dll_malloc
mov ebx, eax
test eax, eax
je 0x4030ac
xor ecx, ecx
xor esi, esi
mov dword [esp + 4], 0x8000
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], ecx
mov dword [esp + 8], esi
mov eax, dword [ebp - 0x15c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_SetFilePointerEx]
sub esp, 0x14
test eax, eax
je 0x4030ac
xor edx, edx
lea eax, [ebp - 0x158]
mov dword [esp + 8], 0x800
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], eax
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x15c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_ReadFile]
sub esp, 0x14
test eax, eax
je 0x4030ac
cmp dword [ebp - 0x158], 0x800
jne 0x4030ac
movups xmm1, xmmword [ebx + 0x28]
movups xmm2, xmmword [ebx + 0x38]
mov byte [0x4e20a0], 0
movups xmmword [0x4e2080], xmm1
movups xmmword [0x4e2090], xmm2
mov dword [esp], 0x4e2080
call sub.msvcrt.dll_strlen
sub eax, 1
jae 0x40309a
mov eax, dword [ebp - 0x168]
mov dword [eax + 0x20], 0x4e2080
jmp 0x4030ac
cmp byte [eax + 0x4e2080], 0x20
jne 0x40308b
mov byte [eax + 0x4e2080], 0
jmp 0x403086
mov eax, dword [ebp - 0x164]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edx, 0x4e20c0
mov esi, dword [ebp - 0x164]
lea ecx, [eax + 1]
mov eax, 0x104
mov edi, edx
cmp ecx, eax
cmova ecx, eax
mov eax, dword [ebp - 0x164]
rep movsb byte es:[edi], byte [esi]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edx, 0x4e21c3
lea ecx, [eax + 1]
cmp ecx, 0x103
ja 0x4030fa
lea edx, [eax + 0x4e20c0]
mov eax, dword [ebp - 0x168]
mov edi, dword [ebp - 0x168]
mov byte [edx], 0
mov edx, dword [ebp - 0xfc]
mov dword [eax + 0x18], 0x4e20c0
mov eax, dword [ebp - 0x100]
mov dword [edi + 0x14], edx
mov dword [edi + 0x10], eax
mov eax, dword [ebp - 0x15c]
dec eax
cmp eax, 0xfffffffd
ja 0x40313e
mov eax, dword [ebp - 0x15c]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push eax
mov eax, dword [ebp - 0x160]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov dword [esp], ebx
call sub.msvcrt.dll_free
mov eax, 1
jmp 0x403173
inc dword [ebp - 0x174]
jmp 0x402d88
inc dword [ebp - 0x170]
jmp 0x402ccd
xor eax, eax
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret