Function at 0x40e5e6
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x154
mov eax, dword [0x410004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov eax, edx
mov dword [ebp - 0x150], eax
push esi
push edi
test eax, eax
je 0x40e6d4
mov esi, 0x4106e0
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40e618
push 5
sub ecx, edx
pop eax
cmp ecx, eax
jb 0x40e6d4
lea eax, [ecx + 0x4106dc]
push eax
push 0x4045a0
call dword [sym.imp.msvcrt.dll__stricmp]
pop ecx
pop ecx
test eax, eax
jne 0x40e6d4
push 0x8000
push esi
call dword [sym.imp.msvcrt.dll__open]
mov edi, eax
pop ecx
pop ecx
cmp edi, 0xffffffff
je 0x40e6d4
push 0xc
lea eax, [ebp - 0x140]
push eax
push edi
call dword [sym.imp.msvcrt.dll__read]
add esp, 0xc
cmp eax, 0xc
jne 0x40e6cc
mov ecx, dword [ebp - 0x13c]
movzx eax, cl
shl ax, 8
shr ecx, 8
movzx edx, ax
movzx eax, cl
push 0
or edx, eax
pop ebx
mov dword [ebp - 0x144], edx
mov esi, ebx
jbe 0x40e6cc
cmp esi, 0x28
jae 0x40e6cc
push 0x10
lea eax, [ebp - 0x124]
push eax
push edi
call dword [sym.imp.msvcrt.dll__read]
add esp, 0xc
cmp eax, 0x10
jne 0x40e6cc
cmp dword [ebp - 0x124], 0x656d616e
je 0x40e6e7
inc esi
cmp esi, dword [ebp - 0x144]
jb 0x40e69a
push edi
call dword [sym.imp.msvcrt.dll__close]
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040f060
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x11c]
mov esi, ecx
mov eax, ecx
and esi, 0xff0000
shr eax, 0x10
or esi, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shr esi, 8
shl eax, 8
or esi, eax
push ebx
push esi
push edi
call dword [sym.imp.msvcrt.dll__lseek]
add esp, 0xc
cmp eax, esi
jne 0x40e6cc
push 6
lea eax, [ebp - 0x14c]
push eax
push edi
call dword [sym.imp.msvcrt.dll__read]
add esp, 0xc
cmp eax, 6
jne 0x40e6cc
mov ecx, dword [ebp - 0x14a]
movzx eax, cl
shl ax, 8
shr ecx, 8
movzx esi, ax
movzx eax, cl
or esi, eax
je 0x40e6cc
push 0xc
lea eax, [ebp - 0x114]
dec esi
push eax
push edi
call dword [sym.imp.msvcrt.dll__read]
add esp, 0xc
cmp eax, 0xc
jne 0x40e6cc
mov ecx, dword [ebp - 0x114]
mov eax, ecx
shr eax, 8
movzx edx, al
movzx eax, cl
shl ax, 8
or dx, ax
xor eax, eax
inc eax
cmp dx, ax
jne 0x40e7b4
mov ecx, dword [ebp - 0x10e]
mov eax, ecx
shr eax, 8
movzx edx, al
movzx eax, cl
shl ax, 8
or dx, ax
push 5
pop eax
cmp dx, ax
je 0x40e7bd
test esi, esi
jne 0x40e757
jmp 0x40e6cc
mov ecx, dword [ebp - 0x11c]
mov esi, ecx
mov dx, word [ebp - 0x148]
mov eax, ecx
shr eax, 0x10
and esi, 0xff0000
or esi, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shr esi, 8
shl eax, 8
or esi, eax
movzx eax, dl
shl ax, 8
movzx ecx, ax
shr dx, 8
movzx eax, dl
mov dx, word [ebp - 0x10a]
or ecx, eax
movzx eax, dl
add esi, ecx
shl ax, 8
movzx ecx, ax
shr dx, 8
movzx eax, dl
or ecx, eax
add esi, ecx
mov ecx, dword [ebp - 0x10c]
movzx eax, cl
shl ax, 8
movzx edx, ax
shr ecx, 8
push ebx
movzx eax, cl
or edx, eax
push esi
push edi
mov dword [ebp - 0x144], edx
call dword [sym.imp.msvcrt.dll__lseek]
add esp, 0xc
cmp eax, esi
jne 0x40e6cc
mov esi, dword [ebp - 0x144]
cmp esi, 0xff
ja 0x40e6cc
push esi
lea eax, [ebp - 0x108]
push eax
push edi
call dword [sym.imp.msvcrt.dll__read]
add esp, 0xc
cmp eax, esi
jne 0x40e6cc
cmp esi, 0x100
jae 0x40e8ee
push edi
mov byte [ebp + esi - 0x108], bl
call dword [sym.imp.msvcrt.dll__close]
mov edi, 0x404594
lea eax, [ebp - 0x108]
push edi
push eax
call dword [sym.imp.msvcrt.dll_strpbrk]
mov esi, eax
add esp, 0xc
test esi, esi
je 0x40e8de
push esi
call dword [sym.imp.msvcrt.dll_atol]
mov ebx, eax
push edi
push esi
shl ebx, 0x10
call dword [sym.imp.msvcrt.dll_strspn]
add esp, 0xc
cmp byte [esi + eax], 0x2e
jne 0x40e8de
inc eax
add eax, esi
push eax
call dword [sym.imp.msvcrt.dll_atol]
and eax, 0xffff
pop ecx
add ebx, eax
mov ecx, dword [ebp - 0x150]
xor eax, eax
inc eax
mov dword [ecx], ebx
jmp 0x40e6d6
call fcn.0040f1b9
int3