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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x94c
mov eax, dword [0x100c66d0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
xor ebx, ebx
xor esi, esi
cmp dword [eax + 0x14], 8
push edi
mov dword [ebp - 0x92c], ecx
mov dword [ebp - 0x940], esi
mov dword [ebp - 0x928], ebx
mov dword [ebp - 0x924], ebx
jb 0x1002a67d
mov eax, dword [eax]
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
jne 0x1002a732
call fcn.1002a500
cmp eax, ebx
jne 0x1002aab8
push 0x3ff
lea edx, [ebp - 0x427]
push ebx
push edx
mov byte [ebp - 0x428], bl
call fcn.10044ad0
add esp, 0xc
push ebx
lea eax, [ebp - 0x920]
push eax
push 0x64
lea ecx, [ebp - 0x428]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1002a6ee
call fcn.1002a500
cmp eax, ebx
jne 0x1002aaad
cmp dword [ebp - 0x920], 0x64
jne 0x1002aaad
mov eax, dword [ebp + 0xc]
cmp eax, 1
jne 0x1002a81a
lea ecx, [ebp - 0x428]
mov eax, str.SQLite_format_3
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x1002a73f
test dl, dl
je 0x1002a72e
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x1002a73f
add eax, 2
add ecx, 2
test dl, dl
jne 0x1002a712
xor eax, eax
jmp 0x1002a744
mov dword [ebp - 0x940], eax
mov esi, eax
jmp 0x1002a6aa
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x1002a85d
mov edx, dword [ebp - 0x418]
shl edx, 8
cmp byte [ebp - 0x414], 0xc
movzx eax, dx
jne 0x1002aaad
mov ecx, 0x400
cmp ax, cx
jne 0x1002aaad
push ebx
lea edx, [ebp - 0x934]
push edx
push ebx
push esi
mov dword [ebp - 0x938], ebx
mov dword [ebp - 0x934], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x1002a799
call fcn.1002a500
lea ecx, [ebp - 0x24]
call fcn.1002a5e0
lea eax, [ebp - 0x24]
lea ecx, [ebp - 0x918]
call fcn.10022f80
mov dword [ebp - 0x944], eax
mov eax, dword [ebp - 0x92c]
xor edi, edi
cmp dword [eax + 0x14], 8
mov dword [ebp - 0x930], edi
jb 0x1002a7cb
mov eax, dword [eax]
lea ecx, [ebp - 0x928]
push ecx
mov ecx, 2
mov edx, 0x40000000
call fcn.1002a590
test eax, eax
je 0x1002a87c
mov eax, dword [ebp - 0x928]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, ebx
je 0x1002a7fc
push eax
call edi
cmp esi, ebx
je 0x1002aab8
push esi
call edi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1003c5b5
mov esp, ebp
pop ebp
ret
cmp eax, 2
jne 0x1002a74c
lea ecx, [ebp - 0x428]
mov eax, str.SQLite_format_3
mov edi, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x1002a850
test dl, dl
je 0x1002a84c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x1002a850
add eax, 2
add ecx, 2
test dl, dl
jne 0x1002a830
xor eax, eax
jmp 0x1002a855
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x1002a74c
cmp esi, ebx
je 0x1002a868
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1003c5b5
mov esp, ebp
pop ebp
ret
push 0x3ff
lea edx, [ebp - 0x827]
push ebx
push edx
mov byte [ebp - 0x828], bl
call fcn.10044ad0
add esp, 0xc
mov byte [ebp - 0x919], 1
mov edi, edi
push ebx
lea eax, [ebp - 0x920]
push eax
push 0x400
lea ecx, [ebp - 0x428]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1002a8cc
call fcn.1002a500
cmp eax, ebx
jne 0x1002aa5b
cmp dword [ebp - 0x920], ebx
jbe 0x1002aa5b
cmp edi, ebx
jne 0x1002a8f4
mov edx, dword [ebp - 0x418]
mov eax, dword [ebp - 0x414]
mov dword [ebp - 0x938], edx
mov dword [ebp - 0x934], eax
mov ecx, dword [ebp - 0x2c]
mov ebx, dword [ebp - 0x30]
xor eax, eax
mov dword [ebp - 0x13], eax
mov dword [ebp - 0xf], eax
mov dword [ebp - 0xb], eax
mov word [ebp - 7], ax
mov byte [ebp - 5], al
lea eax, [edi + 1]
mov edi, dword [ebp - 0x34]
mov dword [ebp - 0x92c], eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x944]
lea edx, [ebp - 0x828]
push edx
mov dword [ebp - 8], ecx
push eax
lea ecx, [ebp - 0x14]
lea eax, [ebp - 0x918]
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], ebx
call fcn.10023220
add esp, 8
xor esi, esi
jmp 0x1002a950
mov eax, dword [ebp - 0x944]
lea ecx, [ebp + esi - 0x828]
lea edx, [ecx + 0x10]
push edx
push eax
lea eax, [ebp - 0x918]
call fcn.10023220
add esi, 0x10
add esp, 8
cmp esi, 0x3f0
jb 0x1002a950
mov esi, dword [ebp - 0x920]
xor eax, eax
test esi, esi
je 0x1002a9a3
jmp 0x1002a990
mov cl, byte [ebp + eax - 0x828]
xor byte [ebp + eax - 0x428], cl
inc eax
cmp eax, esi
jb 0x1002a990
cmp dword [ebp - 0x930], 0
mov edx, dword [ebp - 8]
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], edx
jne 0x1002aa0a
cmp dword [ebp + 0xc], 1
mov eax, dword [ebp - 0x938]
mov ecx, dword [ebp - 0x934]
mov dword [ebp - 0x418], eax
mov dword [ebp - 0x414], ecx
jne 0x1002aa0a
lea ecx, [ebp - 0x428]
mov eax, str.SQLite_format_3
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x1002aa01
test dl, dl
je 0x1002a9fd
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x1002aa01
add eax, 2
add ecx, 2
test dl, dl
jne 0x1002a9e1
xor eax, eax
jmp 0x1002aa06
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x1002aa4c
mov ecx, dword [ebp - 0x928]
push 0
lea edx, [ebp - 0x948]
push edx
push esi
lea eax, [ebp - 0x428]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1002aa31
call fcn.1002a500
mov edx, dword [ebp - 0x92c]
mov esi, dword [ebp - 0x940]
mov dword [ebp - 0x930], edx
mov edi, edx
xor ebx, ebx
jmp 0x1002a8a0
mov esi, dword [ebp - 0x940]
mov byte [ebp - 0x919], 0
xor ebx, ebx
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, ebx
je 0x1002aa70
push esi
call edi
mov dword [ebp - 0x940], ebx
mov esi, ebx
mov eax, dword [ebp - 0x928]
cmp eax, ebx
je 0x1002aa85
push eax
call edi
mov dword [ebp - 0x928], ebx
mov eax, ebx
movzx ebx, byte [ebp - 0x919]
test eax, eax
je 0x1002aa93
push eax
call edi
test esi, esi
je 0x1002aa9a
push esi
call edi
mov eax, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1003c5b5
mov esp, ebp
pop ebp
ret
cmp esi, ebx
je 0x1002aab8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.1003c5b5
mov esp, ebp
pop ebp
ret