Function at 0x4017a0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi], 0
je 0x4017be
pop edi
pop esi
mov eax, 0xfffffffb
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [edi + 8], 1
je 0x4017d2
pop edi
pop esi
mov eax, 0xfffffffa
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov esi, dword [ebp + 8]
test esi, esi
je 0x4019b0
mov eax, dword [ebp + 0xc]
test eax, eax
jle 0x4019b0
mov ecx, eax
and ecx, 0x8000000f
jns 0x4017f7
dec ecx
or ecx, 0xfffffff0
inc ecx
je 0x401807
pop edi
pop esi
mov eax, 0xfffffff9
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [edi + 4]
cdq
and edx, 0xf
add eax, edx
sar eax, 4
sub ecx, 0
mov dword [ebp + 0xc], eax
je 0x401923
dec ecx
je 0x40182e
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret 0xc
lea edx, [edi + 0xc]
push 0x10
lea eax, [ebp - 0x10]
push edx
push eax
call fcn.00425ab0
mov ecx, dword [ebp + 0xc]
add esp, 0xc
lea eax, [ecx - 1]
test eax, eax
jle 0x4018b4
mov ebx, dword [ebp + 0x10]
mov dword [ebp + 8], eax
lea edx, [ebp - 0x24]
mov ecx, edi
push edx
push esi
call fcn.004019c0
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x20]
xor ecx, eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebp - 0xc]
push 0x10
xor edx, ecx
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x20], edx
mov edx, dword [ebp - 8]
xor eax, edx
push esi
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 4]
xor ecx, eax
mov dword [ebp - 0x18], ecx
lea ecx, [ebp - 0x10]
push ecx
call fcn.00425ab0
lea edx, [ebp - 0x24]
push 0x10
push edx
push ebx
call fcn.00425ab0
mov eax, dword [ebp + 8]
add esp, 0x18
add esi, 0x10
add ebx, 0x10
dec eax
mov dword [ebp + 8], eax
jne 0x401850
jmp 0x4018b7
mov ebx, dword [ebp + 0x10]
lea eax, [ebp - 0x24]
mov ecx, edi
push eax
push esi
call fcn.004019c0
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0xc]
mov edi, dword [ebp - 0x20]
mov esi, dword [ebp - 0x1c]
xor eax, ecx
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 8]
xor edi, edx
mov edx, dword [ebp - 0x18]
xor esi, eax
xor edx, ecx
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], edx
mov esi, dword [ebp - 0x15]
and esi, 0xff
mov dword [ebp - 0x20], edi
jle 0x401965
cmp esi, 0x10
jg 0x401965
mov edi, 0x10
sub edi, esi
mov eax, edi
cmp eax, 0x10
jge 0x401991
xor edx, edx
mov dl, byte [ebp + eax - 0x24]
cmp edx, esi
jne 0x401965
inc eax
cmp eax, 0x10
jl 0x401911
jmp 0x401991
dec eax
test eax, eax
jle 0x401948
mov ebx, dword [ebp + 0x10]
mov dword [ebp + 8], eax
push ebx
push esi
mov ecx, edi
call fcn.004019c0
mov eax, dword [ebp + 8]
add esi, 0x10
add ebx, 0x10
dec eax
mov dword [ebp + 8], eax
jne 0x40192e
jmp 0x40194b
mov ebx, dword [ebp + 0x10]
lea ecx, [ebp - 0x24]
push ecx
push esi
mov ecx, edi
call fcn.004019c0
mov esi, dword [ebp - 0x15]
and esi, 0xff
cmp esi, 0x10
jl 0x401973
pop edi
pop esi
mov eax, 0xfffffff9
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edi, 0x10
sub edi, esi
mov eax, edi
cmp eax, 0x10
jge 0x401991
xor edx, edx
mov dl, byte [ebp + eax - 0x24]
cmp edx, esi
jne 0x401965
inc eax
cmp eax, 0x10
jl 0x401981
lea eax, [ebp - 0x24]
push edi
push eax
push ebx
call fcn.00425ab0
mov eax, dword [ebp + 0xc]
add esp, 0xc
shl eax, 4
sub eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0xc