Function at 0x408490
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b8
call fcn.00408ed0
mov edi, edx
mov ebp, ecx
mov esi, dword [esp + 0x15cc]
lea eax, [esp + 0x34]
push 0x84
push 0
push eax
call fcn.00408f80
add esp, 0xc
cmp dword [esp + 0x15d4], 0
mov dword [esp + 0x1c], edi
je 0x40854c
test esi, esi
mov ecx, esi
jle 0x408ccc
xor eax, eax
cmp ecx, 1
je 0x408518
mov ecx, dword [esp + 0x15cc]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x1c]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + ebp]
add edx, 0x8f13
xor eax, eax
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x34]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x34]
add eax, 2
cmp ecx, eax
jne 0x408500
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x408ccc
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, ebp
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15cc]
inc dword [esp + eax*4 + 0x34]
jmp 0x408ccc
lea ebx, [edi + edi*8]
mov eax, ebx
shl eax, 6
test esi, esi
mov dword [esp + 0x18], ebp
mov dword [esp + 0x28], eax
jle 0x40864b
cmp esi, 1
jne 0x408e0d
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x4085a3
mov ecx, dword [esp + 0x28]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4085a3
mov word [esp + edi*4 + 0x4b8], cx
mov word [esp + edi*4 + 0x4ba], ax
inc edi
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.00408f80
add esp, 0xc
test edi, edi
sete byte [esp + 0xb]
je 0x408662
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x40861f
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b8]
movzx esi, dl
inc dword [esp + esi*4 + 0x938]
shr edx, 8
inc dword [esp + edx*4 + 0xd38]
movzx edx, word [esp + eax*4 + 0x4bc]
movzx esi, dl
inc dword [esp + esi*4 + 0x938]
shr edx, 8
inc dword [esp + edx*4 + 0xd38]
add eax, 2
cmp ecx, eax
jne 0x4085e0
mov edx, edi
test dl, 1
je 0x408642
movzx eax, word [esp + eax*4 + 0x4b8]
movzx ecx, al
inc dword [esp + ecx*4 + 0x938]
shr eax, 8
inc dword [esp + eax*4 + 0xd38]
mov eax, dword [esp + 0xd38]
jmp 0x40866b
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.00408f80
add esp, 0xc
xor edx, edx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, edx
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x30], eax
lea eax, [edx - 1]
mov dword [esp + 0x20], eax
mov dword [esp], edx
and edx, 0xfffffffe
mov dword [esp + 0x24], edx
lea esi, [esp + 0x1138]
lea edx, [esp + 0x4b8]
xor edi, edi
lea eax, [esp + 0x938]
xor ecx, ecx
mov dword [esp + 0xc], ebx
jmp 0x4086c7
inc edi
add ecx, 8
add eax, 0x400
mov edx, dword [esp + 4]
cmp edi, dword [esp + 0x30]
je 0x4087e6
mov dword [esp + 4], esi
mov esi, edx
mov ebp, 3
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + ebp*4 + 0xac], edx
add edx, dword [eax + ebp*4 - 0xc]
mov dword [esp + ebp*4 + 0xb0], edx
add edx, dword [eax + ebp*4 - 8]
mov dword [esp + ebp*4 + 0xb4], edx
add edx, dword [eax + ebp*4 - 4]
mov dword [esp + ebp*4 + 0xb8], edx
add edx, dword [eax + ebp*4]
add ebp, 4
cmp ebp, 0x103
jne 0x4086e0
cmp byte [esp + 0xb], 0
jne 0x4086b0
mov dword [esp + 0x2c], eax
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], esi
cmp dword [esp + 0x20], 0
je 0x408795
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [esp + 0x10]
movzx edx, word [eax + ebp*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb8]
lea edi, [ebx + 1]
mov dword [esp + edx*4 + 0xb8], edi
mov edx, dword [eax + ebp*4]
mov esi, dword [esp + 4]
mov dword [esi + ebx*4], edx
movzx edx, word [eax + ebp*4 + 4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb8]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb8], ebx
mov edx, dword [eax + ebp*4 + 4]
mov dword [esi + edi*4], edx
add ebp, 2
cmp dword [esp + 0x24], ebp
jne 0x408740
jmp 0x408797
xor ebp, ebp
test byte [esp], 1
mov ebx, dword [esp + 0xc]
mov esi, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x2c]
je 0x4086b0
movzx edx, word [esi + ebp*4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb8]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb8], ebx
mov ebx, dword [esp + 0xc]
mov edx, dword [esi + ebp*4]
mov esi, dword [esp + 4]
mov dword [esi + edi*4], edx
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
jmp 0x4086b0
cmp dword [esp], 0
mov ebp, dword [esp + 0x18]
je 0x408b94
mov ecx, dword [esp]
cmp ecx, 1
jne 0x40880a
mov eax, dword [esp + 4]
mov word [eax], 1
jmp 0x408a4c
mov edx, dword [esp + 4]
movzx eax, word [edx + 4]
add word [edx], ax
cmp ecx, 3
jl 0x4088ab
mov eax, 2
mov ecx, 2
sub ecx, dword [esp]
xor edx, edx
mov esi, 1
jmp 0x408857
movzx ebp, word [edi + edx*4]
add word [edi + esi*4], bp
mov word [edi + edx*4], si
inc edx
lea edi, [ecx + esi]
inc edi
inc esi
cmp edi, 1
je 0x4088ab
mov edi, dword [esp + 4]
movzx ebx, word [edi + edx*4]
cmp eax, dword [esp]
jge 0x40886d
movzx ebp, word [edi + eax*4]
cmp bx, bp
jae 0x408880
mov word [edi + esi*4], bx
mov word [edi + edx*4], si
inc edx
cmp eax, dword [esp]
jge 0x408840
jmp 0x40888a
inc eax
mov word [edi + esi*4], bp
cmp eax, dword [esp]
jge 0x408840
cmp edx, esi
jge 0x4088a0
movzx ebp, word [edi + edx*4]
movzx ebx, word [edi + eax*4]
cmp bp, bx
jb 0x408844
jmp 0x4088a4
movzx ebx, word [edi + eax*4]
inc eax
add word [edi + esi*4], bx
jmp 0x40884d
mov edx, dword [esp]
mov edi, dword [esp + 4]
mov word [edi + edx*4 - 8], 0
mov ecx, edx
add ecx, 0xfffffffd
js 0x408931
add edx, 2
mov eax, ecx
and edx, 3
je 0x4088e1
mov eax, ecx
nop
nop
nop
nop
movzx esi, word [edi + eax*4]
movzx esi, word [edi + esi*4]
inc esi
mov word [edi + eax*4], si
dec eax
dec edx
jne 0x4088d0
cmp ecx, 3
mov edx, dword [esp]
jb 0x408931
inc eax
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + eax*4 - 4]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 4], cx
movzx ecx, word [edi + eax*4 - 8]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 8], cx
movzx ecx, word [edi + eax*4 - 0xc]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 0xc], cx
movzx ecx, word [edi + eax*4 - 0x10]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x4088f0
mov eax, edx
xor eax, 0xfffffffd
mov ecx, edx
and ecx, 0xfffffffd
lea ecx, [eax + ecx*2]
inc ecx
mov esi, 1
xor edx, edx
mov eax, dword [esp + 0x20]
jmp 0x408971
mov ebp, ebx
mov ebx, dword [esp + 0xc]
mov esi, ebp
add esi, ebp
mov edi, edx
and edi, 1
xor edx, 1
lea edx, [edx + edi*2]
test ebp, ebp
mov ebp, dword [esp + 0x18]
jle 0x408a42
test ecx, ecx
js 0x4089a0
lea ebx, [ecx + 1]
xor ebp, ebp
nop
nop
nop
nop
nop
nop
mov edi, dword [esp + 4]
movzx edi, word [edi + ecx*4]
cmp edx, edi
jne 0x4089b0
inc ebp
dec ecx
cmp ebx, ebp
jne 0x408980
mov ecx, 0xffffffff
jmp 0x4089b2
xor ebx, ebx
jmp 0x4089b2
mov ebx, ebp
mov edi, esi
sub edi, ebx
jle 0x408950
mov dword [esp + 0x24], edi
mov edi, ebx
not edi
add edi, esi
mov dword [esp + 0x14], edi
mov edi, dword [esp + 0x24]
and edi, 3
mov dword [esp + 0x10], ebx
je 0x4089fa
mov ebx, edi
mov edi, dword [esp + 4]
lea ebp, [edi + eax*4]
mov edi, ebx
xor ebx, ebx
mov word [ebp], dx
inc ebx
add ebp, 0xfffffffc
cmp edi, ebx
jne 0x4089e0
sub esi, ebx
sub eax, ebx
mov ebx, dword [esp + 0xc]
mov edi, dword [esp + 0x14]
jmp 0x408a02
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0xc]
cmp edi, 3
mov edi, dword [esp + 4]
mov ebp, dword [esp + 0x10]
jb 0x408956
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 0x408a20
jmp 0x408956
cmp dword [esp], 0
jle 0x408b94
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x20], 3
mov edi, dword [esp + 4]
jb 0x408a9a
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 + 0x34]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x34]
add ecx, 4
cmp edx, ecx
jne 0x408a70
test eax, eax
je 0x408abd
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 + 0x34]
inc edx
cmp eax, edx
jne 0x408ab0
cmp dword [esp], 2
jl 0x408b94
mov edx, dword [esp + 0x15d0]
lea eax, [edx + 1]
cmp eax, 0x21
jge 0x408b40
mov ecx, dword [esp + edx*4 + 0x34]
neg edx
mov esi, dword [esp + 0x15d0]
and edx, 3
je 0x408afc
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x34]
mov dword [esp + esi*4 + 0x34], ecx
inc eax
dec edx
jne 0x408af0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408b38
add eax, 3
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + edx*4 + 0x34], ecx
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + edx*4 + 0x34], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + edx*4 + 0x34], ecx
add ecx, dword [esp + eax*4 + 0x34]
mov dword [esp + edx*4 + 0x34], ecx
add eax, 4
cmp eax, 0x24
jne 0x408b10
test edx, edx
jle 0x408e75
mov esi, edx
not edx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebx, dword [esp + esi*4 + 0x34]
mov edi, esi
mov ebp, dword [esp + 0x15d0]
xor edi, ebp
mov ecx, edx
and ecx, ebp
add ecx, ecx
sub ecx, edi
shl ebx, cl
add eax, ebx
lea ecx, [esi - 1]
inc edx
cmp esi, 1
mov esi, ecx
ja 0x408b50
mov edx, 1
mov ecx, dword [esp + 0x15d0]
shl edx, cl
cmp eax, edx
mov ebx, dword [esp + 0xc]
mov ebp, dword [esp + 0x18]
jne 0x408e99
shl ebx, 5
lea eax, [ebx + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408f80
add esp, 0xc
mov eax, dword [esp + 0x28]
add eax, ebp
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408f80
add esp, 0xc
cmp dword [esp + 0x15d0], 0
jle 0x408cc5
add dword [esp + 4], 0xfffffffe
mov eax, 1
mov dword [esp + 0xc], ebx
jmp 0x408c0c
mov edi, dword [esp]
mov dword [esp], edi
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15d0]
mov eax, ecx
mov ebx, dword [esp + 0xc]
je 0x408cc5
mov edi, dword [esp + eax*4 + 0x34]
test edi, edi
jle 0x408bf0
mov edx, edi
and edx, 3
je 0x408c60
mov dword [esp + 0x10], edi
mov ecx, ebx
mov esi, dword [esp]
mov edi, dword [esp + 4]
lea ebx, [edi + esi*4]
xor esi, esi
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 0x408c30
sub dword [esp], esi
mov edi, dword [esp + 0x10]
mov edx, edi
sub edx, esi
jmp 0x408c62
mov edx, edi
cmp edi, 4
mov edi, dword [esp]
mov ebx, dword [esp + 4]
mov ebp, dword [esp + 0x18]
jb 0x408bf3
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebx + edi*4]
mov esi, dword [esp + 0xc]
add esi, ebp
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebx + edi*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebx + edi*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebx + edi*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
add edi, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408c80
jmp 0x408bf3
mov ecx, dword [esp + 0x15cc]
mov dword [esp + 0x93c], 0
mov eax, dword [esp + 0x15d0]
cmp eax, 2
jl 0x408d3d
lea ecx, [eax - 1]
cmp eax, 2
jne 0x408cf4
xor eax, eax
mov edx, 2
jmp 0x408d24
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
add eax, dword [esp + edx*4 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x940], eax
add eax, dword [esp + edx*4 + 0x3c]
add eax, eax
mov dword [esp + edx*4 + 0x944], eax
add edx, 2
cmp ebx, edx
jne 0x408d00
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15cc]
je 0x408d3d
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x938], eax
test ecx, ecx
jle 0x408e02
xor eax, eax
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, ebp
shl ecx, 6
add ecx, ebp
mov dword [esp + 4], ecx
jmp 0x408d7a
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], bx
inc eax
cmp eax, dword [esp + 0x15cc]
je 0x408e02
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408d6c
mov ebp, dword [esp + ecx*4 + 0x938]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x938], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x408ddf
and ecx, 0xfffffffc
xor ebx, ebx
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 0x408db0
test edi, edi
je 0x408d60
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 0x408df0
jmp 0x408d60
add esp, 0x15b8
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, esi
and ecx, 0xfffffffe
lea edx, [eax + ebp]
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x408e3b
add eax, 2
cmp ecx, eax
je 0x408571
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408e56
mov word [esp + edi*4 + 0x4b8], si
mov word [esp + edi*4 + 0x4ba], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x408e30
mov word [esp + edi*4 + 0x4b8], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4ba], si
inc edi
jmp 0x408e30
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x408e99
dec eax
cmp eax, edx
je 0x408b94
mov ecx, dword [esp + 0x15d0]
dec dword [esp + ecx*4 + 0x34]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408e90
mov esi, dword [esp + ecx*4 + 0x30]
dec ecx
test esi, esi
je 0x408eb0
dec esi
mov dword [esp + ecx*4 + 0x34], esi
add dword [esp + ecx*4 + 0x38], 2
jmp 0x408e90