Function at 0x408010
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408980
mov edi, edx
mov ebx, ecx
mov ebp, dword [esp + 0x15cc]
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00408b50
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x14], edi
je 0x4080d5
test esi, esi
jle 0x40877c
xor eax, eax
cmp dword [esp + 0x15c8], 1
je 0x4080a8
mov ecx, dword [esp + 0x15c8]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x14]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + ebx]
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 0x408090
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x40877c
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, ebx
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x40877c
lea eax, [edi + edi*8]
mov dword [esp + 0x20], eax
shl eax, 6
test esi, esi
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], eax
jle 0x4081d9
cmp esi, 1
jne 0x40889d
mov edi, ebx
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408130
mov ecx, dword [esp + 0x1c]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408130
mov word [esp + ebx*4 + 0xb4], cx
mov word [esp + ebx*4 + 0xb6], ax
inc ebx
lea eax, [esp + 0x534]
push 0x800
push 0
push eax
call fcn.00408b50
add esp, 0xc
test ebx, ebx
sete byte [esp + 0xb]
je 0x4081f0
xor ecx, ecx
cmp ebx, 1
je 0x4081af
mov edx, ebx
and edx, 0xfffffffe
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [esp + ecx*4 + 0xb4]
movzx esi, al
inc dword [esp + esi*4 + 0x534]
shr eax, 8
inc dword [esp + eax*4 + 0x934]
movzx eax, word [esp + ecx*4 + 0xb8]
movzx esi, al
inc dword [esp + esi*4 + 0x534]
shr eax, 8
inc dword [esp + eax*4 + 0x934]
add ecx, 2
cmp edx, ecx
jne 0x408170
test bl, 1
je 0x4081d0
movzx eax, word [esp + ecx*4 + 0xb4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x534]
shr eax, 8
inc dword [esp + eax*4 + 0x934]
mov eax, dword [esp + 0x934]
jmp 0x4081f9
lea eax, [esp + 0x534]
push 0x800
push 0
push eax
call fcn.00408b50
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
mov dword [esp], ebx
cmp eax, ebx
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x24], eax
lea eax, [esp + 0xb4]
mov dword [esp + 4], eax
lea ebp, [esp + 0x1134]
xor edx, edx
lea edi, [esp + 0x538]
xor ecx, ecx
jmp 0x40824c
mov edx, dword [esp + 0x18]
inc edx
add ecx, 8
mov edi, dword [esp + 0x28]
add edi, 0x400
cmp edx, dword [esp + 0x24]
je 0x4082f0
mov dword [esp + 0x18], edx
mov edx, dword [esp + 4]
mov dword [esp + 0x2c], edx
mov dword [esp + 4], ebp
xor edx, edx
xor eax, eax
mov dword [esp + eax*4 + 0xd34], edx
mov esi, dword [edi + eax*4 - 4]
mov ebx, esi
and ebx, edx
xor esi, edx
lea edx, [esi + ebx*2]
mov dword [esp + eax*4 + 0xd38], edx
mov esi, dword [edi + eax*4]
mov ebx, esi
and ebx, edx
xor esi, edx
lea edx, [esi + ebx*2]
add eax, 2
cmp eax, 0x100
jne 0x408260
mov dword [esp + 0x28], edi
cmp byte [esp + 0xb], 0
mov edi, dword [esp]
mov ebp, dword [esp + 0x2c]
jne 0x408230
xor eax, eax
mov dword [esp + 0xc], ecx
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + eax*4]
mov ecx, dword [esp + 0xc]
shr edx, cl
movzx ecx, dl
mov esi, dword [esp + ecx*4 + 0xd34]
mov ebx, dword [ebp + eax*4]
mov edx, dword [esp + 4]
mov dword [edx + esi*4], ebx
mov ebx, esi
and esi, 1
xor ebx, 1
lea esi, [ebx + esi*2]
mov dword [esp + ecx*4 + 0xd34], esi
mov ecx, dword [esp + 0xc]
inc eax
cmp edi, eax
jne 0x4082b0
jmp 0x408230
cmp dword [esp], 0
mov ebx, dword [esp + 4]
je 0x408655
mov ecx, dword [esp]
cmp ecx, 1
jne 0x408310
mov word [ebx], 1
jmp 0x40852c
movzx eax, word [ebx + 4]
add word [ebx], ax
cmp ecx, 3
jl 0x4083ab
mov eax, 2
mov ecx, 2
sub ecx, dword [esp]
xor edx, edx
mov esi, 1
jmp 0x408357
movzx ebp, word [ebx + edx*4]
add word [ebx + esi*4], bp
mov word [ebx + edx*4], si
inc edx
lea edi, [ecx + esi]
inc edi
inc esi
cmp edi, 1
je 0x4083ab
movzx edi, word [ebx + edx*4]
cmp eax, dword [esp]
jge 0x408369
movzx ebp, word [ebx + eax*4]
cmp di, bp
jae 0x408380
mov word [ebx + esi*4], di
mov word [ebx + edx*4], si
inc edx
cmp eax, dword [esp]
jge 0x408340
jmp 0x40838a
inc eax
mov word [ebx + esi*4], bp
cmp eax, dword [esp]
jge 0x408340
cmp edx, esi
jge 0x4083a0
movzx ebp, word [ebx + edx*4]
movzx edi, word [ebx + eax*4]
cmp bp, di
jb 0x408344
jmp 0x4083a4
movzx edi, word [ebx + eax*4]
inc eax
add word [ebx + esi*4], di
jmp 0x40834d
mov ecx, dword [esp]
mov word [ebx + ecx*4 - 8], 0
add ecx, 0xfffffffd
js 0x408431
mov eax, dword [esp]
lea edx, [eax + 2]
mov eax, ecx
and edx, 3
je 0x4083e1
mov eax, ecx
nop
nop
nop
nop
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 0x4083d0
cmp ecx, 3
jb 0x408431
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 0x4083f0
mov ecx, dword [esp]
lea eax, [ecx - 1]
add ecx, 0xfffffffe
mov esi, 1
xor edx, edx
jmp 0x40845d
mov esi, ebp
add esi, ebp
inc edx
test ebp, ebp
jle 0x408522
test ecx, ecx
js 0x408490
lea ebp, [ecx + 1]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [ebx + ecx*4]
cmp edx, ebx
jne 0x4084a0
inc edi
add ecx, 0xffffffff
mov ebx, dword [esp + 4]
jb 0x408470
mov ecx, 0xffffffff
jmp 0x4084a2
xor ebp, ebp
jmp 0x4084a6
mov ebp, edi
mov ebx, dword [esp + 4]
mov edi, esi
sub edi, ebp
jle 0x408450
mov ebx, edi
mov edi, ebp
not edi
add edi, esi
and ebx, 3
je 0x4084e7
mov dword [esp + 0x18], edi
mov dword [esp + 0xc], ebp
mov edi, dword [esp + 4]
lea edi, [edi + eax*4]
xor ebp, ebp
nop
nop
nop
nop
nop
nop
mov word [edi], dx
inc ebp
add edi, 0xfffffffc
cmp ebx, ebp
jne 0x4084d0
sub esi, ebp
sub eax, ebp
mov ebp, dword [esp + 0xc]
mov edi, dword [esp + 0x18]
mov ebx, dword [esp + 4]
cmp edi, 3
jb 0x408450
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebx + eax*4], dx
mov word [ebx + eax*4 - 4], dx
mov word [ebx + eax*4 - 8], dx
mov word [ebx + eax*4 - 0xc], dx
add eax, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebp
jg 0x408500
jmp 0x408450
cmp dword [esp], 0
jle 0x408655
mov eax, dword [esp]
lea edx, [eax - 1]
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x40857a
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + ecx*4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebx + ecx*4 + 4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebx + ecx*4 + 8]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebx + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x30]
add ecx, 4
cmp edx, ecx
jne 0x408550
test eax, eax
je 0x40859d
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 + 0x30]
inc edx
cmp eax, edx
jne 0x408590
cmp dword [esp], 2
jl 0x408655
mov edx, dword [esp + 0x15cc]
lea eax, [edx + 1]
cmp eax, 0x21
jge 0x408620
mov ecx, dword [esp + edx*4 + 0x30]
neg edx
mov esi, dword [esp + 0x15cc]
and edx, 3
je 0x4085dc
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 0x4085d0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408618
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 0x4085f0
test edx, edx
jle 0x408905
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 0x408630
mov edx, 1
mov ecx, dword [esp + 0x15cc]
shl edx, cl
cmp eax, edx
jne 0x408910
mov edi, dword [esp + 0x20]
shl edi, 5
mov esi, dword [esp + 0x10]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408b50
add esp, 0xc
mov eax, dword [esp + 0x1c]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408b50
add esp, 0xc
mov edx, dword [esp + 0x15cc]
test edx, edx
jle 0x408776
add ebx, 0xfffffffe
mov eax, 1
mov dword [esp + 4], ebx
jmp 0x4086ce
mov ebp, ebx
mov ebx, dword [esp]
mov dword [esp], ebx
lea ecx, [eax + 1]
mov edx, dword [esp + 0x15cc]
cmp eax, edx
mov eax, ecx
mov ebx, ebp
je 0x408776
mov ebp, dword [esp + eax*4 + 0x30]
test ebp, ebp
jle 0x4086b0
mov edx, ebp
and edx, 3
je 0x408720
mov dword [esp + 0xc], ebp
mov ecx, edi
mov esi, dword [esp]
lea edi, [ebx + esi*4]
xor esi, esi
nop
nop
nop
nop
nop
movzx ebx, word [edi]
mov ebp, dword [esp + 0x10]
add ebp, ecx
mov byte [ebx + ebp + 0x8f12], al
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x4086f0
sub dword [esp], esi
mov ebp, dword [esp + 0xc]
mov edx, ebp
sub edx, esi
mov edi, ecx
jmp 0x408722
mov edx, ebp
cmp ebp, 4
mov ebx, dword [esp]
mov ebp, dword [esp + 4]
jb 0x4086b5
dec edx
nop
movzx ecx, word [ebp + ebx*4]
mov esi, dword [esp + 0x10]
add esi, edi
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
add ebx, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408730
jmp 0x4086b5
mov ebp, edx
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x538], 0
mov eax, ebp
cmp ebp, 2
jl 0x4087be
xor eax, eax
mov ecx, 2
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
add eax, eax
mov dword [esp + ecx*4 + 0x534], eax
mov edx, ecx
and edx, 1
xor ecx, 1
lea ecx, [ecx + edx*2]
mov edx, ebp
cmp ecx, ebp
jle 0x4087a0
mov ecx, dword [esp + 0x15c8]
test ecx, ecx
jle 0x408892
xor eax, eax
mov edx, dword [esp + 0x14]
lea edx, [edx + edx*8]
mov esi, edx
shl esi, 5
add esi, ebx
mov dword [esp + 0xc], esi
shl edx, 6
add edx, ebx
mov dword [esp + 4], edx
jmp 0x40880c
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], bx
mov ecx, dword [esp + 0x15c8]
inc eax
cmp eax, ecx
je 0x408892
mov edx, dword [esp + 0xc]
movzx edx, byte [eax + edx + 0x8f12]
test edx, edx
je 0x408803
mov ecx, dword [esp + edx*4 + 0x534]
lea esi, [ecx + 1]
mov dword [esp + edx*4 + 0x534], esi
mov esi, edx
and esi, 3
xor ebx, ebx
cmp dl, 4
jb 0x40886f
and edx, 0xfffffffc
xor ebx, ebx
nop
nop
mov ebp, ecx
shr ebp, 2
mov edi, ecx
and edi, 1
shl edi, 2
lea edi, [edi + ebx*8]
mov ebx, ecx
and ebx, 2
or ebx, edi
mov edi, ecx
shr edi, 3
and ebp, 1
or ebp, ebx
shr ecx, 4
and edi, 1
lea ebx, [edi + ebp*2]
add edx, 0xfffffffc
jne 0x408840
test esi, esi
je 0x4087f0
mov edx, ecx
nop
nop
nop
nop
nop
nop
nop
shr edx, 1
and ecx, 1
lea ebx, [ecx + ebx*2]
mov ecx, edx
dec esi
jne 0x408880
jmp 0x4087f0
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, esi
and ecx, 0xfffffffe
mov edi, ebx
lea edx, [eax + ebx]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x4088cb
add eax, 2
cmp ecx, eax
je 0x4080fe
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4088e6
mov word [esp + ebx*4 + 0xb4], si
mov word [esp + ebx*4 + 0xb6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x4088c0
mov word [esp + ebx*4 + 0xb4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xb6], si
inc ebx
jmp 0x4088c0
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
mov ecx, dword [esp + 0x15cc]
dec ecx
jmp 0x408948
mov ebx, edi
not ebx
lea edi, [ebx + edi*2]
mov ebx, dword [esp + 4]
mov dword [esp + esi*4 + 0x30], edi
mov edi, esi
and edi, 1
xor esi, 1
lea esi, [esi + edi*2]
add dword [esp + esi*4 + 0x30], 2
dec eax
cmp eax, edx
je 0x408655
mov esi, dword [esp + 0x15cc]
dec dword [esp + esi*4 + 0x30]
test ecx, ecx
jle 0x40893f
mov esi, ecx
nop
nop
nop
nop
nop
nop
nop
mov edi, dword [esp + esi*4 + 0x30]
test edi, edi
jne 0x408920
mov edi, esi
not edi
lea esi, [edi + esi*2]
test esi, esi
jg 0x408960
jmp 0x40893f