Function at 0x40c090
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
mov esi, ecx
xor ebx, ebx
mov dword [esp + 0x1c], esi
mov dword [esp + 0xc], ebx
call fcn.0040bfe0
mov ebp, dword [esp + 0x24]
inc eax
cmp dword [ebp], 0
je 0x40c0bd
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret 8
push edi
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp], eax
mov eax, dword [esi + 0x30]
test eax, eax
jbe 0x40c23b
mov esi, dword [esi + 0x2c]
mov eax, dword [esi]
cmp eax, esi
mov dword [esp + 0x18], eax
je 0x40c23b
jmp 0x40c0f7
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x10]
mov esi, dword [eax + 8]
mov ebp, dword [ebp]
add ebp, ebx
mov al, byte [esi + 8]
test al, al
je 0x40c1dc
mov eax, dword [esi + 4]
mov ecx, dword [esi]
mov edi, dword [esp + 0x2c]
push eax
push ecx
push edi
push str.___s_r_nContent_Disposition:_form_data__name__s___filename__s__r_n_r_n
push ebp
call dword [sym.imp.MSVCRT.dll_sprintf]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x14
mov edx, dword [esi + 4]
repne scasb al, byte es:[edi]
mov edi, dword [edx - 8]
mov eax, dword [esi]
not ecx
dec ecx
mov eax, dword [eax - 8]
add ecx, edi
xor edi, edi
push edi
push 0x80
push 3
push edi
push 1
push SysReAllocStringLen
push edx
lea ebx, [ecx + eax + 0x3c]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, edi
je 0x40c212
cmp esi, 0xffffffff
je 0x40c212
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
lea ecx, [esp + 0x14]
mov dword [esp + 0x1c], eax
push edi
lea eax, [ebx + ebp]
push ecx
push 0x400
push eax
push esi
mov dword [esp + 0x28], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40c1c3
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x40c1c3
cmp edi, dword [esp + 0x1c]
ja 0x40c1c3
add edi, eax
lea edx, [esp + 0x14]
lea eax, [ebx + ebp]
push 0
push edx
add eax, edi
push 0x400
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40c196
mov cx, word [0x456ad4]
add edi, ebx
push esi
mov word [edi + ebp], cx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ebx, [edi + 2]
jmp 0x40c212
mov edx, dword [esi + 4]
mov eax, dword [esi]
mov edi, dword [esp + 0x2c]
push edx
push eax
push edi
push str.___s_r_nContent_Disposition:_form_data__name__s__r_n_r_n_s_r_n
push ebp
call dword [sym.imp.MSVCRT.dll_sprintf]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x14
mov edx, dword [esi + 4]
repne scasb al, byte es:[edi]
mov eax, dword [edx - 8]
not ecx
dec ecx
add ecx, eax
mov eax, dword [esi]
mov edx, dword [eax - 8]
lea ebx, [ecx + edx + 0x31]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x10]
mov ebp, dword [esp + 0x28]
mov eax, dword [eax]
mov edx, dword [ecx + 0x2c]
add esi, ebx
cmp eax, edx
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], eax
jne 0x40c0ef
mov ebx, esi
mov edx, dword [ebp]
mov ax, word [0x456a98]
or ecx, 0xffffffff
mov word [edx + ebx], ax
mov edx, dword [esp + 0x2c]
mov edi, edx
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [ebp]
mov esi, edx
not ecx
dec ecx
lea edi, [eax + ebx + 2]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov esi, dword [ebp]
mov eax, dword [str.___r_n]
not ecx
dec ecx
mov edi, edx
add ecx, esi
mov dword [ecx + ebx + 2], eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
pop edi
pop esi
pop ebp
lea eax, [ecx + ebx + 6]
pop ebx
add esp, 0x14
ret 8