Function at 0x408220
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408bf0
mov edi, edx
mov dword [esp + 8], ecx
mov ebx, dword [esp + 0x15cc]
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00408cb0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x14], edi
je 0x4082e7
test esi, esi
jle 0x408a61
xor eax, eax
cmp esi, 1
je 0x4082b8
mov ecx, dword [esp + 0x15c8]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x14]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 8]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x30]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x30]
add eax, 2
cmp ecx, eax
jne 0x4082a0
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408a61
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 8]
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x408a61
lea eax, [edi + edi*8]
mov dword [esp + 0x20], eax
mov edx, eax
shl edx, 6
test esi, esi
mov dword [esp + 0x1c], edx
jle 0x4083eb
cmp esi, 1
jne 0x40865b
xor edi, edi
xor eax, eax
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408342
mov ecx, dword [esp + 8]
mov edx, dword [esp + 0x1c]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408342
mov word [esp + edi*4 + 0x4b4], cx
mov word [esp + edi*4 + 0x4b6], ax
inc edi
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408cb0
add esp, 0xc
test edi, edi
sete byte [esp + 0xc]
je 0x408402
mov eax, edi
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x4083bf
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b4]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
movzx edx, word [esp + eax*4 + 0x4b8]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
add eax, 2
cmp ecx, eax
jne 0x408380
mov ecx, edi
test cl, 1
je 0x4083e2
movzx eax, word [esp + eax*4 + 0x4b4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x934]
shr eax, 8
inc dword [esp + eax*4 + 0xd34]
mov eax, dword [esp + 0xd34]
jmp 0x40840b
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408cb0
add esp, 0xc
xor edi, edi
mov byte [esp + 0xc], 1
xor eax, eax
xor ecx, ecx
cmp eax, edi
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x2c], eax
lea eax, [edi - 1]
mov dword [esp + 0x18], eax
mov dword [esp + 4], edi
and edi, 0xfffffffe
mov dword [esp + 0x10], edi
lea eax, [esp + 0x4b4]
mov dword [esp], eax
lea eax, [esp + 0x1134]
xor edi, edi
lea edx, [esp + 0x934]
xor ecx, ecx
jmp 0x408466
inc edi
add ecx, 8
add edx, 0x400
mov eax, ebp
cmp edi, dword [esp + 0x2c]
je 0x40857a
mov ebp, dword [esp]
mov dword [esp], eax
mov eax, 3
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + eax*4 + 0xa8], esi
add esi, dword [edx + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xac], esi
add esi, dword [edx + eax*4 - 8]
mov dword [esp + eax*4 + 0xb0], esi
add esi, dword [edx + eax*4 - 4]
mov dword [esp + eax*4 + 0xb4], esi
add esi, dword [edx + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x408480
cmp byte [esp + 0xc], 0
jne 0x408450
mov dword [esp + 0x28], edi
cmp dword [esp + 0x18], 0
je 0x408529
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [ebp + eax*4]
shr ebx, cl
movzx esi, bl
mov ebx, dword [esp + esi*4 + 0xb4]
mov edi, ebp
lea ebp, [ebx + 1]
mov dword [esp + esi*4 + 0xb4], ebp
mov esi, dword [edi + eax*4]
mov ebp, dword [esp]
mov dword [ebp + ebx*4], esi
movzx ebx, word [edi + eax*4 + 4]
shr ebx, cl
movzx esi, bl
mov ebx, dword [esp + esi*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + esi*4 + 0xb4], ebp
mov ebp, edi
mov esi, dword [edi + eax*4 + 4]
mov edi, dword [esp]
mov dword [edi + ebx*4], esi
add eax, 2
cmp dword [esp + 0x10], eax
jne 0x4084d0
jmp 0x40852b
xor eax, eax
test byte [esp + 4], 1
mov ebx, dword [esp + 0x15cc]
mov edi, dword [esp + 0x28]
je 0x408450
movzx ebx, word [ebp + eax*4]
shr ebx, cl
movzx esi, bl
mov ebx, dword [esp + esi*4 + 0xb4]
mov dword [esp + 0x24], ebp
lea ebp, [ebx + 1]
mov dword [esp + esi*4 + 0xb4], ebp
mov ebp, dword [esp + 0x24]
mov eax, dword [ebp + eax*4]
mov esi, dword [esp]
mov dword [esi + ebx*4], eax
mov ebx, dword [esp + 0x15cc]
jmp 0x408450
cmp dword [esp + 4], 0
je 0x408970
cmp dword [esp + 4], 1
jne 0x408599
mov eax, dword [esp]
mov word [eax], 1
jmp 0x40885d
mov edi, dword [esp]
movzx eax, word [edi + 4]
add word [edi], ax
mov eax, dword [esp + 4]
cmp eax, 3
jl 0x4086c5
mov edx, eax
mov eax, 2
mov ecx, 2
sub ecx, edx
mov dword [esp + 0x10], ecx
xor edx, edx
mov esi, 1
jmp 0x4085ff
movzx edi, word [ecx + edx*4]
movzx ebx, word [ecx + esi*4]
mov ebp, ebx
and ebp, edi
xor ebx, edi
lea edi, [ebx + ebp*2]
mov word [ecx + esi*4], di
mov word [ecx + edx*4], si
inc edx
mov ecx, dword [esp + 0x10]
lea edi, [ecx + esi]
inc edi
inc esi
cmp edi, 1
mov edi, dword [esp]
je 0x4086d4
mov ecx, edi
movzx edi, word [edi + edx*4]
cmp eax, dword [esp + 4]
jge 0x408614
movzx ebx, word [ecx + eax*4]
cmp di, bx
jae 0x408630
mov word [ecx + esi*4], di
mov word [ecx + edx*4], si
inc edx
cmp eax, dword [esp + 4]
jge 0x4085d0
jmp 0x40863b
inc eax
mov word [ecx + esi*4], bx
cmp eax, dword [esp + 4]
jge 0x4085d0
cmp edx, esi
jge 0x408650
movzx edi, word [ecx + edx*4]
movzx ebx, word [ecx + eax*4]
cmp di, bx
jb 0x4085d4
jmp 0x408654
movzx ebx, word [ecx + eax*4]
inc eax
add word [ecx + esi*4], bx
jmp 0x4085ea
mov ecx, esi
and ecx, 0xfffffffe
mov eax, dword [esp + 8]
add edx, eax
add edx, 0x8194
xor edi, edi
xor eax, eax
jmp 0x40868b
add eax, 2
cmp ecx, eax
je 0x40830c
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4086a6
mov word [esp + edi*4 + 0x4b4], si
mov word [esp + edi*4 + 0x4b6], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x408680
mov word [esp + edi*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4b6], si
inc edi
jmp 0x408680
lea ecx, [eax - 2]
mov word [edi + eax*4 - 8], 0
jmp 0x408761
mov eax, dword [esp + 4]
lea ecx, [eax - 2]
mov word [edi + eax*4 - 8], 0
lea edx, [eax - 3]
mov esi, ecx
mov eax, edx
and esi, 3
je 0x40870d
mov eax, edx
mov edi, dword [esp]
movzx edi, word [edi + eax*4]
mov ebx, dword [esp]
movzx edi, word [ebx + edi*4]
inc edi
mov ebx, dword [esp]
mov word [ebx + eax*4], di
mov edi, dword [esp]
dec eax
dec esi
jne 0x4086f0
cmp edx, 3
jb 0x408761
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [edi + eax*4 - 4]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + eax*4 - 4], dx
movzx edx, word [edi + eax*4 - 8]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + eax*4 - 8], dx
movzx edx, word [edi + eax*4 - 0xc]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + eax*4 - 0xc], dx
movzx edx, word [edi + eax*4 - 0x10]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + eax*4 - 0x10], dx
add eax, 0xfffffffc
jne 0x408720
mov esi, 1
xor edx, edx
mov eax, dword [esp + 0x18]
jmp 0x408784
mov ebx, dword [esp + 0x15cc]
mov esi, ebp
add esi, ebp
inc edx
test ebp, ebp
jle 0x408852
test ecx, ecx
js 0x4087b0
lea ebp, [ecx + 1]
xor edi, edi
nop
nop
nop
mov ebx, dword [esp]
movzx ebx, word [ebx + ecx*4]
cmp edx, ebx
jne 0x4087c0
inc edi
dec ecx
cmp ebp, edi
jne 0x408790
mov ecx, 0xffffffff
jmp 0x4087c2
xor ebp, ebp
jmp 0x4087c5
mov ebp, edi
mov edi, dword [esp]
mov ebx, esi
sub ebx, ebp
jle 0x408770
mov dword [esp + 0x10], ebp
not ebp
add ebp, esi
mov dword [esp + 0xc], ebp
and ebx, 3
je 0x40880b
mov ebp, ebx
lea edi, [edi + eax*4]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi], dx
inc ebx
add edi, 0xfffffffc
cmp ebp, ebx
jne 0x4087f0
sub eax, ebx
sub esi, ebx
mov ebx, dword [esp + 0x15cc]
mov edi, dword [esp]
jmp 0x408812
mov ebx, dword [esp + 0x15cc]
cmp dword [esp + 0xc], 3
mov ebp, dword [esp + 0x10]
jb 0x408777
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi + eax*4], dx
mov word [edi + eax*4 - 4], dx
mov word [edi + eax*4 - 8], dx
mov word [edi + eax*4 - 0xc], dx
add eax, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebp
jg 0x408830
jmp 0x408777
cmp dword [esp + 4], 0
jle 0x408970
mov eax, dword [esp + 4]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x18], 3
mov edi, dword [esp]
jb 0x4088aa
mov edx, dword [esp + 4]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x30]
add ecx, 4
cmp edx, ecx
jne 0x408880
test eax, eax
je 0x4088cd
lea ecx, [edi + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x30]
inc edx
cmp eax, edx
jne 0x4088c0
cmp dword [esp + 4], 2
jl 0x408970
cmp ebx, 0x20
jge 0x408940
mov eax, dword [esp + ebx*4 + 0x30]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x4088fc
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
inc ecx
mov dword [esp + ebx*4 + 0x30], eax
dec edx
jne 0x4088f0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x408938
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x3c]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x40]
add ecx, 4
mov dword [esp + ebx*4 + 0x30], eax
cmp ecx, 0x20
jne 0x408910
test ebx, ebx
jle 0x408b8d
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x2c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x408950
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x408b98
mov edi, dword [esp + 0x20]
shl edi, 5
mov esi, dword [esp + 8]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408cb0
add esp, 0xc
mov eax, dword [esp + 0x1c]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408cb0
add esp, 0xc
test ebx, ebx
jle 0x408a61
mov eax, 1
add edi, dword [esp + 8]
jmp 0x4089e8
mov ebp, dword [esp + 4]
mov dword [esp + 4], ebp
lea ecx, [eax + 1]
mov ebx, dword [esp + 0x15cc]
cmp eax, ebx
mov eax, ecx
je 0x408a61
mov edx, dword [esp + eax*4 + 0x30]
test edx, edx
jle 0x4089d0
test dl, 1
jne 0x408a00
mov ecx, edx
jmp 0x408a1f
mov esi, dword [esp + 4]
mov ecx, dword [esp]
movzx ecx, word [ecx + esi*4 - 2]
dec esi
mov dword [esp + 4], esi
mov byte [ecx + edi + 0x8f12], al
mov ecx, edx
not ecx
lea ecx, [ecx + edx*2]
cmp edx, 1
mov ebp, dword [esp + 4]
mov ebx, dword [esp]
je 0x4089d4
nop
nop
nop
nop
nop
movzx edx, word [ebx + ebp*4 - 2]
mov byte [edx + edi + 0x8f12], al
mov edx, ecx
not edx
lea edx, [edx + ecx*2]
movzx esi, word [ebx + ebp*4 - 6]
add ebp, 0xfffffffe
mov byte [esi + edi + 0x8f12], al
add edx, edx
sub edx, ecx
mov ecx, edx
test edx, edx
jg 0x408a30
jmp 0x4089d4
mov dword [esp + 0x938], 0
cmp ebx, 2
jl 0x408aae
mov eax, 2
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, eax
xor esi, 0x3ffffffe
lea edx, [eax + eax]
mov edi, edx
and edi, 0x3ffffffc
add edi, esi
add ecx, dword [esp + edi*4 + 0x34]
add ecx, ecx
mov dword [esp + eax*4 + 0x934], ecx
and edx, 2
xor eax, 1
add eax, edx
cmp eax, ebx
jle 0x408a80
cmp dword [esp + 0x15c8], 0
jle 0x408b82
xor eax, eax
mov ecx, dword [esp + 0x14]
lea esi, [ecx + ecx*8]
mov edx, esi
shl edx, 5
mov ecx, dword [esp + 8]
add edx, ecx
shl esi, 6
add esi, ecx
mov dword [esp], esi
jmp 0x408af9
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], bx
inc eax
cmp eax, dword [esp + 0x15c8]
je 0x408b82
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408aeb
mov ebp, dword [esp + ecx*4 + 0x934]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x934], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x408b5f
and ecx, 0xfffffffc
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ebp
and esi, 1
shl esi, 2
lea esi, [esi + ebx*8]
mov ebx, ebp
and ebx, 2
or ebx, esi
mov esi, ebp
shr esi, 2
and esi, 1
or esi, ebx
mov ebx, ebp
shr ebx, 3
and ebx, 1
lea ebx, [ebx + esi*2]
shr ebp, 4
add ecx, 0xfffffffc
jne 0x408b30
test edi, edi
je 0x408ae0
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, ebp
and ecx, 1
lea ebx, [ecx + ebx*2]
shr ebp, 1
dec edi
jne 0x408b70
jmp 0x408ae0
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
mov esi, ebx
xor esi, 0xfffffffe
mov edi, ebx
and edi, 0xfffffffe
lea ecx, [esi + edi*2]
inc ecx
lea esi, [esi + edi*2]
add esi, 2
jmp 0x408bca
dec ebx
mov dword [esp + edi*4 + 0x2c], ebx
add dword [esp + edi*4 + 0x30], 2
dec eax
cmp eax, edx
mov ebx, dword [esp + 0x15cc]
je 0x408970
dec dword [esp + ebx*4 + 0x30]
test ecx, ecx
jle 0x408bba
mov edi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebx, dword [esp + edi*4 + 0x2c]
test ebx, ebx
jne 0x408bb0
dec edi
cmp edi, 1
jg 0x408be0
jmp 0x408bba