Function at 0x40b270
Capabilities:
Enumerate disk volumes
Get disk information
Get disk size
Get file size

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x9c
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x74], eax
mov eax, dword [ebp + 0x10]
test eax, eax
mov dword [ebp - 0x78], eax
js 0x40b530
cmp dword [ebp + 8], 0xffffffff
je 0x40b530
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll__get_osfhandle
cmp eax, 0xffffffff
mov edi, eax
je 0x40b550
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
sub esp, 4
cmp eax, 1
jne 0x40b550
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll__telli64
mov dword [ebp - 0x7c], eax
and eax, edx
cmp eax, 0xffffffff
mov dword [ebp - 0x80], edx
je 0x40b530
mov eax, dword [ebp - 0x74]
mov dword [esp], edi
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x78]
mov dword [ebp - 0x6c], eax
lea eax, [ebp - 0x58]
mov dword [esp + 4], eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
sub esp, 8
test eax, eax
je 0x40b5c7
mov eax, dword [ebp - 0x6c]
cmp eax, dword [ebp - 0x54]
jae 0x40b392
mov eax, dword [ebp - 0x78]
mov ecx, dword [ebp - 0x74]
mov dword [esp + 0xc], 0
mov dword [esp], edi
mov dword [ebp - 0x4c], eax
lea eax, [ebp - 0x4c]
mov dword [ebp - 0x50], ecx
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
sub esp, 0x10
cmp eax, 0xffffffff
je 0x40b500
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
sub esp, 4
test eax, eax
je 0x40b530
mov eax, dword [ebp - 0x7c]
mov dword [esp + 0xc], 0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x80]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.0041a050
and eax, edx
cmp eax, 0xffffffff
je 0x40b530
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
jbe 0x40b570
lea eax, [ebp - 0x50]
mov dword [esp + 4], eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
sub esp, 8
test eax, eax
je 0x40b5d8
mov dword [esp + 4], 2
mov dword [esp], 0x33
call sub.api_ms_win_crt_heap_l1_1_0.dll_calloc
mov dword [esp + 4], 2
mov dword [esp], 0x106
mov ebx, eax
call sub.api_ms_win_crt_heap_l1_1_0.dll_calloc
test eax, eax
mov esi, eax
je 0x40b5c7
test ebx, ebx
je 0x40b5c7
mov dword [esp + 4], 0x32
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_FindFirstVolumeW]
mov dword [ebp - 0x88], edi
sub esp, 8
mov edi, eax
mov dword [ebp - 0x84], eax
jmp 0x40b433
mov dword [esp + 8], 0x32
mov dword [esp + 4], ebx
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_FindNextVolumeW]
sub esp, 0xc
test eax, eax
je 0x40b5a0
lea eax, [ebp - 0x64]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x105
mov dword [esp + 4], esi
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_GetVolumeInformationW]
mov eax, dword [ebp - 0x64]
sub esp, 0x20
cmp dword [ebp - 0x34], eax
jne 0x40b413
mov eax, dword [ebp - 0x84]
mov edi, dword [ebp - 0x88]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_FindVolumeClose]
sub esp, 4
mov dword [esp], esi
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
lea eax, [ebp - 0x60]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceExW]
sub esp, 0x10
mov esi, eax
mov dword [esp], ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
test esi, esi
je 0x40b4e0
mov eax, dword [ebp - 0x70]
mov edx, dword [ebp - 0x6c]
sub eax, dword [ebp - 0x58]
sbb edx, dword [ebp - 0x54]
cmp edx, dword [ebp - 0x5c]
jbe 0x40b581
mov dword [esp], 0x1b
call fcn.0041a060
lea esi, [esi]
mov eax, 0xffffffff
jmp 0x40b38a
cmp dword [ebp - 0x50], 0xffffffff
je 0x40b348
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x83
jne 0x40b530
mov dword [esp], 0x1b
call fcn.0041a060
mov eax, 0xffffffff
jmp 0x40b38a
mov dword [esp], 0x16
call fcn.0041a060
lea esp, [ebp - 0xc]
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 9
call fcn.0041a060
lea esp, [ebp - 0xc]
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x70]
cmp eax, dword [ebp - 0x58]
jbe 0x40b314
jmp 0x40b398
jb 0x40b314
cmp eax, dword [ebp - 0x60]
lea esi, [esi]
ja 0x40b4e0
jmp 0x40b314
mov eax, dword [ebp - 0x84]
mov edi, dword [ebp - 0x88]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_FindVolumeClose]
sub esp, 4
mov dword [esp], ebx
xor ebx, ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
jmp 0x40b492
mov dword [esp], 9
call fcn.0041a060
jmp 0x40b4f0
mov dword [esp], 0x16
call fcn.0041a060
jmp 0x40b4f0