Function at 0x403640
Capabilities:
Encode data using xor
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd0
push ebx
push esi
push edi
mov ebx, edx
mov byte [ebp - 1], 1
push 0
push 0
push 3
push 0
push 0
push 0x80000000
push eax
call sub.kernel32.dll_CreateFileW
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
je 0x40386c
xor edx, edx
push ebp
push 0x403865
push dword fs:[edx]
mov dword fs:[edx], esp
push 0
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_GetFileSize
mov edi, eax
lea eax, [edi + 4]
call fcn.00402438
mov dword [ebp - 0x28], eax
xor edx, edx
push ebp
push 0x403847
push dword fs:[edx]
mov dword fs:[edx], esp
push 0
lea eax, [ebp - 0x24]
push eax
push edi
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_ReadFile
test eax, eax
je 0x403831
cmp edi, dword [ebp - 0x24]
jne 0x403831
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0xc]
mov edx, ebx
call fcn.00403524
mov eax, dword [ebp - 0xc]
mov bl, byte [eax]
lea eax, [ebp - 0xc]
mov edx, 1
call fcn.00403524
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x1c], eax
xor eax, eax
mov al, bl
mov edx, eax
shl edx, 2
lea eax, [ebp - 0xc]
call fcn.00403524
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0xc]
sub eax, dword [ebp - 0x28]
push eax
mov eax, edi
pop edx
sub eax, edx
shr eax, 2
xor edx, edx
mov dword [ebp - 0x10], edx
test eax, eax
jb 0x40374d
inc eax
mov dword [ebp - 0x30], eax
xor ecx, ecx
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x10]
mov eax, dword [eax + edx*4]
mov edx, dword [ebp - 0x20]
xor dword [edx + ecx*4], eax
xor eax, eax
mov al, bl
push eax
mov eax, ecx
pop edx
mov esi, edx
xor edx, edx
div esi
mov dword [ebp - 0x10], edx
inc ecx
dec dword [ebp - 0x30]
jne 0x403727
mov eax, dword [ebp - 0xc]
mov al, byte [eax]
mov byte [ebp - 0x15], al
lea eax, [ebp - 0xc]
mov edx, 1
call fcn.00403524
mov eax, dword [ebp - 0xc]
mov bl, byte [eax]
lea eax, [ebp - 0xc]
mov edx, 1
call fcn.00403524
mov edx, dword [ebp - 0x28]
add edx, edi
add edx, 4
xor eax, eax
mov al, bl
mov ecx, eax
add ecx, ecx
add ecx, dword [ebp - 0xc]
cmp edx, ecx
jae 0x403794
mov byte [ebp - 1], 0
jmp 0x403831
inc eax
add eax, eax
call fcn.00402438
mov esi, eax
xor eax, eax
mov al, bl
mov ecx, eax
add ecx, ecx
mov edx, esi
mov eax, dword [ebp - 0xc]
call fcn.004024ec
xor eax, eax
mov al, bl
mov word [esi + eax*2], 0
xor eax, eax
mov al, bl
mov edx, eax
add edx, edx
lea eax, [ebp - 0xc]
call fcn.00403524
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0xc]
mov edx, 4
call fcn.00403524
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0xc]
mov edx, dword [ebp - 0x14]
call fcn.00403524
mov eax, dword [ebp - 0x28]
add eax, edi
add eax, 4
cmp eax, dword [ebp - 0xc]
jae 0x403803
mov byte [ebp - 1], 0
jmp 0x403831
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0x2c]
mov edx, esi
mov eax, dword [ebp + 8]
call fcn.0040352c
xor eax, eax
mov al, bl
inc eax
mov edx, eax
add edx, edx
mov eax, esi
call fcn.00402458
dec byte [ebp - 0x15]
cmp byte [ebp - 0x15], 0
jne 0x403762
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40384e
mov eax, dword [ebp - 0x28]
call fcn.00402458
ret
mov byte [ebp - 1], 0
mov al, byte [ebp - 1]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4