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

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
mov esi, ecx
xor ebx, ebx
mov dword [esp + 0x20], esi
mov dword [esp + 0xc], ebx
call fcn.00406550
mov ebp, dword [esp + 0x28]
inc eax
cmp dword [ebp], 0
je 0x40661d
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x18
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 + 0x60]
test eax, eax
jbe 0x4067c9
mov esi, dword [esi + 0x5c]
mov eax, dword [esi]
cmp eax, esi
mov dword [esp + 0x18], eax
je 0x4067c9
jmp 0x406657
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x2c]
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 0x40675f
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 0x40667d
mov ecx, edx
mov eax, dword [esi + 4]
test eax, eax
jne 0x406686
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]
mov eax, dword [esi + 8]
mov esi, dword [esi + 0x14]
not ecx
dec ecx
add ecx, edx
test esi, esi
lea ebx, [ecx + eax + 0x3c]
jne 0x4066bf
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 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
test esi, esi
je 0x4067a0
cmp esi, 0xffffffff
je 0x4067a0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
xor edi, edi
lea ecx, [esp + 0x14]
push edi
add ebp, ebx
push ecx
push 0x400
push ebp
push esi
mov dword [esp + 0x30], eax
mov dword [esp + 0x28], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x406742
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x406742
cmp edi, dword [esp + 0x1c]
ja 0x406742
add edi, eax
lea edx, [esp + 0x14]
push 0
push edx
lea eax, [edi + ebp]
push 0x400
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x406717
mov edx, dword [esp + 0x20]
mov cx, word [0x411ff4]
add edi, ebx
push esi
mov word [edi + edx], cx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ebx, [edi + 2]
jmp 0x4067a0
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 0x40676b
mov ecx, edx
mov eax, dword [esi + 4]
test eax, eax
jne 0x406774
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
repne scasb al, byte es:[edi]
mov eax, dword [esi + 0x18]
not ecx
dec ecx
add ecx, eax
mov eax, dword [esi + 8]
lea ebx, [ecx + eax + 0x31]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
add edx, ebx
mov eax, dword [ecx]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x18], eax
cmp eax, dword [edx + 0x5c]
jne 0x40664f
mov ebp, dword [esp + 0x2c]
mov eax, dword [ebp]
mov cx, word [0x411fb8]
mov edx, dword [esp + 0x30]
mov word [eax + ebx], cx
mov edi, edx
or ecx, 0xffffffff
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, 0x18
ret 8