Function at 0x40e470
Capabilities:
Get file size
Read file on windows
Read pipe

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x506719
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
push ebx
push esi
push edi
mov eax, dword [0x565680]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x14], 0
mov eax, dword [0x5651b8]
mov ecx, 0x5651b8
mov dword [ebp - 4], 0
call dword [eax + 0xc]
mov edi, dword [ebp + 8]
add eax, 0x10
mov dword [edi], eax
mov esi, dword [ebp + 0xc]
mov dword [ebp - 4], 0
mov eax, dword [esi]
mov dword [ebp - 0x14], 1
cmp dword [eax - 0xc], 0
je 0x40e578
mov ecx, 0x51781c
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40e506
test dx, dx
je 0x40e502
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40e506
add eax, 4
add ecx, 4
test dx, dx
jne 0x40e4e0
xor eax, eax
jmp 0x40e50b
sbb eax, eax
or eax, 1
test eax, eax
sete al
test al, al
jne 0x40e578
lea eax, [ebp - 0x20]
push eax
call fcn.0040d6f0
mov ecx, dword [eax]
xor eax, eax
add esp, 4
test ecx, ecx
setne al
mov dword [ebp - 0x14], 3
test eax, eax
jne 0x40e53e
push 0x80004005
call fcn.00402fc0
mov eax, dword [esi]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40e566
test dx, dx
je 0x40e562
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40e566
add eax, 4
add ecx, 4
test dx, dx
jne 0x40e540
xor eax, eax
jmp 0x40e56b
sbb eax, eax
or eax, 1
test eax, eax
sete al
mov byte [ebp - 0xe], 0
test al, al
je 0x40e57c
mov byte [ebp - 0xe], 1
mov eax, dword [ebp - 0x14]
or ebx, 0xffffffff
test al, 2
je 0x40e5a8
mov edx, dword [ebp - 0x20]
and eax, 0xfffffffd
add edx, 0xfffffff0
mov dword [ebp - 0x14], eax
lea eax, [edx + 0xc]
mov ecx, ebx
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40e5a8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp byte [ebp - 0xe], 0
je 0x40e64c
lea eax, [ebp - 0x18]
push eax
call fcn.0040d6f0
add esp, 4
mov dword [ebp - 4], 1
mov ecx, dword [eax]
mov esi, dword [edi]
lea edx, [ecx - 0x10]
sub esi, 0x10
cmp edx, esi
je 0x40e616
cmp dword [esi + 0xc], 0
jl 0x40e60b
mov eax, dword [edx]
cmp eax, dword [esi]
jne 0x40e60b
push edx
call fcn.004053a0
add esp, 4
mov dword [ebp - 0x20], eax
mov ecx, ebx
lea edx, [esi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40e604
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x20]
add eax, 0x10
mov dword [edi], eax
jmp 0x40e616
push dword [ecx - 0xc]
push ecx
mov ecx, edi
call fcn.00409940
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40e8dd
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push 3
push 0
push 0
push SysReAllocStringLen
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
jne 0x40e683
lea eax, [ebp - 0x18]
push eax
call fcn.0040d6f0
add esp, 4
mov dword [ebp - 4], 2
jmp 0x40e5c5
lea ecx, [ebp - 0x2c]
push ecx
xorps xmm0, xmm0
push eax
movq qword [ebp - 0x2c], xmm0
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40e6dc
lea eax, [ebp - 0x18]
push eax
call fcn.0040d6f0
add esp, 4
mov dword [ebp - 4], 3
push eax
mov ecx, edi
call fcn.004026b0
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40e8d4
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40e8d4
cmp dword [ebp - 0x28], 0
je 0x40e6f7
lea eax, [ebp - 0x18]
push eax
call fcn.0040d6f0
add esp, 4
mov dword [ebp - 4], 4
jmp 0x40e6ad
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x40e8d4
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
push eax
lea ecx, [ebp - 0x38]
mov dword [ebp - 4], 5
call fcn.0040edf0
mov esi, dword [ebp - 0x38]
push 0
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x2c]
mov dword [ebp - 0x24], 0
push esi
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40e8c7
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0xf]
push eax
lea eax, [ebp - 0xd]
push eax
push esi
mov byte [ebp - 0xd], 0
mov byte [ebp - 0xf], 0
mov dword [ebp - 0x1c], 0
call fcn.0048ee70
mov eax, dword [ebp - 0x1c]
add esp, 0x10
test eax, eax
jle 0x40e78a
add eax, esi
push eax
push esi
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x38]
call fcn.0040ec90
mov esi, dword [ebp - 0x38]
cmp byte [ebp - 0xf], 0
mov edi, dword [ebp - 0x34]
je 0x40e7b4
mov ecx, esi
cmp esi, edi
je 0x40e7b4
lea esp, [esp]
mov dl, byte [ecx]
mov bl, byte [ecx + 1]
mov byte [ecx + 1], dl
mov byte [ecx], bl
add ecx, 2
cmp ecx, edi
jne 0x40e7a0
or ebx, 0xffffffff
sub edi, esi
cmp byte [esi + edi - 1], 0
je 0x40e814
inc edi
push edi
lea ecx, [ebp - 0x38]
call fcn.0040edf0
mov esi, dword [ebp - 0x38]
mov byte [esi + edi - 1], 0
mov eax, dword [0x566ac0]
imul eax, eax
and eax, 0x8000000f
jns 0x40e7e3
dec eax
or eax, 0xfffffff0
inc eax
cmp eax, 6
jne 0x40e7fa
push 0
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
cmp byte [ebp - 0xd], 0
je 0x40e86d
inc edi
push edi
lea ecx, [ebp - 0x38]
call fcn.0040edf0
mov esi, dword [ebp - 0x38]
mov byte [esi + edi - 1], 0
jmp 0x40e82f
cmp byte [ebp - 0xd], 0
je 0x40e86d
lea eax, [edi + 2]
push eax
lea ecx, [ebp - 0x38]
call fcn.0040edf0
mov esi, dword [ebp - 0x38]
mov word [esi + edi], 0
cmp byte [ebp - 0xd], 0
je 0x40e86d
push esi
lea ecx, [ebp - 0x18]
call fcn.00401ba0
mov edi, dword [ebp + 8]
push eax
mov ecx, edi
mov byte [ebp - 4], 6
call fcn.004026b0
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 5
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40e8c7
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40e8c7
mov eax, dword [0x5651b8]
mov ecx, 0x5651b8
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
push esi
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 7
call fcn.004027b0
mov edi, dword [ebp + 8]
lea eax, [ebp - 0x18]
push eax
mov ecx, edi
mov byte [ebp - 4], 8
call fcn.004026b0
mov edx, dword [ebp - 0x18]
add edx, 0xfffffff0
mov byte [ebp - 4], 5
lea eax, [edx + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x40e8bd
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push edi
push edi
call fcn.0048d330
add esp, 8
test esi, esi
je 0x40e8d4
push esi
call fcn.004e4aa8
add esp, 4
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret