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

Disassembly:
mov eax, 0x452e6f
call fcn.0044ca14
mov eax, 0x4274
call fcn.0043b380
push ebx
push esi
push edi
mov edi, ecx
xor ebx, ebx
cmp dword [edi + 0x14], ebx
jne 0x40e416
xor eax, eax
push eax
mov eax, edi
lea ecx, [ebp - 0x38]
call fcn.00426250
pop ecx
mov dword [ebp - 4], ebx
cmp dword [eax + 0x18], 0x10
jb 0x40e3c3
mov eax, dword [eax + 4]
jmp 0x40e3c6
add eax, 4
push eax
push str._ServeHttpEx_EMPTY_PATH___s_n
push 8
push dword [0x468678]
call fcn.00429300
or dword [ebp - 4], 0xffffffff
add esp, 0x10
xor edi, edi
push ebx
inc edi
push edi
lea ecx, [ebp - 0x38]
call fcn.004017a5
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.0040e084
pop ecx
push ebx
push edi
mov ecx, esi
call fcn.004017a5
xor al, al
jmp 0x40e67d
cmp dword [edi + 0x18], 8
jb 0x40e421
mov eax, dword [edi + 4]
jmp 0x40e424
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 0x40e491
mov eax, edi
lea ecx, [ebp - 0x38]
call fcn.00426250
pop ecx
xor edi, edi
inc edi
mov dword [ebp - 4], edi
cmp dword [eax + 0x18], 0x10
jb 0x40e460
mov eax, dword [eax + 4]
jmp 0x40e463
add eax, 4
push eax
push str._ServeHttpEx_CANNOT_OPEN_FILE___s_n
push 8
push dword [0x468678]
call fcn.00429300
or dword [ebp - 4], 0xffffffff
add esp, 0x10
push ebx
push edi
lea ecx, [ebp - 0x38]
call fcn.004017a5
push str.HTTP_1.0_404_Cannot_Open_ServeHttpEx__r_n_r_n
jmp 0x40e3f2
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 0x40e4b2
lea eax, [esi - 1]
sub eax, dword [ebp + 0xc]
inc eax
push eax
push str._ServeHttpEx_CONTENTLENGTH___d_n
push 8
push dword [0x468678]
mov dword [ebp - 0x18], eax
call fcn.00429300
add esp, 0x10
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0x458f9c
mov ecx, edi
call fcn.0040eaba
inc eax
push eax
lea eax, [ebp - 0x38]
push eax
mov ecx, edi
call fcn.0040eae2
push ebx
lea ecx, [ebp - 0x58]
mov dword [ebp - 4], 2
call fcn.00426250
pop ecx
xor edi, edi
push ebx
inc edi
push edi
lea ecx, [ebp - 0x38]
call fcn.004018a6
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.0040e0ec
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.0040e084
pop ecx
push ebx
push edi
mov ecx, esi
call fcn.004017a5
mov dword [ebp - 0x14], edi
xor esi, esi
mov eax, dword [ebp - 0x18]
cmp esi, eax
jge 0x40e61b
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 0x40e5f3
push dword [ebp - 0x14]
push str._ServeHttpEx_PREPARE_TO_SENT_file___d_n
push 8
push dword [0x468678]
call fcn.00429300
push dword [ebp - 0x14]
lea ecx, [ebp - 0x4280]
push dword [ebp + 0x14]
call fcn.0040dffc
add esp, 0x18
cmp eax, dword [ebp - 0x14]
jne 0x40e602
add esi, eax
cmp dword [ebp - 0x14], ebx
jg 0x40e58b
jmp 0x40e61b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str._ServeHttpEx_read_file_fail_after__d_bytes__err:__d_n
jmp 0x40e60b
push eax
push dword [ebp - 0x14]
push str._ServeHttpEx___d_NEED_TO_BE_SENT___d_SENT_AT_LAST_n
push 8
push dword [0x468678]
call fcn.00429300
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 [0x468678]
call fcn.00429300
push dword [ebp - 0x18]
push esi
push str._ServeHttpEx___d____d_SENT_TOTALLY_n
push 8
push dword [0x468678]
call fcn.00429300
add esp, 0x20
cmp esi, dword [ebp - 0x18]
lea eax, [ebp - 0x274]
sete byte [ebp - 0xd]
cmp dword [ebp - 0x278], eax
je 0x40e670
push dword [ebp - 0x278]
call fcn.0043b75d
pop ecx
push ebx
push edi
lea ecx, [ebp - 0x58]
call fcn.004017a5
mov al, byte [ebp - 0xd]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret