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

Disassembly:
mov eax, 0x452b67
call fcn.0044c764
mov eax, 0x4274
call fcn.0043b0f0
push ebx
push esi
push edi
mov edi, ecx
xor ebx, ebx
cmp dword [edi + 0x14], ebx
jne 0x40e093
xor eax, eax
push eax
mov eax, edi
lea ecx, [ebp - 0x38]
call fcn.0042619d
pop ecx
mov dword [ebp - 4], ebx
cmp dword [eax + 0x18], 0x10
jb 0x40e040
mov eax, dword [eax + 4]
jmp 0x40e043
add eax, 4
push eax
push str._ServeHttpEx_EMPTY_PATH___s_n
push 8
push dword [0x467478]
call fcn.00429210
or dword [ebp - 4], 0xffffffff
add esp, 0x10
xor edi, edi
push ebx
inc edi
push edi
lea ecx, [ebp - 0x38]
call fcn.004017a7
push str.HTTP_1.0_404_Not_Found_ServeHttpEx__r_n_r_n
lea ecx, [ebp - 0x38]
call fcn.0040162e
push dword [ebp + 0x14]
lea esi, [ebp - 0x38]
call fcn.0040dd01
pop ecx
push ebx
push edi
mov ecx, esi
call fcn.004017a7
xor al, al
jmp 0x40e2fa
cmp dword [edi + 0x18], 8
jb 0x40e09e
mov eax, dword [edi + 4]
jmp 0x40e0a1
lea eax, [edi + 4]
push ebx
push 0x80
push 3
push ebx
push 5
push accept
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x1c], eax
push ebx
cmp eax, 0xffffffff
jne 0x40e10e
mov eax, edi
lea ecx, [ebp - 0x38]
call fcn.0042619d
pop ecx
xor edi, edi
inc edi
mov dword [ebp - 4], edi
cmp dword [eax + 0x18], 0x10
jb 0x40e0dd
mov eax, dword [eax + 4]
jmp 0x40e0e0
add eax, 4
push eax
push str._ServeHttpEx_CANNOT_OPEN_FILE___s_n
push 8
push dword [0x467478]
call fcn.00429210
or dword [ebp - 4], 0xffffffff
add esp, 0x10
push ebx
push edi
lea ecx, [ebp - 0x38]
call fcn.004017a7
push str.HTTP_1.0_404_Cannot_Open_ServeHttpEx__r_n_r_n
jmp 0x40e06f
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push ebx
push ebx
push dword [ebp + 0xc]
mov esi, eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp + 0x10]
cmp eax, ebx
jne 0x40e12f
lea eax, [esi - 1]
sub eax, dword [ebp + 0xc]
inc eax
push eax
push str._ServeHttpEx_CONTENTLENGTH___d_n
push 8
push dword [0x467478]
mov dword [ebp - 0x18], eax
call fcn.00429210
add esp, 0x10
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0x457f94
mov ecx, edi
call fcn.0040e737
inc eax
push eax
lea eax, [ebp - 0x38]
push eax
mov ecx, edi
call fcn.0040e75f
push ebx
lea ecx, [ebp - 0x58]
mov dword [ebp - 4], 2
call fcn.0042619d
pop ecx
xor edi, edi
push ebx
inc edi
push edi
lea ecx, [ebp - 0x38]
call fcn.004018a8
lea eax, [ebp - 0x274]
mov dword [ebp - 0x280], ebx
mov dword [ebp - 0x27c], 0x200
mov dword [ebp - 0x278], eax
lea eax, [ebp - 0x280]
push eax
sub esp, 0x1c
lea eax, [ebp - 0x58]
mov ecx, esp
mov dword [ebp - 0x3c], esp
push eax
mov byte [ebp - 4], 5
call fcn.00401650
push dword [ebp + 8]
mov ecx, dword [ebp - 0x18]
push esi
push dword [ebp + 0xc]
call fcn.0040dd69
mov ecx, dword [ebp - 0x280]
mov eax, dword [ebp - 0x278]
add esp, 0x2c
mov byte [eax + ecx], bl
push dword [ebp - 0x278]
lea ecx, [ebp - 0x74]
call fcn.0040162e
push dword [ebp + 0x14]
lea esi, [ebp - 0x74]
call fcn.0040dd01
pop ecx
push ebx
push edi
mov ecx, esi
call fcn.004017a7
mov dword [ebp - 0x14], edi
xor esi, esi
mov eax, dword [ebp - 0x18]
cmp esi, eax
jge 0x40e298
sub eax, esi
mov ecx, 0x4000
cmp eax, ecx
cmovg eax, ecx
push ebx
lea ecx, [ebp - 0x14]
push ecx
push eax
lea eax, [ebp - 0x4280]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40e270
push dword [ebp - 0x14]
push str._ServeHttpEx_PREPARE_TO_SENT_file___d_n
push 8
push dword [0x467478]
call fcn.00429210
push dword [ebp - 0x14]
lea ecx, [ebp - 0x4280]
push dword [ebp + 0x14]
call fcn.0040dc79
add esp, 0x18
cmp eax, dword [ebp - 0x14]
jne 0x40e27f
add esi, eax
cmp dword [ebp - 0x14], ebx
jg 0x40e208
jmp 0x40e298
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str._ServeHttpEx_read_file_fail_after__d_bytes__err:__d_n
jmp 0x40e288
push eax
push dword [ebp - 0x14]
push str._ServeHttpEx___d_NEED_TO_BE_SENT___d_SENT_AT_LAST_n
push 8
push dword [0x467478]
call fcn.00429210
add esp, 0x14
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str._ServeHttpEx_FILE_HANDLE_CLOSED_AFTER_SENDING_n
push 8
push dword [0x467478]
call fcn.00429210
push dword [ebp - 0x18]
push esi
push str._ServeHttpEx___d____d_SENT_TOTALLY_n
push 8
push dword [0x467478]
call fcn.00429210
add esp, 0x20
cmp esi, dword [ebp - 0x18]
lea eax, [ebp - 0x274]
sete byte [ebp - 0xd]
cmp dword [ebp - 0x278], eax
je 0x40e2ed
push dword [ebp - 0x278]
call fcn.0043b4cd
pop ecx
push ebx
push edi
lea ecx, [ebp - 0x58]
call fcn.004017a7
mov al, byte [ebp - 0xd]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret