Function at 0x4081f0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.00408c10
mov esi, edx
mov edi, ecx
mov ebx, dword [esp + 0x15c4]
lea eax, [esp + 0x2c]
push 0x84
push 0
push eax
call fcn.00408dd0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x1c], esi
je 0x40829e
test ebx, ebx
jle 0x408a59
xor eax, eax
cmp ebx, 1
je 0x408278
mov ecx, ebx
and ecx, 0xfffffffe
mov eax, dword [esp + 0x1c]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x2c]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x2c]
add eax, 2
cmp ecx, eax
jne 0x408260
test bl, 1
je 0x408a59
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x2c]
jmp 0x408a59
lea ebp, [esi + esi*8]
mov eax, ebp
shl eax, 6
test ebx, ebx
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], ebp
mov dword [esp + 0x20], eax
jle 0x408399
cmp ebx, 1
jne 0x408823
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x4082f9
mov ecx, dword [esp + 0x20]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4082f9
mov word [esp + ebx*4 + 0x4b0], cx
mov word [esp + ebx*4 + 0x4b2], ax
inc ebx
lea eax, [esp + 0x930]
push 0x800
push 0
push eax
call fcn.00408dd0
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x4083b0
xor eax, eax
cmp ebx, 1
je 0x40836f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b0]
movzx esi, dl
inc dword [esp + esi*4 + 0x930]
shr edx, 8
inc dword [esp + edx*4 + 0xd30]
movzx edx, word [esp + eax*4 + 0x4b4]
movzx esi, dl
inc dword [esp + esi*4 + 0x930]
shr edx, 8
inc dword [esp + edx*4 + 0xd30]
add eax, 2
cmp ecx, eax
jne 0x408330
test bl, 1
je 0x408390
movzx eax, word [esp + eax*4 + 0x4b0]
movzx ecx, al
inc dword [esp + ecx*4 + 0x930]
shr eax, 8
inc dword [esp + eax*4 + 0xd30]
mov eax, dword [esp + 0xd30]
jmp 0x4083b9
lea eax, [esp + 0x930]
push 0x800
push 0
push eax
call fcn.00408dd0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov esi, 2
sub esi, ecx
lea eax, [ebx - 1]
mov dword [esp + 0x24], eax
mov dword [esp + 8], ebx
and ebx, 0xfffffffe
lea eax, [esp + 0x4b0]
mov dword [esp], eax
lea eax, [esp + 0x1130]
xor edi, edi
xor ecx, ecx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x28], esi
jmp 0x408418
mov eax, edi
and eax, 1
xor edi, 1
lea edi, [edi + eax*2]
add ecx, 8
mov eax, ebp
cmp edi, esi
jae 0x408524
mov ebp, dword [esp]
mov dword [esp], eax
mov eax, edi
shl eax, 0xa
add eax, esp
add eax, 0x930
mov edx, 3
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xa4], ebx
add ebx, dword [eax + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xa8], ebx
add ebx, dword [eax + edx*4 - 8]
mov dword [esp + edx*4 + 0xac], ebx
add ebx, dword [eax + edx*4 - 4]
mov dword [esp + edx*4 + 0xb0], ebx
add ebx, dword [eax + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x408440
cmp byte [esp + 7], 0
jne 0x408400
mov dword [esp + 0x10], edi
cmp dword [esp + 0x24], 0
je 0x4084e1
xor eax, eax
mov esi, dword [esp]
nop
nop
nop
movzx edx, word [ebp + eax*4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb0]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb0], ebx
mov edx, dword [ebp + eax*4]
mov dword [esi + edi*4], edx
movzx edx, word [ebp + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb0]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb0], ebx
mov edx, dword [ebp + eax*4 + 4]
mov dword [esi + edi*4], edx
mov ebx, dword [esp + 0xc]
add eax, 2
cmp ebx, eax
jne 0x408490
jmp 0x4084e3
xor eax, eax
test byte [esp + 8], 1
mov esi, dword [esp + 0x28]
mov edi, dword [esp + 0x10]
je 0x408400
movzx edx, word [ebp + eax*4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb0]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb0], ebx
mov eax, dword [ebp + eax*4]
mov edx, dword [esp]
mov dword [edx + edi*4], eax
mov edi, dword [esp + 0x10]
jmp 0x408400
cmp dword [esp + 8], 0
je 0x40890c
mov ebx, dword [esp + 8]
cmp ebx, 1
jne 0x408545
mov eax, dword [esp]
mov word [eax], 1
jmp 0x40878b
mov ecx, dword [esp]
movzx eax, word [ecx + 4]
add word [ecx], ax
cmp ebx, 3
jl 0x4085fa
mov eax, 2
mov ecx, 2
sub ecx, ebx
mov dword [esp + 0x10], ecx
mov esi, 1
xor ebp, ebp
jmp 0x408593
inc eax
add word [ecx + esi*4], dx
mov ecx, dword [esp + 0x10]
lea edx, [ecx + esi]
inc edx
inc esi
cmp edx, 1
je 0x4085fa
cmp eax, ebx
jge 0x4085d0
mov ecx, dword [esp]
movzx edi, word [ecx + eax*4]
movzx edx, word [ecx + ebp*4]
cmp dx, di
jb 0x4085d7
inc eax
mov word [ecx + esi*4], di
cmp eax, ebx
jl 0x4085e4
mov ecx, dword [esp]
movzx edi, word [ecx + ebp*4]
add word [ecx + esi*4], di
mov word [ecx + ebp*4], si
inc ebp
jmp 0x408585
mov ecx, dword [esp]
movzx edx, word [ecx + ebp*4]
mov word [ecx + esi*4], dx
mov word [ecx + ebp*4], si
inc ebp
cmp eax, ebx
jge 0x4085b0
mov ecx, dword [esp]
movzx edx, word [ecx + eax*4]
cmp ebp, esi
jge 0x408580
movzx edi, word [ecx + ebp*4]
cmp di, dx
jae 0x408580
jmp 0x4085b7
mov ebp, dword [esp]
mov word [ebp + ebx*4 - 8], 0
mov eax, ebx
xor eax, 0xfffffffc
mov ecx, ebx
and ecx, 0xfffffffc
lea ecx, [eax + ecx*2]
inc ecx
js 0x408685
lea esi, [ebx + 2]
mov eax, ecx
and esi, 3
je 0x408634
mov eax, ecx
movzx edx, word [ebp + eax*4]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4], dx
dec eax
dec esi
jne 0x408620
cmp ecx, 3
jb 0x408685
inc eax
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebp + eax*4 - 4]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4 - 4], cx
movzx ecx, word [ebp + eax*4 - 8]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4 - 8], cx
movzx ecx, word [ebp + eax*4 - 0xc]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4 - 0xc], cx
movzx ecx, word [ebp + eax*4 - 0x10]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x408640
lea eax, [ebx - 2]
mov ecx, ebx
or ecx, 0xfffffffe
mov edx, dword [esp + 0xc]
add ecx, edx
inc ecx
xor edx, edx
mov esi, 1
jmp 0x4086cd
mov ebp, dword [esp]
mov esi, ebx
and esi, 2
mov edi, ebx
or edi, 2
imul edi, esi
xor esi, 2
and ebx, 0x7ffffffd
imul ebx, esi
add edi, ebx
inc edx
mov esi, edi
test edi, edi
mov ebx, dword [esp + 8]
jle 0x408783
test eax, eax
js 0x408700
lea edi, [eax + 1]
mov dword [esp + 0xc], edi
xor ebx, ebx
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp + eax*4]
cmp edx, edi
jne 0x408702
inc ebx
add eax, 0xffffffff
jb 0x4086e0
mov eax, 0xffffffff
mov ebx, dword [esp + 0xc]
jmp 0x408702
xor ebx, ebx
mov ebp, esi
sub ebp, ebx
jle 0x4086a0
mov edi, ebx
not edi
add edi, esi
mov dword [esp + 0x10], edi
and ebp, 3
je 0x408743
mov dword [esp + 0xc], ebx
mov edi, dword [esp]
lea edi, [edi + ecx*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 0x408730
sub ecx, ebx
sub esi, ebx
mov ebx, dword [esp + 0xc]
cmp dword [esp + 0x10], 3
mov ebp, dword [esp]
jb 0x4086a3
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp + ecx*4], dx
mov word [ebp + ecx*4 - 4], dx
mov word [ebp + ecx*4 - 8], dx
mov word [ebp + ecx*4 - 0xc], dx
add ecx, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebx
jg 0x408760
jmp 0x4086a3
test ebx, ebx
jle 0x40890c
mov edi, dword [esp + 8]
mov eax, edi
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x24], 3
mov ebx, dword [esp]
jb 0x4087da
mov edx, edi
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + ecx*4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [ebx + ecx*4 + 4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [ebx + ecx*4 + 8]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [ebx + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x2c]
add ecx, 4
cmp edx, ecx
jne 0x4087b0
test eax, eax
je 0x4087fd
lea ecx, [ebx + 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 + 0x2c]
inc edx
cmp eax, edx
jne 0x4087f0
cmp edi, 2
jl 0x40890c
mov ebx, dword [esp + 0x15c8]
cmp ebx, 0x1f
jg 0x4088d2
mov ecx, dword [esp + ebx*4 + 0x2c]
test bl, 1
jne 0x408885
mov eax, ebx
jmp 0x408899
mov ecx, ebx
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40884b
add eax, 2
cmp ecx, eax
je 0x4082c7
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408866
mov word [esp + ebx*4 + 0x4b0], si
mov word [esp + ebx*4 + 0x4b2], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x408840
mov word [esp + ebx*4 + 0x4b0], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b2], si
inc ebx
jmp 0x408840
lea eax, [ebx + 1]
mov edx, dword [esp + ebx*4 + 0x30]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x2c], ecx
cmp ebx, 0x1f
je 0x4088ca
nop
nop
mov edx, dword [esp + eax*4 + 0x30]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x2c], ecx
mov edx, dword [esp + eax*4 + 0x34]
add eax, 2
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x2c], ecx
cmp eax, 0x20
jne 0x4088a0
test ebx, ebx
jle 0x408b9d
mov edx, ebx
not edx
xor eax, eax
mov esi, edx
mov ebp, ebx
nop
nop
nop
nop
mov ecx, esi
and ecx, ebx
mov edi, ebp
and edi, edx
sub ecx, edi
mov edi, dword [esp + ebp*4 + 0x2c]
shl edi, cl
add eax, edi
inc esi
cmp ebp, 1
lea ebp, [ebp - 1]
ja 0x4088e0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x408ba8
mov eax, dword [esp + 0x14]
shl eax, 5
mov esi, dword [esp + 0x18]
mov edi, eax
add eax, esi
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408dd0
add esp, 0xc
mov eax, dword [esp + 0x20]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408dd0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov ebx, dword [esp + 0x15c4]
jle 0x408a55
add dword [esp], 0xfffffffe
mov eax, 1
mov dword [esp + 0x14], edi
jmp 0x408995
mov ebx, dword [esp + 8]
mov edi, dword [esp + 0x14]
mov dword [esp + 8], ebx
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15c8]
mov eax, ecx
mov ebx, dword [esp + 0x15c4]
je 0x408a55
mov ecx, dword [esp + eax*4 + 0x2c]
test ecx, ecx
jle 0x408970
mov edx, ecx
and edx, 3
je 0x4089f0
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 8]
mov esi, dword [esp]
lea ebx, [esi + ecx*4]
xor esi, esi
mov ecx, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebx]
mov ebp, dword [esp + 0x18]
add ebp, ecx
mov byte [edi + ebp + 0x8f12], al
inc esi
add ebx, 0xfffffffc
cmp edx, esi
jne 0x4089c0
sub dword [esp + 8], esi
mov ecx, dword [esp + 0xc]
mov edx, ecx
sub edx, esi
jmp 0x4089f2
mov edx, ecx
cmp ecx, 4
mov ebx, dword [esp + 8]
mov edi, dword [esp]
mov ebp, dword [esp + 0x18]
jb 0x408974
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebx*4]
mov esi, dword [esp + 0x14]
add esi, ebp
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
add ebx, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408a10
jmp 0x408974
mov edi, dword [esp + 0x18]
mov dword [esp + 0x934], 0
mov eax, dword [esp + 0x15c8]
cmp eax, 2
jl 0x408acd
lea ecx, [eax - 1]
cmp eax, 2
jne 0x408a86
xor eax, eax
mov edx, 2
test cl, 1
jne 0x408ac0
jmp 0x408acd
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x938], eax
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x93c], eax
add edx, 2
cmp ebx, edx
jne 0x408a90
add edx, 2
mov ebx, dword [esp + 0x15c4]
test cl, 1
je 0x408acd
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x930], eax
test ebx, ebx
jle 0x408b92
xor eax, eax
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, edi
shl ecx, 6
add ecx, edi
mov dword [esp + 0xc], ecx
jmp 0x408b0c
mov ecx, dword [esp + 0xc]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15c4]
inc eax
cmp eax, ebx
je 0x408b92
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408b03
mov ebp, dword [esp + ecx*4 + 0x930]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x930], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x408b6f
and ecx, 0xfffffffc
xor ebx, ebx
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 0x408b40
test edi, edi
je 0x408af0
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 0x408b80
jmp 0x408af0
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
mov ebx, dword [esp + 0x15c8]
mov ecx, ebx
or ecx, 0xfffffffe
mov esi, ecx
and ebx, 0xfffffffe
add ecx, ebx
inc ecx
add esi, ebx
add esi, 2
jmp 0x408be3
dec edi
mov dword [esp + ebx*4 + 0x28], edi
add dword [esp + ebx*4 + 0x2c], 2
dec eax
cmp eax, edx
je 0x40890c
mov ebp, dword [esp + 0x15c8]
mov edi, dword [esp + ebp*4 + 0x2c]
mov ebx, edi
not ebx
lea edi, [ebx + edi*2]
mov dword [esp + ebp*4 + 0x2c], edi
test ecx, ecx
jle 0x408bda
mov ebx, esi
nop
mov edi, dword [esp + ebx*4 + 0x28]
test edi, edi
jne 0x408bd0
dec ebx
cmp ebx, 1
jg 0x408c00
jmp 0x408bda