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

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
push edi
mov edi, ecx
xor ebx, ebx
mov dword [esp + 0x24], edi
mov dword [esp + 0x10], ebx
mov eax, dword [edi + 0x60]
mov dword [esp + 0x14], ebx
cmp eax, ebx
jbe 0x4036d2
mov eax, dword [edi + 0x5c]
mov esi, dword [eax]
cmp esi, eax
je 0x4036d2
mov ecx, dword [esi + 8]
call fcn.00403910
mov ecx, dword [esp + 0x14]
mov esi, dword [esi]
add ecx, eax
mov eax, dword [edi + 0x5c]
cmp esi, eax
mov dword [esp + 0x14], ecx
jne 0x4036b7
mov ebp, dword [esp + 0x2c]
cmp dword [ebp], 0
je 0x4036e8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
ret 8
mov eax, dword [esp + 0x14]
inc eax
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 [edi + 0x60]
test eax, eax
jbe 0x40389b
mov edi, dword [edi + 0x5c]
mov eax, dword [edi]
cmp eax, edi
mov dword [esp + 0x18], eax
je 0x40389b
jmp 0x40372a
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x2c]
mov ebx, dword [esp + 0x10]
mov esi, dword [eax + 8]
mov ebp, dword [ebp]
add ebp, ebx
mov al, byte [esi + 0x20]
mov ecx, dword [esi + 0x14]
test al, al
mov dword [esp + 0x20], ebp
je 0x403831
mov edx, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
test ecx, ecx
jne 0x403750
mov ecx, edx
mov eax, dword [esi + 4]
test eax, eax
jne 0x403759
mov eax, edx
mov edi, dword [esp + 0x30]
push ecx
push eax
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 + 0x18]
repne scasb al, byte es:[edi]
not ecx
dec ecx
add ecx, edx
mov edx, dword [esi + 8]
mov esi, dword [esi + 0x14]
test esi, esi
lea ebx, [ecx + edx + 0x3c]
jne 0x403792
mov esi, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocStringLen
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
test esi, esi
je 0x403872
cmp esi, 0xffffffff
je 0x403872
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x1c], eax
xor edi, edi
lea eax, [esp + 0x14]
push edi
add ebp, ebx
push eax
push 0x400
push ebp
push esi
mov dword [esp + 0x28], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x403815
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x403815
cmp edi, dword [esp + 0x1c]
ja 0x403815
add edi, eax
lea ecx, [esp + 0x14]
push 0
push ecx
lea edx, [edi + ebp]
push 0x400
push edx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4037ea
mov ecx, dword [esp + 0x20]
mov ax, word [0x5b477c]
add edi, ebx
push esi
mov word [edi + ecx], ax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ebx, [edi + 2]
jmp 0x403872
mov edx, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
test ecx, ecx
jne 0x40383d
mov ecx, edx
mov eax, dword [esi + 4]
test eax, eax
jne 0x403846
mov eax, edx
mov edi, dword [esp + 0x30]
push ecx
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 + 8]
repne scasb al, byte es:[edi]
mov eax, dword [esi + 0x18]
not ecx
dec ecx
add ecx, eax
lea ebx, [ecx + edx + 0x31]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x10]
mov eax, dword [eax]
mov edx, dword [ecx + 0x5c]
add esi, ebx
cmp eax, edx
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], eax
jne 0x40371e
mov ebp, dword [esp + 0x2c]
mov ebx, esi
mov edx, dword [ebp]
mov ax, word [0x5b4740]
or ecx, 0xffffffff
mov word [edx + ebx], ax
mov edx, dword [esp + 0x30]
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 [0x5b4738]
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, 0x18
ret 8