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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x538058
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push esi
push edi
mov eax, dword [0x58a110]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor ebx, ebx
mov dword [ebp - 4], ebx
mov eax, dword [ebp + 8]
mov esi, 8
cmp dword [ebp + 0x1c], esi
jae 0x40167d
lea eax, [ebp + 8]
push 0x566bc0
push eax
call fcn.0050e6b5
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x4016bd
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp + 0x1c], esi
jb 0x4016a9
mov eax, dword [ebp + 8]
push eax
call fcn.0040dabc
add esp, 4
xor eax, eax
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 2
push ebx
push edi
call fcn.0050eaee
push edi
call fcn.0050ecfe
push ebx
push ebx
push edi
mov esi, eax
call fcn.0050eaee
add esp, 0x1c
cmp esi, 0x2faf080
jge 0x401796
push esi
call fcn.0040dac7
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x401721
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp + 0x1c], 8
jb 0x4016a9
mov ecx, dword [ebp + 8]
push ecx
call fcn.0040dabc
add esp, 4
xor eax, eax
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 edi
push esi
push 1
push ebx
call fcn.0050e916
push edi
mov dword [ebp - 0x14], eax
call fcn.0050e9a0
add esp, 0x14
cmp dword [ebp - 0x14], esi
je 0x40175f
lea esi, [ebp + 8]
mov dword [ebp - 4], 0xffffffff
call fcn.00401a10
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, esi
mov esi, ebx
call fcn.004019d0
push ebx
mov edi, eax
call fcn.0040dabc
add esp, 4
lea esi, [ebp + 8]
mov dword [ebp - 4], 0xffffffff
call fcn.00401a10
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 0x2faf080
call fcn.0040dac7
mov esi, eax
add esp, 4
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x14], ebx
cmp esi, ebx
jne 0x4017e0
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp + 0x1c], 8
jb 0x4016a9
mov edx, dword [ebp + 8]
push edx
call fcn.0040dabc
add esp, 4
xor eax, eax
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 edi
call fcn.0050ea14
add esp, 4
test eax, eax
jne 0x40184c
lea ecx, [ecx]
push edi
push 0x2faf080
push 1
push esi
call fcn.0050e916
add esp, 0x10
or ecx, 0xffffffff
cmp ebx, 1
jne 0x40180c
mov ecx, dword [ebp - 0x14]
xor edx, edx
test eax, eax
jle 0x401832
movzx esi, byte [edx + esi]
mov ebx, ecx
and ebx, 0xff
xor esi, ebx
shr ecx, 8
xor ecx, dword [esi*4 + 0x5920a8]
mov esi, dword [ebp - 0x10]
inc edx
cmp edx, eax
jl 0x401812
mov dword [ebp - 0x14], ecx
not ecx
push edi
mov ebx, 1
mov dword [ebp - 0x18], ecx
call fcn.0050ea14
add esp, 4
test eax, eax
je 0x4017f0
push edi
call fcn.0050e9a0
push esi
call fcn.0040dabc
add esp, 8
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp + 0x1c], 8
jb 0x401874
mov eax, dword [ebp + 8]
push eax
call fcn.0040dabc
add esp, 4
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret