Function at 0x417980
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0xbc
call fcn.004a01c0
mov eax, dword [0x560094]
xor eax, esp
mov dword [esp + 0xb8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov dword [esp + 0x10], eax
xor ebx, ebx
mov eax, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 0x20]
mov dword [esp + 0x34], ecx
xor ecx, ecx
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp + 0x30], edx
mov edx, dword [ebp + 0xc]
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], eax
mov dword [esp + 0x24], esi
mov dword [esp + 0x28], 0
mov dword [esp + 0x20], ecx
push edi
test eax, eax
jne 0x4179f0
mov eax, 0x547528
mov dword [esp + 0x1c], eax
test esi, esi
jne 0x4179f8
mov dword [esp + 0x28], eax
test eax, eax
jne 0x417a1d
sub esp, 8
lea ecx, [eax + 6]
mov edx, 0xa2
push 0x9f
call fcn.0040aec0
mov edx, dword [esp + 0x20]
add esp, 0xc
or edi, 0xffffffff
jmp 0x417a20
mov edi, dword [eax + 8]
cmp dword [esp + 0x34], ebx
jle 0x417d20
test edx, edx
jle 0x417d20
mov ecx, dword [esp + 0x18]
cmp ecx, edx
jl 0x417c68
lea eax, [edi*2 + 2]
cmp ecx, eax
jl 0x417c68
mov esi, ecx
sub esi, edi
dec esi
push 0x9b
mov ecx, esi
mov dword [esp + 0x24], esi
call fcn.0040c240
mov ecx, dword [esp + 0x1c]
add esp, 4
mov ebx, eax
push 0x9c
call fcn.0040c240
add esp, 4
mov dword [esp + 0x24], eax
test ebx, ebx
je 0x417c61
test eax, eax
je 0x417c61
push dword [esp + 0x18]
push 0
push eax
call fcn.004c1860
mov ecx, dword [esp + 0x20]
add esp, 0xc
mov eax, dword [esp + 0x18]
sub eax, ecx
add eax, dword [esp + 0x24]
push ecx
push dword [esp + 0x14]
push eax
call fcn.004c0d60
mov ecx, dword [esp + 0x30]
add esp, 0xc
mov edx, edi
movzx eax, byte [ecx]
push dword [esp + 0x28]
dec eax
shr eax, 0x1f
neg eax
mov dword [esp + 0x14], eax
lea eax, [ecx + 1]
mov dword [esp + 0x40], eax
lea eax, [ecx + 1]
add eax, edi
lea ecx, [esp + 0x44]
push esi
push eax
mov dword [esp + 0x20], eax
call fcn.00417d40
add esp, 0xc
test eax, eax
jne 0x417c83
xor edx, edx
test edi, edi
jle 0x417b18
mov esi, dword [esp + 0x3c]
lea eax, [esp + 0x40]
sub esi, eax
lea ecx, [esp + 0x40]
add ecx, edx
inc edx
mov al, byte [esi + ecx]
xor byte [ecx], al
cmp edx, edi
jl 0x417b04
mov esi, dword [esp + 0x20]
push dword [esp + 0x28]
lea eax, [esp + 0x44]
mov edx, esi
push edi
push eax
mov ecx, ebx
call fcn.00417d40
add esp, 0xc
test eax, eax
jne 0x417c83
test esi, esi
jle 0x417b55
sub dword [esp + 0x14], ebx
mov edx, esi
mov esi, dword [esp + 0x14]
mov ecx, ebx
mov al, byte [esi + ecx]
xor byte [ecx], al
inc ecx
sub edx, 1
jne 0x417b46
mov esi, dword [esp + 0x20]
mov edx, dword [ebp + 0x18]
lea eax, [esp + 0x80]
push ecx
push dword [esp + 0x20]
mov ecx, dword [esp + 0x38]
push 0
push eax
call fcn.004206c0
add esp, 0x10
test eax, eax
je 0x417c83
xor ch, ch
xor edx, edx
test edi, edi
je 0x417bad
lea esi, [esp + 0x80]
mov eax, ebx
sub eax, esi
mov dword [esp + 0x30], eax
mov esi, eax
lea eax, [esp + 0x80]
add eax, edx
inc edx
mov cl, byte [esi + eax]
xor cl, byte [eax]
or ch, cl
cmp edx, edi
jb 0x417b94
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x10]
movzx eax, ch
xor ecx, ecx
dec eax
mov dword [esp + 0x1c], ecx
shr eax, 0x1f
neg eax
and edx, eax
mov dword [esp + 0x10], edx
cmp edi, esi
jge 0x417c23
lea ebx, [ebx]
movzx esi, byte [edi + ebx]
not ecx
mov eax, esi
xor eax, 1
lea edx, [eax - 1]
not eax
shr eax, 0x1f
shr edx, 0x1f
and edx, eax
neg edx
and ecx, edx
mov eax, ecx
and ecx, edi
not eax
inc edi
and eax, dword [esp + 0x2c]
or eax, ecx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x2c], eax
or ecx, edx
mov edx, dword [esp + 0x10]
lea eax, [esi - 1]
mov esi, dword [esp + 0x20]
shr eax, 0x1f
neg eax
mov dword [esp + 0x1c], ecx
or eax, ecx
and edx, eax
mov dword [esp + 0x10], edx
cmp edi, esi
jl 0x417bd0
test edx, ecx
je 0x417c6c
mov eax, dword [esp + 0x2c]
mov edi, esi
inc eax
sub edi, eax
cmp dword [esp + 0x34], edi
jge 0x417c4f
sub esp, 8
mov edx, 0xa1
mov ecx, 4
push 0x6d
call fcn.0040aec0
add esp, 0xc
jmp 0x417c6c
push edi
add eax, ebx
push eax
push dword [esp + 0x40]
call fcn.004c0d60
add esp, 0xc
jmp 0x417c86
sub esp, 8
push 0x41
jmp 0x417c71
mov esi, dword [esp + 0x38]
sub esp, 8
push 0x79
mov edx, 0xa1
mov ecx, 4
call fcn.0040aec0
add esp, 0xc
or edi, 0xffffffff
test ebx, ebx
je 0x417cc4
mov eax, dword [fcn.004c1860]
push esi
push 0
push ebx
call eax
mov eax, dword [0x569288]
add esp, 0xc
test eax, eax
je 0x417ca9
push 0
push ebx
call eax
add esp, 8
push ebx
call fcn.004c4deb
mov eax, dword [0x569288]
add esp, 4
test eax, eax
je 0x417cc4
push 1
push 0
call eax
add esp, 8
mov ebx, dword [esp + 0x24]
test ebx, ebx
je 0x417d09
push dword [esp + 0x18]
mov eax, dword [fcn.004c1860]
push 0
push ebx
call eax
mov eax, dword [0x569288]
add esp, 0xc
test eax, eax
je 0x417cee
push 0
push ebx
call eax
add esp, 8
push ebx
call fcn.004c4deb
mov eax, dword [0x569288]
add esp, 4
test eax, eax
je 0x417d09
push 1
push 0
call eax
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xb8]
xor ecx, esp
call fcn.004a01a0
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0xc4]
or eax, 0xffffffff
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004a01a0
mov esp, ebp
pop ebp
ret