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

Disassembly:
push 0x2c
mov eax, 0x4dbe19
call fcn.004bb7e0
and dword [ebp - 4], 0
and dword [ebp - 0x14], 0
mov ebx, dword [ebp + 8]
push 0x5311f0
mov ecx, ebx
call fcn.00401749
mov esi, dword [ebp + 0xc]
and dword [ebp - 4], 0
mov eax, dword [esi]
xor edx, edx
inc edx
cmp dword [eax - 0xc], 0
mov ecx, edx
push 3
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x14], ecx
pop edi
je 0x40847e
push 0x4e504c
mov ecx, esi
call fcn.004035cd
test eax, eax
je 0x40847b
lea eax, [ebp - 0x20]
push eax
call fcn.00409ceb
pop ecx
push dword [eax]
mov ecx, edi
mov dword [ebp - 0x14], ecx
mov ecx, esi
mov dword [ebp - 4], 1
call fcn.004035cd
test eax, eax
je 0x40847b
xor dl, dl
mov dword [ebp - 0x18], edx
jmp 0x40847e
xor edx, edx
inc edx
mov eax, dword [ebp - 0x14]
and dword [ebp - 4], 0
test al, 2
je 0x40849d
mov ecx, dword [ebp - 0x20]
and eax, 0xfffffffd
lea ecx, [ecx - 0x10]
mov dword [ebp - 0x14], eax
call fcn.00404c8b
mov edx, dword [ebp - 0x18]
test dl, dl
je 0x4084ca
lea eax, [ebp - 0x20]
push eax
call fcn.00409ceb
pop ecx
mov dword [ebp - 4], 2
push eax
mov ecx, ebx
call fcn.00401cd3
mov ecx, dword [ebp - 0x20]
lea ecx, [ecx - 0x10]
call fcn.00404c8b
jmp 0x4086cd
push 0
push 0
push edi
push 0
push 0
push SysReAllocStringLen
push dword [esi]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x18], esi
cmp esi, 0xffffffff
jne 0x4084f9
lea eax, [ebp - 0x20]
push eax
call fcn.00409ceb
pop ecx
mov dword [ebp - 4], edi
jmp 0x4084b2
push 8
lea eax, [ebp - 0x2c]
push 0
push eax
call fcn.004bc640
add esp, 0xc
lea eax, [ebp - 0x2c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x408541
lea eax, [ebp - 0x20]
push eax
call fcn.00409ceb
pop ecx
mov dword [ebp - 4], 4
push eax
mov ecx, ebx
call fcn.00401cd3
mov ecx, dword [ebp - 0x20]
lea ecx, [ecx - 0x10]
call fcn.00404c8b
jmp 0x4086c6
cmp dword [ebp - 0x28], 0
je 0x40855a
lea eax, [ebp - 0x20]
push eax
call fcn.00409ceb
pop ecx
mov dword [ebp - 4], 5
jmp 0x408529
cmp dword [ebp - 0x2c], 0
je 0x4086c6
xor eax, eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], eax
push dword [ebp - 0x2c]
lea ecx, [ebp - 0x38]
mov dword [ebp - 4], 6
call fcn.0040889f
mov edi, dword [ebp - 0x38]
and dword [ebp - 0x24], 0
push 0
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x2c]
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4085aa
lea ecx, [ebp - 0x38]
call fcn.00460ac7
jmp 0x4086c6
xor eax, eax
mov byte [ebp + 0xf], al
mov byte [ebp - 0xd], al
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0xd]
push eax
lea eax, [ebp + 0xf]
push eax
push edi
call fcn.00409ba8
mov eax, dword [ebp - 0x1c]
add esp, 0x10
test eax, eax
jle 0x4085e4
add eax, edi
push eax
push edi
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x38]
call fcn.0040881c
mov edi, dword [ebp - 0x38]
cmp byte [ebp - 0xd], 0
mov esi, dword [ebp - 0x34]
je 0x408616
call fcn.0040887d
test al, al
jne 0x4085fc
dec dword [0x532ad4]
mov ecx, edi
cmp edi, esi
je 0x408616
mov dl, byte [ecx]
mov bl, byte [ecx + 1]
mov byte [ecx + 1], dl
mov byte [ecx], bl
add ecx, 2
cmp ecx, esi
jne 0x408602
mov ebx, dword [ebp + 8]
sub esi, edi
cmp byte [edi + esi - 1], 0
je 0x40864b
inc esi
push esi
lea ecx, [ebp - 0x38]
call fcn.0040889f
mov edi, dword [ebp - 0x38]
mov byte [edi + esi - 1], 0
cmp byte [ebp + 0xf], 0
je 0x40868e
inc esi
push esi
lea ecx, [ebp - 0x38]
call fcn.0040889f
mov edi, dword [ebp - 0x38]
mov byte [edi + esi - 1], 0
jmp 0x408666
cmp byte [ebp + 0xf], 0
je 0x40868e
lea eax, [esi + 2]
push eax
lea ecx, [ebp - 0x38]
call fcn.0040889f
mov edi, dword [ebp - 0x38]
mov word [edi + esi], 0
cmp byte [ebp + 0xf], 0
je 0x40868e
push edi
lea ecx, [ebp - 0x20]
call fcn.00401855
push eax
mov ecx, ebx
mov byte [ebp - 4], 7
call fcn.00401cd3
mov ecx, dword [ebp - 0x20]
lea ecx, [ecx - 0x10]
call fcn.00404c8b
jmp 0x4086bb
push edi
lea ecx, [ebp - 0x20]
call fcn.00407e53
push eax
mov ecx, ebx
mov byte [ebp - 4], 8
call fcn.00401cd3
mov ecx, dword [ebp - 0x20]
mov byte [ebp - 4], 6
lea ecx, [ecx - 0x10]
call fcn.00404c8b
push ebx
push ebx
call fcn.0040904a
pop ecx
pop ecx
lea ecx, [ebp - 0x38]
call fcn.00460ac7
mov esi, dword [ebp - 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
call fcn.004bb7ae
ret