Function at 0x408850
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.00409200
mov ebx, edx
mov dword [esp + 0xc], ecx
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.00409350
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x18], ebx
je 0x40890a
test esi, esi
mov ecx, esi
jle 0x408ff7
xor eax, eax
cmp ecx, 1
je 0x4088d8
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
lea eax, [ebx + ebx*8]
shl eax, 5
mov edx, dword [esp + 0xc]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x28]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x28]
add eax, 2
cmp ecx, eax
jne 0x4088c0
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x408ff7
lea ecx, [ebx + ebx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x28]
jmp 0x408ff7
lea eax, [ebx + ebx*8]
mov dword [esp + 0x20], eax
mov ecx, eax
shl ecx, 6
test esi, esi
mov dword [esp + 0x1c], ecx
jle 0x4089d3
mov eax, dword [esp + 0xc]
add eax, ecx
add eax, 0x8192
xor ecx, ecx
xor edi, edi
jmp 0x408954
mov edx, ecx
and edx, 1
xor ecx, 1
lea ecx, [ecx + edx*2]
cmp ecx, dword [esp + 0x15c0]
jge 0x408970
movzx edx, word [eax + ecx*2]
test dx, dx
je 0x408940
mov word [esp + edi*4 + 0xcac], dx
mov word [esp + edi*4 + 0xcae], cx
inc edi
jmp 0x408940
lea eax, [esp + 0x4ac]
push 0x800
push 0
push eax
call fcn.00409350
add esp, 0xc
test edi, edi
sete byte [esp + 0x10]
je 0x4089ea
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0xcac]
mov edx, ecx
not edx
or edx, 0xff
add edx, ecx
inc dword [esp + edx*4 + 0x4b0]
shr ecx, 8
inc dword [esp + ecx*4 + 0x8ac]
inc eax
cmp edi, eax
jne 0x4089a0
mov eax, dword [esp + 0x8ac]
jmp 0x4089f3
lea eax, [esp + 0x4ac]
push 0x800
push 0
push eax
call fcn.00409350
add esp, 0xc
xor edi, edi
mov byte [esp + 0x10], 1
xor eax, eax
xor ecx, ecx
cmp eax, edi
setne cl
inc ecx
mov dword [esp + 0x24], ecx
lea ebx, [esp + 0x112c]
lea edx, [esp + 0xcac]
xor ecx, ecx
lea eax, [esp + 0x4ac]
mov dword [esp + 4], 0
mov dword [esp + 0x14], edi
jmp 0x408a52
mov esi, dword [esp + 4]
inc esi
add ecx, 8
mov eax, dword [esp + 8]
add eax, 0x400
mov edx, dword [esp]
mov dword [esp + 4], esi
cmp esi, dword [esp + 0x24]
je 0x408aed
mov dword [esp], ebx
mov ebx, edx
mov ebp, 3
xor edx, edx
nop
nop
mov dword [esp + ebp*4 + 0xa0], edx
add edx, dword [eax + ebp*4 - 0xc]
mov dword [esp + ebp*4 + 0xa4], edx
add edx, dword [eax + ebp*4 - 8]
mov dword [esp + ebp*4 + 0xa8], edx
add edx, dword [eax + ebp*4 - 4]
mov dword [esp + ebp*4 + 0xac], edx
add edx, dword [eax + ebp*4]
add ebp, 4
cmp ebp, 0x103
jne 0x408a60
mov dword [esp + 8], eax
cmp byte [esp + 0x10], 0
jne 0x408a30
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebx + ebp*4]
shr edx, cl
movzx edx, dl
mov esi, dword [esp + edx*4 + 0xac]
mov edi, dword [ebx + ebp*4]
mov eax, ebx
mov ebx, dword [esp]
mov dword [ebx + esi*4], edi
mov ebx, eax
mov edi, esi
and esi, 1
xor edi, 1
lea esi, [edi + esi*2]
mov edi, dword [esp + 0x14]
mov dword [esp + edx*4 + 0xac], esi
inc ebp
cmp edi, ebp
jne 0x408ab0
jmp 0x408a30
test edi, edi
je 0x408ed7
cmp edi, 1
jne 0x408b07
mov eax, dword [esp]
mov word [eax], 1
jmp 0x408d5b
mov ebp, dword [esp]
movzx eax, word [ebp + 4]
add word [ebp], ax
cmp edi, 3
jl 0x408ba8
mov eax, 2
mov ecx, 2
sub ecx, edi
mov dword [esp + 4], ecx
xor edx, edx
mov ebx, 1
jmp 0x408b58
movzx ebp, word [esi + eax*4]
inc eax
add word [esi + ebx*4], bp
mov ebp, esi
mov ecx, dword [esp + 4]
add ecx, ebx
inc ecx
inc ebx
cmp ecx, 1
je 0x408ba8
movzx ecx, word [ebp + edx*4]
cmp eax, edi
mov esi, ebp
jge 0x408b6c
movzx ebp, word [esi + eax*4]
cmp cx, bp
jae 0x408b90
mov word [esi + ebx*4], cx
mov word [esi + edx*4], bx
inc edx
cmp eax, edi
jge 0x408b99
cmp edx, ebx
jge 0x408b40
movzx ecx, word [esi + edx*4]
movzx ebp, word [esi + eax*4]
cmp cx, bp
jae 0x408b44
jmp 0x408b9d
inc eax
mov word [esi + ebx*4], bp
cmp eax, edi
jl 0x408b79
movzx ecx, word [esi + edx*4]
add word [esi + ebx*4], cx
mov word [esi + edx*4], bx
inc edx
jmp 0x408b49
mov word [ebp + edi*4 - 8], 0
mov ecx, edi
add ecx, 0xfffffffd
js 0x408c35
mov edx, edi
and edx, 3
xor edx, 2
mov eax, ecx
je 0x408be4
mov eax, ecx
nop
nop
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 0x408bd0
cmp ecx, 3
jb 0x408c35
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 0x408bf0
lea eax, [edi - 1]
lea ecx, [edi - 2]
mov ebx, 1
xor edx, edx
jmp 0x408c5c
lea ebx, [esi + esi]
inc edx
test esi, esi
je 0x408d53
test ecx, ecx
mov dword [esp + 4], ebx
js 0x408cb0
lea esi, [ecx + 1]
mov dword [esp + 8], esi
mov ebp, ecx
not ebp
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp]
movzx esi, word [esi + ecx*4]
cmp edx, esi
jne 0x408cc0
inc ebx
dec ecx
mov esi, ebp
add esi, ebx
jne 0x408c80
mov ecx, 0xffffffff
mov ebp, dword [esp]
mov esi, dword [esp + 8]
jmp 0x408cc5
xor esi, esi
sub ebx, esi
jg 0x408ccd
jmp 0x408c50
mov esi, ebx
mov ebp, dword [esp]
mov ebx, dword [esp + 4]
sub ebx, esi
jle 0x408c50
mov dword [esp + 8], esi
and ebx, 3
je 0x408d08
mov esi, ebx
lea ebx, [eax*4]
add ebx, ebp
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebx], dx
inc ebp
add ebx, 0xfffffffc
cmp esi, ebp
jne 0x408cf0
mov ebx, dword [esp + 4]
sub ebx, ebp
sub eax, ebp
mov ebp, dword [esp]
jmp 0x408d0c
mov ebx, dword [esp + 4]
mov esi, dword [esp + 8]
sub esi, dword [esp + 4]
cmp esi, 0xfffffffc
mov esi, dword [esp + 8]
ja 0x408c50
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp + eax*4], dx
mov word [ebp + eax*4 - 4], dx
mov word [ebp + eax*4 - 8], dx
mov word [ebp + eax*4 - 0xc], dx
add eax, 0xfffffffc
add ebx, 0xfffffffc
cmp ebx, esi
jg 0x408d30
jmp 0x408c50
test edi, edi
jle 0x408ed7
lea edx, [edi - 1]
mov eax, edi
and eax, 3
xor ecx, ecx
cmp edx, 3
mov ebx, dword [esp]
jb 0x408daa
mov edx, edi
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 + 0x28]
movzx esi, word [ebx + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x408d80
test eax, eax
je 0x408dcd
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 + 0x28]
inc edx
cmp eax, edx
jne 0x408dc0
cmp edi, 2
jl 0x408ed7
mov ecx, dword [esp + 0x15c4]
lea edi, [ecx + ecx]
mov edx, edi
and edx, 2
mov ebx, ecx
xor ebx, 1
lea eax, [edx + ebx]
cmp eax, 0x20
jg 0x408e0e
mov eax, dword [esp + ecx*4 + 0x28]
add edx, ebx
dec edx
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x2c]
mov dword [esp + ecx*4 + 0x28], eax
inc edx
cmp edx, 0x20
jl 0x408e00
test ecx, ecx
jle 0x408e26
mov ebp, ecx
and ebp, 3
cmp ecx, 4
mov dword [esp + 4], ebx
jae 0x408e34
mov ebx, ecx
xor edx, edx
jmp 0x408e95
mov eax, 1
shl eax, cl
xor edx, edx
jmp 0x40914d
mov dword [esp + 0x10], edi
mov dword [esp + 8], ebp
mov esi, ecx
and esi, 0x7ffffffc
lea ebp, [esp + ecx*4]
add ebp, 0x28
xor edx, edx
xor eax, eax
nop
nop
mov edi, dword [ebp]
mov ecx, eax
shl edi, cl
add edi, edx
mov edx, dword [ebp - 4]
inc cl
shl edx, cl
mov ebx, dword [ebp - 8]
mov ecx, eax
add cl, 2
shl ebx, cl
add ebx, edx
add ebx, edi
mov edx, dword [ebp - 0xc]
mov ecx, eax
add cl, 3
shl edx, cl
add edx, ebx
add eax, 4
add ebp, 0xfffffff0
cmp eax, esi
jne 0x408e50
mov ebx, dword [esp + 0x15c4]
sub ebx, eax
mov ebp, dword [esp + 8]
mov edi, dword [esp + 0x10]
test ebp, ebp
je 0x408ebd
mov ecx, dword [esp + 0x15c4]
sub ecx, ebx
lea eax, [esp + ebx*4]
add eax, 0x28
neg ebp
xor ebx, ebx
nop
nop
nop
nop
mov esi, dword [eax + ebx*4]
shl esi, cl
add edx, esi
inc ecx
dec ebx
cmp ebp, ebx
jne 0x408eb0
mov eax, 1
mov ecx, dword [esp + 0x15c4]
shl eax, cl
cmp edx, eax
mov ebx, dword [esp + 4]
jne 0x40914d
mov esi, dword [esp + 0x20]
shl esi, 5
mov edi, dword [esp + 0xc]
lea eax, [edi + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00409350
add esp, 0xc
mov eax, dword [esp + 0x1c]
add eax, edi
add eax, 0x8852
mov edi, dword [esp + 0x14]
push 0x240
push 0
push eax
call fcn.00409350
add esp, 0xc
cmp dword [esp + 0x15c4], 0
mov ebx, dword [esp + 0x18]
mov ebp, dword [esp]
jle 0x408ff0
add ebp, 0xfffffffe
mov eax, 1
add esi, dword [esp + 0xc]
mov dword [esp], ebp
jmp 0x408f52
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15c4]
mov eax, ecx
je 0x408ff0
mov ecx, dword [esp + eax*4 + 0x28]
test ecx, ecx
jle 0x408f40
mov edx, ecx
and edx, 3
je 0x408fa0
mov dword [esp + 0x14], edi
lea ebp, [ebp + edi*4]
xor ebx, ebx
nop
nop
nop
nop
nop
mov edi, esi
movzx esi, word [ebp]
mov byte [esi + edi + 0x8f12], al
mov esi, edi
inc ebx
add ebp, 0xfffffffc
cmp edx, ebx
jne 0x408f70
mov edx, ecx
sub edx, ebx
mov edi, dword [esp + 0x14]
sub edi, ebx
mov ebx, dword [esp + 0x18]
mov ebp, dword [esp]
cmp ecx, 4
jb 0x408f40
jmp 0x408fa7
mov edx, ecx
cmp ecx, 4
jb 0x408f40
dec edx
nop
nop
nop
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 0x408fb0
jmp 0x408f40
mov ecx, dword [esp + 0x15c0]
mov dword [esp + 0x4b0], 0
mov eax, dword [esp + 0x15c4]
cmp eax, 2
jl 0x409071
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40901f
xor eax, eax
mov edx, 2
jmp 0x409058
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x4b4], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x4b8], eax
add edx, 2
cmp ebx, edx
jne 0x409030
add edx, 2
mov ebx, dword [esp + 0x18]
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x409071
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x4ac], eax
test ecx, ecx
jle 0x409142
xor eax, eax
lea edi, [ebx + ebx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0xc]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp], edi
jmp 0x4090bb
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x409142
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x4090b2
mov ecx, dword [esp + ebx*4 + 0x4ac]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x4ac], edi
xor edi, edi
cmp bl, 4
jb 0x40911f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
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 0x4090f0
and ebx, 3
je 0x4090a0
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 0x409130
jmp 0x4090a0
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
and edi, 0xfffffffc
sub edi, ebx
lea ecx, [edi + 1]
jmp 0x409173
dec ebp
mov dword [esp + ebx*4 + 0x24], ebp
add dword [esp + ebx*4 + 0x28], 2
dec edx
cmp edx, eax
je 0x408ed7
mov esi, dword [esp + 0x15c4]
dec dword [esp + esi*4 + 0x28]
test edi, edi
jle 0x40916a
mov ebx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, dword [esp + ebx*4 + 0x24]
test ebp, ebp
jne 0x409160
dec ebx
cmp ebx, 1
jg 0x409190
jmp 0x40916a