Function at 0x408110
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408af0
mov esi, edx
mov dword [esp + 0x10], ecx
mov ebx, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00408cf0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x18], esi
je 0x4081c0
test ebx, ebx
jle 0x40893c
xor eax, eax
cmp ebx, 1
je 0x408198
mov ecx, ebx
and ecx, 0xfffffffe
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0x10]
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 0x408180
test bl, 1
je 0x40893c
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0x10]
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x40893c
lea eax, [esi + esi*8]
mov dword [esp + 0x14], eax
shl eax, 6
test ebx, ebx
mov dword [esp + 0x24], eax
jle 0x4082b9
cmp ebx, 1
jne 0x408797
xor edi, edi
xor eax, eax
test bl, 1
mov ebx, edi
je 0x408214
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x10]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408214
mov word [esp + ebx*4 + 0xb4], cx
mov word [esp + ebx*4 + 0xb6], ax
inc ebx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408cf0
add esp, 0xc
test ebx, ebx
sete byte [esp + 0xb]
je 0x4082d0
xor eax, eax
cmp ebx, 1
je 0x40828f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xb4]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
movzx edx, word [esp + eax*4 + 0xb8]
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 0x408250
test bl, 1
je 0x4082b0
movzx eax, word [esp + eax*4 + 0xb4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x934]
shr eax, 8
inc dword [esp + eax*4 + 0xd34]
mov eax, dword [esp + 0xd34]
jmp 0x4082d9
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408cf0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov edi, 2
sub edi, ecx
lea eax, [ebx - 1]
mov dword [esp + 0x1c], eax
mov dword [esp], ebx
and ebx, 0xfffffffe
lea ebp, [esp + 0x1134]
xor edx, edx
lea esi, [esp + 0xb4]
lea eax, [esp + 0x938]
xor ecx, ecx
mov dword [esp + 0x28], edi
mov dword [esp + 0x20], ebx
jmp 0x408339
mov edx, dword [esp + 0x2c]
inc edx
add ecx, 8
add eax, 0x400
mov esi, dword [esp + 4]
cmp edx, edi
je 0x40843b
mov dword [esp + 0x2c], edx
mov dword [esp + 4], ebp
mov dword [esp + 0xc], esi
xor esi, esi
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + esi*4 + 0x534], edx
mov ebx, dword [eax + esi*4 - 4]
mov ebp, ebx
and ebp, edx
xor ebx, edx
lea edx, [ebx + ebp*2]
mov dword [esp + esi*4 + 0x538], edx
mov ebx, dword [eax + esi*4]
mov ebp, ebx
and ebp, edx
xor ebx, edx
lea edx, [ebx + ebp*2]
add esi, 2
cmp esi, 0x100
jne 0x408350
cmp byte [esp + 0xb], 0
mov ebp, dword [esp + 0xc]
jne 0x408320
cmp dword [esp + 0x1c], 0
je 0x4083fc
xor esi, esi
mov edi, dword [esp + 4]
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + esi*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0x534]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0x534], ebp
mov edx, dword [esp + 0xc]
mov edx, dword [edx + esi*4]
mov dword [edi + ebx*4], edx
mov edx, dword [esp + 0xc]
movzx edx, word [edx + esi*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0x534]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0x534], ebp
mov ebp, dword [esp + 0xc]
mov edx, dword [ebp + esi*4 + 4]
mov dword [edi + ebx*4], edx
mov ebx, dword [esp + 0x20]
add esi, 2
cmp ebx, esi
jne 0x4083a0
jmp 0x4083fe
xor esi, esi
test byte [esp], 1
mov edi, dword [esp + 0x28]
je 0x408320
movzx edx, word [ebp + esi*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0x534]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0x534], ebp
mov ebp, dword [esp + 0xc]
mov edx, dword [ebp + esi*4]
mov esi, dword [esp + 4]
mov dword [esi + ebx*4], edx
jmp 0x408320
cmp dword [esp], 0
je 0x408805
mov ecx, dword [esp]
cmp ecx, 1
jne 0x40845b
mov eax, dword [esp + 4]
mov word [eax], 1
jmp 0x40866c
mov edx, dword [esp + 4]
movzx eax, word [edx + 4]
add word [edx], ax
cmp ecx, 3
jl 0x4084fb
mov eax, 2
mov ebp, 2
sub ebp, dword [esp]
xor edx, edx
mov esi, 1
mov ebx, dword [esp + 4]
jmp 0x4084a7
movzx ecx, word [ebx + edx*4]
add word [ebx + esi*4], cx
mov word [ebx + edx*4], si
inc edx
lea ecx, [esi + ebp]
inc ecx
inc esi
cmp ecx, 1
je 0x4084fb
movzx ecx, word [ebx + edx*4]
cmp eax, dword [esp]
jge 0x4084b9
movzx edi, word [ebx + eax*4]
cmp cx, di
jae 0x4084d0
mov word [ebx + esi*4], cx
mov word [ebx + edx*4], si
inc edx
cmp eax, dword [esp]
jge 0x408490
jmp 0x4084da
inc eax
mov word [ebx + esi*4], di
cmp eax, dword [esp]
jge 0x408490
cmp edx, esi
jge 0x4084f0
movzx ecx, word [ebx + edx*4]
movzx edi, word [ebx + eax*4]
cmp cx, di
jb 0x408494
jmp 0x4084f4
movzx edi, word [ebx + eax*4]
inc eax
add word [ebx + esi*4], di
jmp 0x40849d
mov ecx, dword [esp]
mov ebx, dword [esp + 4]
mov word [ebx + ecx*4 - 8], 0
add ecx, 0xfffffffd
js 0x408581
mov eax, dword [esp]
lea edx, [eax + 2]
mov eax, ecx
and edx, 3
je 0x408531
mov eax, ecx
nop
nop
nop
movzx esi, word [ebx + eax*4]
movzx esi, word [ebx + esi*4]
inc esi
mov word [ebx + eax*4], si
dec eax
dec edx
jne 0x408520
cmp ecx, 3
jb 0x408581
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebx + eax*4 - 4]
movzx ecx, word [ebx + ecx*4]
inc ecx
mov word [ebx + eax*4 - 4], cx
movzx ecx, word [ebx + eax*4 - 8]
movzx ecx, word [ebx + ecx*4]
inc ecx
mov word [ebx + eax*4 - 8], cx
movzx ecx, word [ebx + eax*4 - 0xc]
movzx ecx, word [ebx + ecx*4]
inc ecx
mov word [ebx + eax*4 - 0xc], cx
movzx ecx, word [ebx + eax*4 - 0x10]
movzx ecx, word [ebx + ecx*4]
inc ecx
mov word [ebx + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x408540
mov ecx, dword [esp]
mov eax, ecx
xor eax, 0xfffffffd
and ecx, 0xfffffffd
lea ecx, [eax + ecx*2]
inc ecx
mov esi, 1
xor ebx, ebx
mov eax, dword [esp + 0x1c]
jmp 0x4085ac
lea esi, [edi + edi]
inc ebx
test edi, edi
jle 0x408662
test ecx, ecx
js 0x4085e0
lea ebp, [ecx + 1]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edx, dword [esp + 4]
movzx edx, word [edx + ecx*4]
cmp ebx, edx
jne 0x4085e2
inc edi
dec ecx
cmp ebp, edi
jne 0x4085c0
mov ecx, 0xffffffff
mov edi, ebp
jmp 0x4085e2
xor edi, edi
mov edx, esi
sub edx, edi
jle 0x4085a0
mov ebp, edi
not ebp
add ebp, esi
and edx, 3
je 0x408627
mov dword [esp + 0x20], ebp
mov dword [esp + 0xc], edi
mov ebp, edx
mov edx, dword [esp + 4]
lea edx, [edx + eax*4]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edx], bx
inc edi
add edx, 0xfffffffc
cmp ebp, edi
jne 0x408610
sub esi, edi
sub eax, edi
mov edi, dword [esp + 0xc]
mov ebp, dword [esp + 0x20]
cmp ebp, 3
mov edx, dword [esp + 4]
jb 0x4085a0
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edx + eax*4], bx
mov word [edx + eax*4 - 4], bx
mov word [edx + eax*4 - 8], bx
mov word [edx + eax*4 - 0xc], bx
add eax, 0xfffffffc
add esi, 0xfffffffc
cmp esi, edi
jg 0x408640
jmp 0x4085a0
cmp dword [esp], 0
jle 0x408805
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x1c], 3
mov edi, dword [esp + 4]
jb 0x4086ba
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
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 0x408690
test eax, eax
je 0x4086dd
mov edx, dword [esp + 4]
lea ecx, [edx + ecx*4]
xor edx, edx
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 0x4086d0
cmp dword [esp], 2
jl 0x408805
mov edx, dword [esp + 0x15cc]
lea eax, [edx + 1]
cmp eax, 0x21
jge 0x408760
mov ecx, dword [esp + edx*4 + 0x30]
neg edx
mov esi, dword [esp + 0x15cc]
and edx, 3
je 0x40871c
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + esi*4 + 0x30], ecx
inc eax
dec edx
jne 0x408710
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408758
add eax, 3
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x24]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + edx*4 + 0x30], ecx
add eax, 4
cmp eax, 0x24
jne 0x408730
test edx, edx
jle 0x4087f5
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
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 0x408770
mov edx, 1
mov ecx, dword [esp + 0x15cc]
shl edx, cl
cmp eax, edx
jne 0x408aad
jmp 0x408805
mov ecx, ebx
and ecx, 0xfffffffe
mov edx, dword [esp + 0x10]
add edx, eax
add edx, 0x8194
xor edi, edi
xor eax, eax
jmp 0x4087bb
add eax, 2
cmp ecx, eax
je 0x4081e3
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4087d6
mov word [esp + edi*4 + 0xb4], si
mov word [esp + edi*4 + 0xb6], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x4087b0
mov word [esp + edi*4 + 0xb4], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0xb6], si
inc edi
jmp 0x4087b0
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x408aad
mov ebp, dword [esp + 0x14]
shl ebp, 5
mov edi, dword [esp + 0x10]
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408cf0
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408cf0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
jle 0x408935
add dword [esp + 4], 0xfffffffe
mov eax, 1
mov dword [esp + 0x14], ebp
jmp 0x408888
mov ebx, dword [esp]
mov dword [esp], ebx
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
je 0x408935
mov ecx, dword [esp + eax*4 + 0x30]
test ecx, ecx
jle 0x408870
mov edx, ecx
and edx, 3
je 0x4088e0
mov dword [esp + 0xc], ecx
mov ecx, dword [esp]
mov esi, dword [esp + 4]
lea edi, [esi + ecx*4]
xor esi, esi
mov ecx, dword [esp + 0x10]
nop
nop
nop
nop
nop
movzx ebx, word [edi]
mov ebp, dword [esp + 0x14]
add ebp, ecx
mov byte [ebx + ebp + 0x8f12], al
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x4088b0
sub dword [esp], esi
mov ecx, dword [esp + 0xc]
mov edx, ecx
sub edx, esi
mov ebp, dword [esp + 0x14]
jmp 0x4088e2
mov edx, ecx
cmp ecx, 4
mov ebx, dword [esp]
mov edi, dword [esp + 4]
jb 0x408873
dec edx
nop
movzx ecx, word [edi + ebx*4]
mov esi, dword [esp + 0x10]
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 0x4088f0
jmp 0x408873
mov ebx, dword [esp + 0x15c8]
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x4089d7
lea edx, [eax - 1]
cmp eax, 2
jne 0x408968
mov eax, 2
xor ecx, ecx
jmp 0x4089ab
mov ebx, edx
and ebx, 0xfffffffe
mov eax, 2
xor ecx, ecx
mov esi, 0xfffffffd
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x2c]
add ecx, ecx
mov dword [esp + eax*4 + 0x934], ecx
add ecx, dword [esp + eax*4 + 0x30]
add ecx, ecx
mov dword [esp + eax*4 + 0x938], ecx
add eax, 2
lea edi, [ebx + esi]
add edi, 0xfffffffe
add esi, 0xfffffffe
cmp edi, 0xfffffffd
jne 0x408980
test dl, 1
mov ebx, dword [esp + 0x15c8]
je 0x4089d7
mov edx, eax
xor edx, 0x3ffffffe
mov esi, eax
and esi, 0x1ffffffe
lea edx, [edx + esi*2]
add ecx, dword [esp + edx*4 + 0x34]
add ecx, ecx
mov dword [esp + eax*4 + 0x934], ecx
test ebx, ebx
jle 0x408aa2
xor eax, eax
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
mov ebp, dword [esp + 0x10]
add edx, ebp
shl ecx, 6
add ecx, ebp
mov dword [esp + 0xc], ecx
jmp 0x408a1c
mov ecx, dword [esp + 0xc]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15c8]
inc eax
cmp eax, ebx
je 0x408aa2
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408a13
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 0x408a7f
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 0x408a50
test edi, edi
je 0x408a00
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 0x408a90
jmp 0x408a00
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x15cc]
dec dword [esp + ecx*4 + 0x30]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408ad8
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x408ac0
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
dec eax
cmp eax, edx
jne 0x408aad
jmp 0x408805