Function at 0x401654
Capabilities:
Encode data using xor
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1001c
call fcn.00404e38
push edi
push esi
push ebx
mov dword [ebp - 0x10004], 0
mov dword [ebp - 0x10008], 0
mov edx, 0x401640
mov esi, dword [ebp + 8]
mov edi, edx
mov ecx, 2
cld
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x401692
sbb eax, eax
or al, 1
mov dword [ebp - 0x10010], edx
test eax, eax
je 0x4016c0
add esp, 0xfffffff8
push 0x401642
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_fopen
mov dword [ebp - 0x1000c], eax
add esp, 0x10
test eax, eax
jne 0x4016d5
jmp 0x401803
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [ebp - 0x1000c], eax
mov dword [0x407080], 1
add esp, 0xfffffff4
add esp, 0xfffffff4
mov eax, dword [ebp - 0x1000c]
push eax
call sub.msvcrt.dll__fileno
push eax
call sub.msvcrt.dll__isatty
add esp, 0x20
test eax, eax
jne 0x401717
add esp, 0xfffffff8
push 0x8000
add esp, 0xfffffff4
mov eax, dword [ebp - 0x1000c]
push eax
call sub.msvcrt.dll__fileno
add esp, 0x10
push eax
call sub.msvcrt.dll__setmode
add esp, 0x10
lea esi, [ebp - 0x10000]
jmp 0x40175a
mov ebx, esi
add dword [ebp - 0x10008], ecx
sub ecx, 1
jb 0x40175a
mov edi, 0x401240
mov edx, dword [ebp - 0x10004]
shl edx, 8
shr dword [ebp - 0x10004], 0x18
movzx eax, byte [ebx]
xor eax, dword [ebp - 0x10004]
xor edx, dword [edi + eax*4]
mov dword [ebp - 0x10004], edx
inc ebx
sub ecx, 1
jae 0x401732
mov eax, dword [ebp - 0x1000c]
push eax
push 0x10000
push 1
push esi
call sub.msvcrt.dll_fread
mov ecx, eax
add esp, 0x10
test ecx, ecx
jg 0x401720
add esp, 0xfffffff4
mov eax, dword [ebp - 0x1000c]
push eax
call sub.msvcrt.dll_ferror
add esp, 0x10
test eax, eax
je 0x4017d5
mov eax, dword [ebp + 8]
push eax
push 0x401644
call sub.msvcrt.dll__errno
push dword [eax]
push 0
call fcn.004048c8
mov esi, dword [ebp + 8]
mov edi, dword [ebp - 0x10010]
mov ecx, 2
cld
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x4017bd
sbb eax, eax
or al, 1
add esp, 0x10
test eax, eax
je 0x40181a
add esp, 0xfffffff4
mov eax, dword [ebp - 0x1000c]
push eax
call sub.msvcrt.dll_fclose
jmp 0x40181a
mov esi, dword [ebp + 8]
mov edi, dword [ebp - 0x10010]
mov ecx, 2
cld
test al, 0
repe cmpsb byte [esi], byte es:[edi]
je 0x401824
add esp, 0xfffffff4
mov eax, dword [ebp - 0x1000c]
push eax
call sub.msvcrt.dll_fclose
mov ebx, eax
add esp, 0x10
cmp ebx, 0xffffffff
jne 0x401824
mov eax, dword [ebp + 8]
push eax
push 0x401644
call sub.msvcrt.dll__errno
push dword [eax]
push 0
call fcn.004048c8
mov eax, 0xffffffff
jmp 0x4018a6
mov ecx, dword [ebp - 0x10008]
test ecx, ecx
jle 0x40185c
mov ebx, 0x401240
mov edx, dword [ebp - 0x10004]
shl edx, 8
mov eax, dword [ebp - 0x10004]
shr eax, 0x18
xor eax, ecx
and eax, 0xff
xor edx, dword [ebx + eax*4]
mov dword [ebp - 0x10004], edx
sar ecx, 8
test ecx, ecx
jg 0x401833
not dword [ebp - 0x10004]
add esp, 0xfffffffc
mov eax, dword [ebp - 0x10008]
push eax
mov eax, dword [ebp - 0x10004]
push eax
push 0x401647
call sub.msvcrt.dll_printf
add esp, 0x10
cmp dword [ebp + 0xc], 0
je 0x40189a
add esp, 0xfffffff8
mov eax, dword [ebp + 8]
push eax
push 0x40164f
call sub.msvcrt.dll_printf
add esp, 0x10
add esp, 0xfffffff4
push 0xa
call sub.msvcrt.dll_putchar
xor eax, eax
lea esp, [ebp - 0x10028]
pop ebx
pop esi
pop edi
leave
ret