Function at 0x4084b0
Capabilities:
Check if file exists
Encode data using xor
Get file size
Read file on windows

Disassembly:
mov eax, 0x2be4
call fcn.0040d8c0
mov eax, dword [0x4296d4]
push ebx
push ebp
mov dword [esp + 0x2be8], eax
mov eax, dword [0x46a23c]
test eax, eax
push esi
push edi
mov dword [esp + 0x14], 0
je 0x408ab7
mov eax, dword [0x46a240]
xor ebx, ebx
cmp eax, ebx
je 0x4084f4
mov eax, 0xfffffff6
jmp 0x408ac5
push ebx
push ebx
push 3
push ebx
push 3
push 0xc0000000
mov esi, 1
push 0x46a2c8
mov dword [0x46a240], esi
mov byte [esp + 0x2bec], 0
mov byte [esp + 0x2bed], 0
mov word [esp + 0x2bee], bx
mov dword [esp + 0x2bf0], ebx
mov dword [esp + 0x2bf4], ebx
mov word [esp + 0x2bf8], bx
mov word [esp + 0x2bfa], bx
mov word [esp + 0x2bfc], bx
mov word [esp + 0x2bfe], bx
mov word [esp + 0x2c00], bx
mov dword [esp + 0x2c02], ebx
mov dword [esp + 0x2c06], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x30], edi
jne 0x4085a1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
mov dword [0x46a240], ebx
je 0x408597
cmp eax, 3
jne 0x408654
mov eax, 0xffffffe0
jmp 0x408ac5
mov dword [esp + 0x10], esi
mov esi, dword [sym.imp.KERNEL32.dll_GetFileSize]
jmp 0x4085b0
push ebx
push edi
call esi
push ebx
mov ebp, eax
push ebp
push ebx
push ebx
push edi
mov dword [esp + 0x2c], ebp
call dword [sym.imp.KERNEL32.dll_LockFile]
test eax, eax
jne 0x40860d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x21
je 0x4085db
cmp eax, 0xd4
jne 0x4085e3
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esp + 0x10]
inc eax
cmp ax, 0x14
mov dword [esp + 0x10], eax
jle 0x4085b0
cmp edi, ebx
je 0x4085fd
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x46a240], ebx
mov eax, 0xffffffdf
jmp 0x408ac5
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [esp + 0x20]
push eax
push 0x1e
lea ecx, [esp + 0x2bdc]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40865e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
push ebp
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
cmp edi, ebx
je 0x40864e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x46a240], ebx
mov eax, 0xffffffde
jmp 0x408ac5
lea ecx, [esp + 0x2bd0]
xor eax, eax
cmp ax, 0xe
jl 0x408673
cmp ax, 0x11
jle 0x408687
mov dl, byte [ecx]
add dl, byte [esp + 0x2bde]
inc dl
xor dl, byte [esp + 0x2be0]
mov byte [ecx], dl
inc ecx
inc eax
cmp ax, 0x1e
jb 0x408667
call fcn.00408440
mov si, word [esp + 0x2bd2]
cmp si, bx
je 0x408ade
mov edx, dword [esp + 0x2bd4]
cmp edx, ebx
je 0x408ade
mov ecx, eax
sub ecx, edx
mov eax, ecx
cdq
xor eax, edx
movsx esi, si
sub eax, edx
lea edx, [esi + 5]
imul edx, edx, 0x3c
cmp eax, edx
jg 0x408ade
mov bx, word [esp + 0x2c0c]
cmp bx, 0x21
jl 0x408773
cmp bx, 0x24
jg 0x408773
movsx eax, bx
add eax, 0xffffffdf
cmp eax, 3
ja case.default.0x4086f7
jmp dword [eax*4 + 0x408b04]
movsx ecx, byte [esp + 0x2bd1]
mov eax, 0x66666667
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
lea edx, [eax + eax*4]
shl edx, 1
sub ecx, edx
movsx eax, ax
movzx esi, cx
shl eax, 0x10
or esi, eax
jmp case.0x4086f7.34
mov eax, 0x88888889
imul ecx
add edx, ecx
sar edx, 5
mov esi, edx
shr esi, 0x1f
add esi, edx
jns case.0x4086f7.34
neg esi
jmp case.0x4086f7.34
movsx esi, word [esp + 0x2be2]
jmp case.0x4086f7.34
mov esi, 0xfffffff9
push 0
push ebp
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
test edi, edi
je 0x40876c
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
jmp 0x408abb
mov ax, word [esp + 0x2bdc]
cmp word [esp + 0x2c08], ax
push 0
jle 0x4087a6
push ebp
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
test edi, edi
je 0x40879e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x408abb
movsx eax, ax
lea esi, [eax + eax*2]
lea ecx, [esp + 0x20]
push ecx
shl esi, 2
push esi
lea edx, [esp + 0x40]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4087f2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
push ebp
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
test edi, edi
je 0x4089fc
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0xffffffde
jmp 0x408abb
xor ebp, ebp
test esi, esi
lea eax, [esp + 0x34]
jle 0x40882b
mov cl, byte [esp + 0x2be0]
mov dl, byte [esp + 0x2bde]
lea ebx, [ebx]
mov bl, byte [eax]
add bl, dl
inc bl
xor bl, cl
mov byte [eax], bl
inc eax
inc ebp
movsx ebx, bp
cmp ebx, esi
jl 0x408810
mov bx, word [esp + 0x2c0c]
xor ebp, ebp
cmp bx, 9
mov dword [esp + 0x14], ebp
je 0x4088c6
cmp bx, 7
je 0x4088c6
cmp bx, 8
je 0x4088c6
movsx eax, bx
dec eax
cmp eax, 5
ja case.default.0x408854
jmp dword [eax*4 + 0x408b14]
movsx esi, word [esp + 0x2bdc]
jmp 0x40889f
movsx eax, word [esp + 0x2c08]
lea eax, [eax + eax*2]
movsx esi, word [esp + eax*4 + 0x28]
sub esi, 4
jmp 0x40889f
movsx eax, word [esp + 0x2c08]
lea ecx, [eax + eax*2]
mov esi, dword [esp + ecx*4 + 0x2c]
jmp 0x40889f
movsx eax, word [esp + 0x2c08]
lea edx, [eax + eax*2]
movsx esi, word [esp + edx*4 + 0x2a]
jmp 0x40889f
xor esi, esi
mov eax, dword [esp + 0x18]
push ebp
push eax
push ebp
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
cmp edi, ebp
je 0x4088b9
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x46a240], ebp
mov eax, esi
jmp 0x408ac5
cmp word [esp + 0x2bdc], bp
mov dword [esp + 0x10], ebp
jle 0x408a9a
push 1
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
movsx esi, word [esp + 0x10]
lea ebx, [esi + esi*2]
movsx edx, word [esp + ebx*4 + 0x34]
push 0
lea ebx, [esp + ebx*4 + 0x38]
lea ecx, [esp + 0x20]
push ecx
mov ebp, eax
push edx
lea eax, [esp + 0xb08]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4089d9
movsx eax, word [esp + 0x2c08]
dec eax
cmp esi, eax
mov dword [esp + 0x24], eax
jl 0x4089bd
movsx ecx, word [ebx]
xor esi, esi
test ecx, ecx
mov dword [esp + 0x2c], ecx
jle 0x4089b4
movsx ecx, word [esp + 0x2bde]
movsx edx, word [esp + 0x2be0]
mov edi, ebp
shl edi, 4
add edi, ebp
imul ebp, ebp, 0xb
mov dword [esp + 0x28], ecx
mov dword [esp + 0x20], edx
nop
mov cl, byte [esp + esi + 0xafc]
mov bl, byte [esp + 0x2bde]
mov al, byte [esp + 0x2be0]
add cl, bl
inc cl
xor cl, al
mov eax, ebp
cdq
mov ebx, 0xff
idiv ebx
mov eax, edi
add cl, dl
cdq
idiv ebx
mov eax, dword [esp + 0x2c]
inc cl
xor cl, dl
mov edx, dword [esp + 0x28]
mov byte [esp + esi + 0xafc], cl
mov ecx, dword [esp + 0x20]
inc esi
add ebp, edx
add edi, ecx
cmp esi, eax
jl 0x408960
mov edi, dword [esp + 0x30]
mov eax, dword [esp + 0x24]
movsx ecx, word [esp + 0x10]
cmp ecx, eax
je 0x408a06
mov eax, dword [esp + 0x10]
inc eax
cmp ax, word [esp + 0x2bdc]
mov dword [esp + 0x10], eax
jl 0x4088d8
jmp 0x408a9a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x18]
push 0
push edx
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
test edi, edi
je 0x4089fc
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0xffffffde
jmp 0x408abb
mov eax, dword [esp + 0xafc]
cmp eax, dword [esp + 0x2bf8]
je 0x408a23
mov dword [esp + 0x14], 0xfffffffe
jmp 0x408a9a
cmp word [esp + 0x2c0c], 9
jne 0x408a40
movsx eax, word [esp + 0x10]
lea ecx, [eax + eax*2]
mov edx, dword [esp + ecx*4 + 0x3c]
mov dword [esp + 0x14], edx
jmp 0x408a9a
mov eax, dword [esp + 0x2c00]
dec eax
test ax, ax
jge 0x408a4f
xor eax, eax
movsx esi, word [esp + 0x2c04]
movsx ecx, ax
add esi, ecx
xor ebx, ebx
cmp ecx, esi
jge 0x408a96
movsx eax, word [esp + 0x10]
lea eax, [eax + eax*2]
movsx eax, word [esp + eax*4 + 0x34]
cdq
and edx, 3
add eax, edx
sar eax, 2
lea edx, [eax - 1]
mov eax, dword [esp + 0x2bfc]
cmp ecx, edx
jg 0x408a96
mov ebp, dword [esp + ecx*4 + 0xb00]
mov dword [eax + ebx*4], ebp
inc ebx
inc ecx
cmp ecx, esi
jl 0x408a82
mov dword [esp + 0x14], ebx
mov ecx, dword [esp + 0x18]
push 0
push ecx
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
test edi, edi
je 0x408ab7
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
mov dword [0x46a240], 0
mov ecx, dword [esp + 0x2bf0]
pop edi
pop esi
pop ebp
pop ebx
call fcn.0040d4a7
add esp, 0x2be4
ret 0x18
push ebx
push ebp
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
cmp edi, ebx
je 0x408af4
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x46a240], ebx
mov eax, 0xffffffdd
jmp 0x408ac5