Function at 0x1007ca60
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
mov ebx, dword [ebp + 0x1c]
push esi
push edi
test ebx, ebx
je 0x1007ce61
cmp dword [ebx], 0
jg 0x1007ce61
mov esi, dword [ebp + 8]
test esi, esi
je 0x1007ce5b
cmp dword [ebp + 0x10], 0
jl 0x1007ce5b
jle 0x1007ca9e
cmp dword [ebp + 0xc], 0
je 0x1007ce5b
cmp dword [ebp + 0x14], 0
mov eax, 0x1007c040
push 4
cmovne eax, dword [ebp + 0x14]
cmp byte [esi + 0x22097], 0
mov dword [ebp - 4], eax
pop edi
jne 0x1007ccf7
push esi
call fcn.100d6880
cmp byte [esi + 0x22096], 0
pop ecx
push 0x20
pop edx
mov ecx, 0x120
mov ebx, edx
cmove ecx, edx
mov edi, edx
mov dword [ebp - 0xc], ecx
cmp dword [esi + 0x22090], edx
jle 0x1007cb5f
mov eax, edi
sar eax, 5
mov dword [ebp - 8], eax
cmp dword [esi + eax*4 + 0x22098], 0
jge 0x1007cafc
add edi, edx
jmp 0x1007cb54
cmp edi, ecx
jl 0x1007cb26
push edx
push edi
push ebx
push dword [esi + 0x22080]
call fcn.100d6880
add esp, 0x10
mov ecx, eax
mov eax, dword [ebp - 8]
push 0x20
pop edx
test ecx, ecx
js 0x1007cb26
mov dword [esi + eax*4 + 0x22098], ecx
jmp 0x1007caf8
cmp ebx, edi
jge 0x1007cb49
mov dword [esi + eax*4 + 0x22098], ebx
mov ecx, dword [esi + 0x22080]
mov eax, dword [ecx + edi*4]
mov dword [ecx + ebx*4], eax
inc ebx
inc edi
dec edx
test edx, edx
jg 0x1007cb31
push 0x20
pop edx
jmp 0x1007cb54
add ebx, edx
mov dword [esi + eax*4 + 0x22098], edi
mov edi, ebx
mov ecx, dword [ebp - 0xc]
cmp edi, dword [esi + 0x22090]
jl 0x1007cae6
xor ecx, ecx
cmp dword [esi + 0x22088], ecx
jle 0x1007cb87
mov eax, dword [esi + ecx*4]
cdq
xor eax, edx
sub eax, edx
sar eax, 5
mov eax, dword [esi + eax*4 + 0x22098]
mov dword [esi + ecx*4], eax
inc ecx
cmp ecx, dword [esi + 0x22088]
jl 0x1007cb69
mov dword [esi + 0x22090], ebx
mov ebx, dword [ebp + 0x1c]
push ebx
push dword [ebp - 4]
push esi
call fcn.100d6880
add esp, 0xc
cmp dword [ebx], 0
jg 0x1007cce4
cmp byte [esi + 0x22097], 0
jne 0x1007cce4
push esi
call fcn.100d6880
cmp byte [esi + 0x22096], 0
mov eax, 0x120
pop ecx
push 0x20
pop ecx
cmove eax, ecx
mov ebx, ecx
mov edi, ecx
mov dword [ebp - 0x14], eax
cmp dword [esi + 0x22090], ecx
jle 0x1007ccb3
mov edx, edi
sar edx, 5
mov dword [ebp - 8], edx
cmp dword [esi + edx*4 + 0x22098], 0
jge 0x1007cbf8
add edi, ecx
jmp 0x1007cca4
cmp edi, eax
jl 0x1007cc8a
mov eax, dword [esi + 0x22080]
push 4
push edi
push ebx
push eax
call fcn.100d6880
mov ecx, eax
add esp, 0x10
test ecx, ecx
js 0x1007cc28
mov eax, dword [ebp - 8]
push 0x20
mov dword [esi + eax*4 + 0x22098], ecx
pop ecx
jmp 0x1007cbf1
mov eax, dword [esi + 0x22080]
push 0x1c
pop ecx
mov dword [ebp - 4], ecx
lea edx, [eax + edi*4]
lea eax, [eax + ebx*4]
mov dword [ebp - 0x10], edx
add eax, 0xffffff90
mov dword [ebp - 0xc], eax
push ecx
push edx
push eax
call fcn.100d6880
mov ecx, dword [ebp - 4]
add esp, 0xc
test al, al
jne 0x1007cc6b
mov eax, dword [ebp - 0xc]
sub ecx, 4
mov edx, dword [ebp - 0x10]
add eax, 0x10
mov dword [ebp - 4], ecx
mov dword [ebp - 0xc], eax
test ecx, ecx
jg 0x1007cc43
mov edx, dword [ebp - 8]
push 0x20
test ecx, ecx
jle 0x1007cd0d
mov eax, ebx
add edi, ecx
sub eax, ecx
mov dword [esi + edx*4 + 0x22098], eax
pop edx
sub edx, ecx
jmp 0x1007cc9d
xor ecx, ecx
jmp 0x1007cc6e
mov ecx, dword [esi + 0x22080]
mov eax, dword [ecx + edi*4]
mov dword [ecx + ebx*4], eax
inc ebx
inc edi
dec edx
test edx, edx
jg 0x1007cc8e
push 0x20
pop ecx
mov eax, dword [ebp - 0x14]
cmp edi, dword [esi + 0x22090]
jl 0x1007cbdf
xor ecx, ecx
cmp dword [esi + 0x22088], ecx
jle 0x1007ccdb
mov eax, dword [esi + ecx*4]
cdq
xor eax, edx
sub eax, edx
sar eax, 5
mov eax, dword [esi + eax*4 + 0x22098]
mov dword [esi + ecx*4], eax
inc ecx
cmp ecx, dword [esi + 0x22088]
jl 0x1007ccbd
mov dword [esi + 0x22090], ebx
mov ebx, dword [ebp + 0x1c]
mov byte [esi + 0x22097], 1
cmp dword [ebx], 0
jg 0x1007ce61
push 4
pop edi
cmp byte [ebp + 0x18], 0
mov edx, dword [esi + 0x22090]
je 0x1007cd42
mov eax, dword [esi + 0x22088]
add eax, edx
jmp 0x1007cd44
cmp ebx, edi
jge 0x1007cd31
mov dword [esi + edx*4 + 0x22098], ebx
pop edx
mov ecx, dword [esi + 0x22080]
mov eax, dword [ecx + edi*4]
mov dword [ecx + ebx*4], eax
inc ebx
inc edi
dec edx
test edx, edx
jg 0x1007cd19
jmp 0x1007cca1
pop ecx
add ebx, ecx
mov dword [esi + edx*4 + 0x22098], edi
mov edi, ebx
jmp 0x1007cca4
mov eax, edx
cmp eax, 0x40000
jl 0x1007cd57
mov dword [ebx], 8
mov edx, dword [esi + 0x22090]
cmp byte [ebp + 0x18], 0
mov ebx, dword [esi + 0x22088]
push 2
pop ecx
cmove ecx, edi
add ebx, 8
imul ecx, edx
lea ebx, [ecx + ebx*2]
mov dword [ebp - 0xc], ebx
cmp ebx, dword [ebp + 0x10]
jle 0x1007cd7f
mov eax, ebx
jmp 0x1007ce63
cmp byte [ebp + 0x18], 0
mov ecx, dword [ebp + 0xc]
push 0x25
pop eax
lea edx, [ecx + 0x10]
mov dword [ecx], 0x54726965
mov dword [ecx + 4], eax
jne 0x1007cd9f
mov eax, 0x125
mov dword [ecx + 4], eax
cmp byte [esi + 0x22096], 0
je 0x1007cdb0
or eax, 0x200
mov dword [ecx + 4], eax
cmp byte [ebp + 0x18], 0
mov edi, esi
mov eax, dword [esi + 0x22088]
mov dword [ecx + 8], eax
mov eax, dword [esi + 0x22090]
mov dword [ecx + 0xc], eax
mov ecx, dword [esi + 0x22088]
je 0x1007ce21
test ecx, ecx
jle 0x1007cdf2
push 4
pop ebx
mov eax, dword [esi + 0x22088]
add eax, dword [edi]
add edi, ebx
shr eax, 2
mov word [edx], ax
add edx, 2
dec ecx
test ecx, ecx
jg 0x1007cdd7
mov ebx, dword [ebp - 0xc]
mov ecx, dword [esi + 0x22090]
mov edi, dword [esi + 0x22080]
test ecx, ecx
jle 0x1007cd78
push 4
pop ebx
mov ax, word [edi]
add edi, ebx
dec ecx
mov word [edx], ax
lea edx, [edx + 2]
test ecx, ecx
jg 0x1007ce09
mov ebx, dword [ebp - 0xc]
jmp 0x1007cd78
test ecx, ecx
jle 0x1007ce3d
push 4
pop esi
mov eax, dword [edi]
add edi, esi
shr eax, 2
mov word [edx], ax
add edx, 2
dec ecx
test ecx, ecx
jg 0x1007ce28
mov esi, dword [ebp + 8]
mov ecx, dword [esi + 0x22090]
shl ecx, 2
push ecx
push dword [esi + 0x22080]
push edx
call fcn.100a5a60
add esp, 0xc
jmp 0x1007cd78
mov dword [ebx], 1
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret