Function at 0x4013a0
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x1024
call fcn.0040e020
push ebx
push ebp
push esi
mov ebx, dword [esp + 0x1034]
push edi
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
push ebx
stosb byte es:[edi], al
call fcn.00401260
add esp, 4
test eax, eax
jne 0x4013e1
push ebx
call fcn.00401730
add esp, 4
test eax, eax
je 0x40167c
mov esi, dword [sym.imp.MSVCRT.dll__filelength]
push ebx
mov dword [esp + 0x24], 0x1000
call esi
add esp, 4
cmp eax, 0x1000
jge 0x40145c
push ebx
call esi
push 0
mov esi, eax
push 0
push ebx
mov dword [esp + 0x30], esi
call dword [sym.imp.MSVCRT.dll__lseek]
add esp, 0x10
cmp eax, 0xffffffff
je 0x40167c
lea eax, [esp + 0x24]
push esi
push eax
push ebx
call dword [sym.imp.MSVCRT.dll__read]
add esp, 0xc
cmp eax, esi
jne 0x40167c
push eax
lea ecx, [esp + 0x28]
push 0x413d34
push ecx
call fcn.004017f0
add esp, 0xc
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], 0x413d34
jmp 0x401508
mov esi, dword [sym.imp.MSVCRT.dll__lseek]
push 0
push 0
push ebx
call esi
add esp, 0xc
cmp eax, 0xffffffff
je 0x40167c
mov ebp, dword [sym.imp.MSVCRT.dll__read]
lea edx, [esp + 0x24]
push 0x1000
push edx
push ebx
call ebp
add esp, 0xc
cmp eax, 0x1000
jne 0x40167c
push eax
lea eax, [esp + 0x28]
push 0x413d34
push eax
call fcn.004017f0
mov dword [esp + 0x28], eax
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x30]
rep stosd dword es:[edi], eax
push 2
push 0xfffff000
push ebx
stosb byte es:[edi], al
call esi
add esp, 0x18
cmp eax, 0xffffffff
je 0x40167c
lea ecx, [esp + 0x24]
push 0x1000
push ecx
push ebx
call ebp
add esp, 0xc
cmp eax, 0x1000
jne 0x40167c
push eax
lea edx, [esp + 0x28]
push 0x414d34
push edx
mov dword [esp + 0x20], 0x414d34
call fcn.004017f0
add esp, 0xc
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], 0
mov ebp, 0x41203b
cmp word [ebp + 6], 0
je 0x401661
mov eax, dword [esp + 0x1038]
xor ebx, ebx
mov bx, word [ebp + 6]
push eax
call dword [sym.imp.MSVCRT.dll__filelength]
add esp, 4
cmp eax, ebx
jl 0x401661
mov ax, word [ebp + 0x72]
mov ecx, dword [0x415d38]
cmp ax, 0x10
jne 0x401558
cmp ecx, dword [ebp]
jne 0x401661
cmp ax, 0x11
jne 0x40157d
mov eax, dword [ebp]
lea edx, [ecx - 0x1000]
cmp eax, edx
jl 0x401661
add ecx, 0x1000
cmp eax, ecx
jg 0x401661
cmp word [ebp + 0x6e], 1
movsx eax, word [ebp + 8]
jne 0x4015ff
sub eax, 0
je 0x4015b5
dec eax
jne 0x4015de
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x24]
mov esi, dword [esp + 0x14]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x18]
stosb byte es:[edi], al
mov eax, ecx
lea edi, [esp + 0x24]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
jmp 0x4015d9
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x24]
mov esi, 0x413d34
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x1c]
stosb byte es:[edi], al
mov edx, ecx
lea edi, [esp + 0x24]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x20]
lea eax, [ebp + 0xa]
push ebx
push eax
lea edx, [esp + 0x2c]
push ecx
push edx
call fcn.00401840
add esp, 0x10
test eax, eax
jne 0x401689
jmp 0x401661
sub eax, 0
je 0x40162f
dec eax
jne 0x401652
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
movsx ecx, word [ebp + 4]
stosb byte es:[edi], al
mov eax, dword [esp + 0x18]
sub eax, ecx
js 0x401652
mov edx, dword [esp + 0x14]
mov ecx, 0x19
lea esi, [edx + eax]
jmp 0x40164c
movsx esi, word [ebp + 4]
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x24]
add esi, 0x413d34
rep stosd dword es:[edi], eax
stosb byte es:[edi], al
mov ecx, 0x19
lea edi, [esp + 0x24]
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edi, [ebp + 0xa]
lea esi, [esp + 0x24]
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x401690
mov edx, dword [esp + 0x10]
add ebp, 0xaa
inc edx
cmp ebp, 0x4128dd
mov dword [esp + 0x10], edx
jl 0x401515
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1024
ret
mov byte [0x415d35], 1
mov ecx, dword [esp + 0x10]
mov eax, ecx
shl eax, 4
add eax, ecx
lea eax, [eax + eax*4]
shl eax, 1
cmp word [eax + 0x4120a9], 1
jne 0x4016b1
mov byte [0x415d35], 1
mov edi, dword [0x4164bc]
lea edx, [eax + 0x412022]
movsx ecx, word [eax + 0x4120af]
inc edi
mov dword [0x413c18], ecx
mov dword [0x4164bc], edi
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, 0x413c1c
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]
not ecx
sub edi, ecx
mov eax, 1
mov edx, ecx
mov esi, edi
mov edi, 0x417c40
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1024
ret