Function at 0x4170d0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x14
mov eax, dword [0x81cfec]
push ebx
push esi
xor ebx, ebx
xor esi, esi
cmp eax, ebx
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], eax
je 0x417350
push ebp
push edi
mov eax, dword [esp + 0x14]
mov eax, dword [eax + 4]
cmp byte [eax + 0x7bd], 1
jne 0x417338
mov eax, dword [eax + 0x76c]
cmp eax, 0xffffffff
je 0x417329
push eax
call fcn.0045c0b0
add esp, 4
cmp eax, ebx
je 0x417329
mov ecx, dword [0x829488]
push ebx
add eax, 0x14
push 4
lea edx, [ecx*4 + 0x82948c]
push eax
push edx
call fcn.0045cba0
mov eax, dword [0x829488]
add esp, 0x10
lea edi, [eax*4 + 0x82948c]
inc eax
cmp eax, 8
mov dword [esp + 0x20], edi
mov dword [0x829488], eax
jl 0x417162
mov dword [0x829488], ebx
push ebx
call fcn.0045d120
mov eax, dword [0x81c700]
add esp, 4
inc eax
cmp eax, 0x186a0
mov dword [0x81c700], eax
jb 0x417321
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, eax
mov dword [0x81c700], ebx
sub edx, ecx
cmp edx, eax
jne 0x4171aa
call fcn.00406630
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, ecx
sub edx, eax
cmp edx, ecx
jne 0x4171b7
call fcn.00406630
mov ecx, 0x83f450
call fcn.004065e0
mov ecx, dword [0x829468]
cmp eax, ecx
jb 0x4171e1
mov edx, ecx
or edx, eax
je 0x4171e1
mov edx, eax
sub edx, ecx
cmp edx, 0x3a98
jbe 0x417321
mov cl, byte [0x81c6fc]
test cl, cl
jne 0x417321
mov esi, dword [0x829478]
mov dword [0x829468], eax
mov eax, dword [0x8294e8]
mov byte [0x81c6fc], 1
cmp eax, ebx
mov dword [esp + 0x1c], ebx
not esi
jle 0x417288
mov dword [esp + 0x10], 0x820e44
mov eax, dword [esp + 0x10]
mov eax, dword [eax]
cmp eax, ebx
je 0x417266
mov ecx, dword [eax + 4]
cmp ecx, ebx
jle 0x417266
mov edi, dword [eax]
mov ebp, dword [edi + 0xc]
sar ebp, 2
cmp edi, ebx
je 0x417266
test ecx, ecx
jle 0x417264
mov ecx, edi
call fcn.00406620
xor esi, eax
lea eax, [edi + 0x14]
test ebp, ebp
jle 0x417255
mov ecx, ebp
mov edx, dword [eax]
add eax, 4
xor esi, edx
dec ecx
jne 0x41724b
mov ecx, dword [esp + 0x10]
mov edi, dword [edi + 4]
inc ebx
mov edx, dword [ecx]
cmp ebx, dword [edx + 4]
jl 0x417239
xor ebx, ebx
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
mov ecx, dword [0x8294e8]
inc eax
add edx, 4
cmp eax, ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x10], edx
jl 0x417218
mov edi, dword [esp + 0x20]
cmp esi, dword [0x8294d8]
je 0x417295
call fcn.00406630
cmp dword [0x8294e8], ebx
je 0x41731a
mov ecx, 0x829464
mov dword [esp + 0x10], ebx
call fcn.00406620
test eax, eax
je 0x4172dc
mov ecx, dword [0x829464]
lea eax, [esp + 0x10]
push eax
push ecx
call fcn.00407b70
add esp, 8
test al, al
je 0x4172d7
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x4172d7
cmp dword [eax], 0x29874362
je 0x4172dc
call fcn.00406630
mov ecx, 0x8294b0
mov dword [esp + 0x10], ebx
call fcn.00406620
test eax, eax
je 0x41731a
mov eax, dword [0x8294b0]
lea edx, [esp + 0x10]
push edx
push eax
call fcn.00407b70
add esp, 8
test al, al
je 0x417315
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x417315
cmp dword [eax], 0xbad0bad
je 0x41731a
call fcn.00406630
mov byte [0x81c6fc], 0
cmp edi, ebx
je 0x417329
mov eax, dword [edi]
jmp 0x41732e
mov eax, dword [0x89fe34]
cmp eax, dword [esp + 0x28]
jne 0x417338
inc dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx]
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x4170f0
mov esi, dword [esp + 0x18]
pop edi
pop ebp
mov edx, dword [esp + 0x20]
push esi
push edx
call fcn.006daae0
add esp, 8
mov eax, esi
pop esi
pop ebx
add esp, 0x14
ret