Function at 0x408510
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408f90
mov edi, edx
mov dword [esp + 0x10], ecx
mov ebx, dword [esp + 0x15cc]
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00409050
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x20], edi
je 0x4085de
test esi, esi
mov ecx, esi
jle 0x408dd7
xor eax, eax
cmp ecx, 1
je 0x4085a8
mov ecx, dword [esp + 0x15c8]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x20]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0x10]
add edx, eax
add edx, 0x8f13
xor eax, eax
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 0x408590
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408dd7
mov ecx, dword [esp + 0x20]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0x10]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c8]
inc dword [esp + eax*4 + 0x30]
jmp 0x408dd7
lea eax, [edi + edi*8]
mov dword [esp + 0x28], eax
shl eax, 6
mov dword [esp + 0x1c], eax
test esi, esi
jle 0x4086db
cmp esi, 1
jne 0x408b09
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x40863b
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x1c]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40863b
mov edx, edi
mov word [esp + edi*4 + 0x4b4], cx
mov word [esp + edi*4 + 0x4b6], ax
inc edx
mov edi, edx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00409050
add esp, 0xc
test edi, edi
sete byte [esp + 0xb]
je 0x4086f2
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x4086af
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
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 0x408670
mov edx, edi
test dl, 1
je 0x4086d2
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 0x4086fb
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00409050
add esp, 0xc
xor edx, edx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, edx
setne cl
inc ecx
mov dword [esp + 0x2c], ecx
lea eax, [edx - 1]
mov dword [esp + 0x24], eax
mov dword [esp], edx
mov eax, edx
and eax, 0xfffffffe
xor edi, edi
lea ebp, [esp + 0x4b4]
lea esi, [esp + 0x1134]
lea edx, [esp + 0x934]
xor ecx, ecx
mov dword [esp + 0x18], eax
jmp 0x40875c
inc edi
add ecx, 8
add edx, 0x400
mov esi, dword [esp + 4]
cmp edi, dword [esp + 0x2c]
mov ebp, dword [esp + 0xc]
je 0x408874
mov dword [esp + 4], ebp
mov dword [esp + 0xc], esi
mov ebp, 3
xor esi, esi
nop
nop
nop
nop
nop
mov dword [esp + ebp*4 + 0xa8], esi
add esi, dword [edx + ebp*4 - 0xc]
mov dword [esp + ebp*4 + 0xac], esi
add esi, dword [edx + ebp*4 - 8]
mov dword [esp + ebp*4 + 0xb0], esi
add esi, dword [edx + ebp*4 - 4]
mov dword [esp + ebp*4 + 0xb4], esi
add esi, dword [edx + ebp*4]
add ebp, 4
cmp ebp, 0x103
jne 0x408770
cmp byte [esp + 0xb], 0
jne 0x408740
mov dword [esp + 0x14], edi
cmp dword [esp + 0x24], 0
je 0x40881d
xor ebp, ebp
mov eax, dword [esp + 0xc]
nop
nop
mov esi, dword [esp + 4]
movzx ebx, word [esi + ebp*4]
shr ebx, cl
movzx esi, bl
mov ebx, dword [esp + esi*4 + 0xb4]
lea edi, [ebx + 1]
mov dword [esp + esi*4 + 0xb4], edi
mov esi, dword [esp + 4]
mov esi, dword [esi + ebp*4]
mov dword [eax + ebx*4], esi
mov esi, dword [esp + 4]
movzx ebx, word [esi + ebp*4 + 4]
shr ebx, cl
movzx esi, bl
mov edi, dword [esp + esi*4 + 0xb4]
lea ebx, [edi + 1]
mov dword [esp + esi*4 + 0xb4], ebx
mov esi, dword [esp + 4]
mov esi, dword [esi + ebp*4 + 4]
mov dword [eax + edi*4], esi
add ebp, 2
cmp dword [esp + 0x18], ebp
jne 0x4087c0
jmp 0x40881f
xor ebp, ebp
test byte [esp], 1
mov ebx, dword [esp + 0x15cc]
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
je 0x408740
mov eax, dword [esp + 4]
movzx ebx, word [eax + ebp*4]
shr ebx, cl
movzx esi, bl
mov edi, dword [esp + esi*4 + 0xb4]
lea ebx, [edi + 1]
mov dword [esp + esi*4 + 0xb4], ebx
mov ebx, dword [esp + 0x15cc]
mov esi, dword [eax + ebp*4]
mov eax, dword [esp + 0xc]
mov dword [eax + edi*4], esi
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
jmp 0x408740
cmp dword [esp], 0
je 0x408cbd
mov ecx, dword [esp]
cmp ecx, 1
jne 0x408891
mov word [ebp], 1
jmp 0x408ab7
movzx eax, word [ebp + 4]
add word [ebp], ax
cmp ecx, 3
jl 0x408929
mov eax, 2
mov ebx, 2
sub ebx, dword [esp]
xor edx, edx
mov esi, 1
jmp 0x4088d5
movzx ebp, word [edi + eax*4]
inc eax
add word [edi + esi*4], bp
mov ebp, edi
lea ecx, [ebx + esi]
inc ecx
inc esi
cmp ecx, 1
je 0x408929
movzx ecx, word [ebp + edx*4]
cmp eax, dword [esp]
mov edi, ebp
jge 0x4088ea
movzx ebp, word [edi + eax*4]
cmp cx, bp
jae 0x408910
mov word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
cmp eax, dword [esp]
jge 0x40891a
cmp edx, esi
jge 0x4088c0
movzx ecx, word [edi + edx*4]
movzx ebp, word [edi + eax*4]
cmp cx, bp
jae 0x4088c4
jmp 0x40891e
inc eax
mov word [edi + esi*4], bp
cmp eax, dword [esp]
jl 0x4088f8
movzx ecx, word [edi + edx*4]
add word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
jmp 0x4088c9
mov edx, dword [esp]
mov word [ebp + edx*4 - 8], 0
mov ecx, edx
add ecx, 0xfffffffd
js 0x4089b5
and edx, 3
xor edx, 2
mov eax, ecx
je 0x408964
mov eax, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + eax*4]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + eax*4], si
dec eax
dec edx
jne 0x408950
cmp ecx, 3
mov edx, dword [esp]
jb 0x4089b5
inc eax
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 0x408970
lea ecx, [edx - 2]
mov dword [esp + 4], 1
xor edx, edx
mov esi, dword [esp + 0x24]
jmp 0x4089e4
mov eax, ebp
lea ebx, [edi + edi]
mov dword [esp + 4], ebx
inc edx
test edi, edi
mov ebp, eax
je 0x408aa2
test ecx, ecx
js 0x408a10
lea edi, [ecx + 1]
xor ebp, ebp
nop
nop
nop
mov eax, dword [esp + 0xc]
movzx eax, word [eax + ecx*4]
cmp edx, eax
jne 0x408a20
inc ebp
dec ecx
cmp edi, ebp
jne 0x4089f0
mov ecx, 0xffffffff
jmp 0x408a22
xor edi, edi
jmp 0x408a26
mov edi, ebp
mov ebp, dword [esp + 0xc]
mov ebx, dword [esp + 4]
mov eax, ebx
sub eax, edi
jle 0x4089d0
and eax, 3
mov dword [esp + 0x14], eax
je 0x408a68
lea ebp, [ebp + esi*4]
xor eax, eax
mov ebx, dword [esp + 0x14]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp], dx
inc eax
add ebp, 0xfffffffc
cmp ebx, eax
jne 0x408a50
mov ebx, dword [esp + 4]
mov ebp, ebx
sub ebp, eax
sub esi, eax
jmp 0x408a6a
mov ebp, ebx
mov eax, edi
sub eax, ebx
cmp eax, 0xfffffffc
mov eax, dword [esp + 0xc]
ja 0x4089d2
nop
nop
nop
nop
nop
mov word [eax + esi*4], dx
mov word [eax + esi*4 - 4], dx
mov word [eax + esi*4 - 8], dx
mov word [eax + esi*4 - 0xc], dx
add esi, 0xfffffffc
add ebp, 0xfffffffc
cmp ebp, edi
jg 0x408a80
jmp 0x4089d2
cmp dword [esp], 0
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x15cc]
jle 0x408cbd
cmp dword [esp + 0x24], 0
je 0x408b75
mov edi, eax
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebp + eax*4]
mov edx, dword [esp + ecx*4 + 0x30]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov dword [esp + ecx*4 + 0x30], edx
movzx ecx, word [ebp + eax*4 + 4]
mov edx, dword [esp + ecx*4 + 0x30]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov dword [esp + ecx*4 + 0x30], edx
add eax, 2
cmp edi, eax
jne 0x408ad0
jmp 0x408b77
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x1c]
add edx, eax
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x408b3b
add eax, 2
cmp ecx, eax
je 0x408601
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408b56
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 0x408b30
mov word [esp + edi*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4b6], si
inc edi
jmp 0x408b30
xor eax, eax
mov edx, dword [esp]
test dl, 1
je 0x408b9a
movzx eax, word [ebp + eax*4]
mov ecx, dword [esp + eax*4 + 0x30]
mov edx, ecx
and edx, 1
xor ecx, 1
lea ecx, [ecx + edx*2]
mov edx, dword [esp]
mov dword [esp + eax*4 + 0x30], ecx
cmp edx, 2
jl 0x408cbd
lea ecx, [ebx + ebx]
and ecx, 2
mov edx, ebx
xor edx, 1
lea eax, [ecx + edx]
cmp eax, 0x20
jg 0x408bce
mov eax, dword [esp + ebx*4 + 0x30]
add ecx, edx
dec ecx
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x30], eax
inc ecx
cmp ecx, 0x20
jl 0x408bc0
test ebx, ebx
jle 0x408be5
lea eax, [ebx - 1]
mov edi, ebx
and edi, 3
cmp eax, 3
jae 0x408bf5
xor edx, edx
mov esi, ebx
jmp 0x408c55
mov eax, 1
mov ecx, ebx
shl eax, cl
xor edx, edx
jmp 0x408c90
mov eax, ebx
and eax, 0x7ffffffc
mov dword [esp + 4], eax
lea ebp, [esp + ebx*4]
add ebp, 0x30
xor edx, edx
xor eax, eax
nop
nop
nop
nop
nop
nop
mov ebx, dword [ebp]
mov ecx, eax
shl ebx, cl
add ebx, edx
mov edx, dword [ebp - 4]
inc cl
shl edx, cl
mov esi, dword [ebp - 8]
mov ecx, eax
add cl, 2
shl esi, cl
add esi, edx
add esi, ebx
mov edx, dword [ebp - 0xc]
mov ecx, eax
add cl, 3
shl edx, cl
add edx, esi
add eax, 4
add ebp, 0xfffffff0
cmp eax, dword [esp + 4]
jne 0x408c10
mov ebx, dword [esp + 0x15cc]
mov esi, ebx
sub esi, eax
mov ebp, dword [esp + 0xc]
test edi, edi
je 0x408c85
mov ecx, ebx
sub ecx, esi
lea eax, [esp + esi*4]
add eax, 0x30
mov dword [esp + 4], eax
neg edi
xor esi, esi
nop
nop
nop
nop
nop
mov eax, edi
mov edi, dword [esp + 4]
mov edi, dword [edi + esi*4]
shl edi, cl
add edx, edi
mov edi, eax
inc ecx
dec esi
cmp eax, esi
jne 0x408c70
mov eax, 1
mov ecx, ebx
shl eax, cl
jmp 0x408cb9
dec dword [esp + ebx*4 + 0x30]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408cb8
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x408ca0
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
dec edx
cmp edx, eax
jne 0x408c90
mov edi, dword [esp + 0x28]
shl edi, 5
mov esi, dword [esp + 0x10]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00409050
add esp, 0xc
mov eax, dword [esp + 0x1c]
add eax, esi
add eax, 0x8852
mov esi, edi
push 0x240
push 0
push eax
call fcn.00409050
add esp, 0xc
test ebx, ebx
jle 0x408dd0
add ebp, 0xfffffffe
mov eax, 1
add esi, dword [esp + 0x10]
mov dword [esp + 0xc], ebp
jmp 0x408d33
mov edi, dword [esp]
mov dword [esp], edi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x408dd0
mov ecx, dword [esp + eax*4 + 0x30]
test ecx, ecx
jle 0x408d20
mov edx, ecx
and edx, 3
je 0x408d80
mov edi, dword [esp]
lea ebp, [ebp + edi*4]
mov ebx, esi
xor esi, esi
nop
nop
nop
movzx edi, word [ebp]
mov byte [edi + ebx + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x408d50
sub dword [esp], esi
mov edx, ecx
sub edx, esi
mov esi, ebx
mov ebx, dword [esp + 0x15cc]
mov ebp, dword [esp + 0xc]
jmp 0x408d82
mov edx, ecx
cmp ecx, 4
mov edi, dword [esp]
jb 0x408d23
dec edx
nop
nop
nop
nop
nop
movzx ecx, word [ebp + edi*4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + edi*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + edi*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + edi*4 - 0xc]
add edi, 0xfffffffc
mov byte [ecx + esi + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408d90
jmp 0x408d23
mov ecx, dword [esp + 0x15c8]
mov dword [esp + 0x938], 0
cmp ebx, 2
jl 0x408e4d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x408df8
xor eax, eax
mov edx, 2
jmp 0x408e34
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x93c], eax
add eax, dword [esp + edx*4 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x940], eax
add edx, 2
cmp ebx, edx
jne 0x408e10
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c8]
je 0x408e4d
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
test ecx, ecx
jle 0x408f22
xor eax, eax
mov edx, dword [esp + 0x20]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0x10]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp + 4], edi
jmp 0x408e9c
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c8]
inc eax
cmp eax, ecx
je 0x408f22
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x408e93
mov ecx, dword [esp + ebx*4 + 0x934]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x934], edi
xor edi, edi
cmp bl, 4
jb 0x408eff
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, ecx
and edi, 2
or edi, esi
mov esi, ecx
shr esi, 2
and esi, 1
or esi, edi
mov edi, ecx
shr edi, 3
and edi, 1
lea edi, [edi + esi*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x408ed0
and ebx, 3
je 0x408e80
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
lea edi, [esi + edi*2]
shr ecx, 1
dec ebx
jne 0x408f10
jmp 0x408e80
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret