Function at 0x408a10
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.004094e0
mov edi, edx
mov dword [esp + 0x10], ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00409590
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x24], edi
je 0x408ad7
test esi, esi
mov edx, esi
jle 0x409287
xor eax, eax
cmp edx, 1
je 0x408aa8
mov ecx, dword [esp + 0x15c8]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x24]
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
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 0x408a90
mov edx, dword [esp + 0x15c8]
test dl, 1
je 0x409287
mov ecx, dword [esp + 0x24]
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 0x409287
lea ebp, [edi + edi*8]
mov eax, ebp
shl eax, 6
mov dword [esp + 0x20], eax
test esi, esi
mov dword [esp + 0x18], ebp
jle 0x408bd9
cmp esi, 1
jne 0x409058
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408b32
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x20]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408b32
mov word [esp + ebx*4 + 0x4b4], cx
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00409590
add esp, 0xc
test ebx, ebx
sete byte [esp + 3]
je 0x408bf0
xor eax, eax
cmp ebx, 1
je 0x408baf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
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 0x408b70
test bl, 1
je 0x408bd0
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 0x408bf9
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00409590
add esp, 0xc
xor ebx, ebx
mov byte [esp + 3], 1
xor eax, eax
mov dword [esp + 0x1c], ebx
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x2c], ecx
lea eax, [ebx - 1]
mov dword [esp + 0x28], eax
mov eax, ebx
and eax, 0xfffffffe
mov dword [esp + 0xc], eax
lea ebp, [esp + 0x4b4]
lea eax, [esp + 0x1134]
xor ecx, ecx
lea edi, [esp + 0x934]
xor ebx, ebx
jmp 0x408c5a
inc ebx
add ecx, 8
add edi, 0x400
mov eax, esi
cmp ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 4]
je 0x408d60
mov dword [esp + 0x14], ebx
mov esi, ebp
mov dword [esp + 4], eax
mov eax, 3
xor edx, edx
nop
nop
nop
nop
nop
mov dword [esp + eax*4 + 0xa8], edx
add edx, dword [edi + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xac], edx
add edx, dword [edi + eax*4 - 8]
mov dword [esp + eax*4 + 0xb0], edx
add edx, dword [edi + eax*4 - 4]
mov dword [esp + eax*4 + 0xb4], edx
add edx, dword [edi + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x408c70
cmp byte [esp + 3], 0
mov ebx, dword [esp + 0x14]
jne 0x408c40
mov dword [esp + 8], esi
cmp dword [esp + 0x28], 0
je 0x408d1a
xor eax, eax
nop
nop
nop
mov esi, dword [esp + 8]
movzx edx, word [esi + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov edx, dword [esi + eax*4]
mov ebp, dword [esp + 4]
mov dword [ebp + ebx*4], edx
movzx edx, word [esi + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov edx, dword [esi + eax*4 + 4]
mov esi, dword [esp + 4]
mov dword [esi + ebx*4], edx
add eax, 2
cmp dword [esp + 0xc], eax
jne 0x408cc0
jmp 0x408d1c
xor eax, eax
test byte [esp + 0x1c], 1
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 8]
je 0x408c40
movzx edx, word [esi + eax*4]
shr edx, cl
movzx edx, dl
mov esi, dword [esp + edx*4 + 0xb4]
lea ebp, [esi + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov edx, dword [esp + 8]
mov eax, dword [edx + eax*4]
mov edx, dword [esp + 4]
mov dword [edx + esi*4], eax
mov esi, dword [esp + 8]
jmp 0x408c40
mov ebx, dword [esp + 0x1c]
test ebx, ebx
je 0x409155
cmp ebx, 1
jne 0x408d7c
mov word [ebp], 1
jmp 0x408fbc
movzx eax, word [ebp + 4]
add word [ebp], ax
mov eax, ebx
not eax
and eax, 1
mov ecx, dword [esp + 0xc]
sub ecx, eax
mov dword [esp + 0xc], ecx
cmp ecx, 2
jl 0x408e18
xor eax, eax
mov ecx, 2
mov esi, 1
jmp 0x408dc2
movzx ebp, word [edi + ecx*4]
inc ecx
add word [edi + esi*4], bp
mov ebp, edi
inc esi
cmp dword [esp + 0xc], esi
je 0x408e18
movzx edx, word [ebp + eax*4]
cmp ecx, ebx
mov edi, ebp
jge 0x408dd6
movzx ebp, word [edi + ecx*4]
cmp dx, bp
jae 0x408e00
mov word [edi + esi*4], dx
mov word [edi + eax*4], si
inc eax
cmp ecx, ebx
jge 0x408e09
cmp eax, esi
jge 0x408db0
movzx edx, word [edi + eax*4]
movzx ebp, word [edi + ecx*4]
cmp dx, bp
jae 0x408db4
jmp 0x408e0d
inc ecx
mov word [edi + esi*4], bp
cmp ecx, ebx
jl 0x408de3
movzx edx, word [edi + eax*4]
add word [edi + esi*4], dx
mov word [edi + eax*4], si
inc eax
jmp 0x408db9
mov eax, ebx
xor eax, 2
mov ecx, ebx
and ecx, 0xfffffffd
add ecx, ecx
sub ecx, eax
mov word [ebp + ecx*4], 0
cmp ebx, 3
jl 0x408eb5
lea eax, [ebx - 3]
mov esi, ebp
mov ebp, eax
mov edi, ebx
and edi, 3
xor edi, 2
je 0x408e61
mov eax, ebp
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esi + eax*4]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4], dx
dec eax
dec edi
jne 0x408e50
cmp ebp, 3
mov ebp, esi
jb 0x408eb5
inc eax
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + eax*4 - 4]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 4], dx
movzx edx, word [ebp + eax*4 - 8]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 8], dx
movzx edx, word [ebp + eax*4 - 0xc]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 0xc], dx
movzx edx, word [ebp + eax*4 - 0x10]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + eax*4 - 0x10], dx
add eax, 0xfffffffc
jne 0x408e70
mov dword [esp + 0x14], 1
xor eax, eax
mov esi, dword [esp + 0xc]
jmp 0x408eee
mov edx, dword [esp + 4]
mov ebp, dword [esp + 8]
lea edi, [ebp*2]
mov dword [esp + 0x14], edi
inc eax
test ebp, ebp
mov ebp, edx
je 0x408fb4
test ecx, ecx
mov dword [esp + 0xc], esi
js 0x408f20
lea edi, [ecx + 1]
xor edx, edx
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
cmp eax, esi
jne 0x408f30
inc edx
dec ecx
cmp edi, edx
jne 0x408f00
mov ecx, 0xffffffff
mov esi, dword [esp + 0xc]
mov edx, edi
jmp 0x408f34
xor edx, edx
jmp 0x408f34
mov esi, dword [esp + 0xc]
mov edi, dword [esp + 0x14]
sub edi, edx
mov dword [esp + 8], edx
jle 0x408ed0
and edi, 3
je 0x408f6f
mov edx, dword [esp + 4]
lea esi, [edx + esi*4]
xor edx, edx
nop
nop
mov word [esi], ax
inc edx
add esi, 0xfffffffc
cmp edi, edx
jne 0x408f50
mov ebp, dword [esp + 0x14]
mov edi, ebp
sub edi, edx
mov esi, dword [esp + 0xc]
sub esi, edx
mov edx, dword [esp + 8]
jmp 0x408f75
mov ebp, dword [esp + 0x14]
mov edi, ebp
sub edx, ebp
cmp edx, 0xfffffffc
mov edx, dword [esp + 4]
ja 0x408ed4
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edx + esi*4], ax
mov word [edx + esi*4 - 4], ax
mov word [edx + esi*4 - 8], ax
mov word [edx + esi*4 - 0xc], ax
add esi, 0xfffffffc
add edi, 0xfffffffc
cmp edi, dword [esp + 8]
jg 0x408f90
jmp 0x408ed4
test ebx, ebx
jle 0x409155
mov eax, ebx
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x28], 3
jb 0x40900b
mov edx, ebx
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x30]
add ecx, 4
cmp edx, ecx
jne 0x408fe0
test eax, eax
je 0x40902d
lea ecx, [ecx*4]
add ecx, ebp
xor edx, edx
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x30]
inc edx
cmp eax, edx
jne 0x409020
cmp ebx, 2
jl 0x409155
mov ecx, dword [esp + 0x15cc]
cmp ecx, 0x20
jge 0x409118
mov ebx, dword [esp + ecx*4 + 0x30]
mov edi, ecx
test cl, 1
jne 0x4090c5
mov eax, ecx
jmp 0x4090d9
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x20]
add edx, eax
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40908b
add eax, 2
cmp ecx, eax
je 0x408afc
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4090a6
mov word [esp + ebx*4 + 0x4b4], si
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x409080
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
jmp 0x409080
lea eax, [ecx + 1]
mov edx, dword [esp + ecx*4 + 0x34]
mov esi, edx
and esi, ebx
xor edx, ebx
lea ebx, [edx + esi*2]
mov dword [esp + ecx*4 + 0x30], ebx
cmp edi, 0x1f
je 0x40910a
nop
nop
mov edx, dword [esp + eax*4 + 0x34]
mov esi, edx
and esi, ebx
xor edx, ebx
lea ecx, [edx + esi*2]
mov dword [esp + edi*4 + 0x30], ecx
mov edx, dword [esp + eax*4 + 0x38]
add eax, 2
mov esi, edx
and esi, ecx
xor edx, ecx
lea ebx, [edx + esi*2]
mov dword [esp + edi*4 + 0x30], ebx
cmp eax, 0x20
jne 0x4090e0
test edi, edi
mov ecx, edi
mov ebx, dword [esp + 0x1c]
mov ebp, dword [esp + 4]
jle 0x409147
lea edx, [ecx + 1]
xor ecx, ecx
xor eax, eax
nop
mov esi, dword [esp + edx*4 + 0x2c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x409120
mov edx, 1
mov ecx, dword [esp + 0x15cc]
shl edx, cl
cmp eax, edx
jne 0x40941d
jmp 0x409155
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40941d
mov ecx, dword [esp + 0x18]
shl ecx, 5
mov esi, dword [esp + 0x10]
mov dword [esp + 0x18], ecx
lea eax, [esi + ecx]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00409590
add esp, 0xc
mov eax, dword [esp + 0x20]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00409590
add esp, 0xc
cmp dword [esp + 0x15cc], 0
jle 0x409280
add ebp, 0xfffffffe
mov eax, 1
mov ecx, dword [esp + 0x18]
add ecx, dword [esp + 0x10]
mov dword [esp + 0x18], ecx
mov dword [esp + 4], ebp
jmp 0x4091d2
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
je 0x409280
mov ecx, dword [esp + eax*4 + 0x30]
test ecx, ecx
jle 0x4091c0
mov edx, ecx
and edx, 3
je 0x409230
mov dword [esp + 0x1c], ebx
lea edi, [ebx*4]
add edi, ebp
xor esi, esi
mov ebp, dword [esp + 0x18]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [edi]
mov byte [ebx + ebp + 0x8f12], al
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x409200
mov ebx, dword [esp + 0x1c]
sub ebx, esi
mov edx, ecx
sub edx, esi
mov ebp, dword [esp + 4]
jmp 0x409232
mov edx, ecx
cmp ecx, 4
mov esi, dword [esp + 0x18]
jb 0x4091c0
dec edx
nop
nop
nop
nop
movzx ecx, word [ebp + ebx*4]
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]
add ebx, 0xfffffffc
mov byte [ecx + esi + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x409240
jmp 0x4091c0
mov edx, dword [esp + 0x15c8]
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x409331
lea edx, [eax - 1]
cmp eax, 2
jne 0x4092b3
xor eax, eax
mov ecx, 2
jmp 0x409300
mov esi, edx
and esi, 0xfffffffe
neg esi
xor eax, eax
mov ecx, 2
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, ecx
and edi, 0x3ffffffe
add eax, dword [esp + edi*4 + 0x2c]
add eax, eax
mov dword [esp + ecx*4 + 0x934], eax
add eax, dword [esp + edi*4 + 0x30]
add eax, eax
mov dword [esp + ecx*4 + 0x938], eax
lea edi, [esi + ecx]
add edi, 2
add ecx, 2
cmp edi, 2
jne 0x4092d0
test dl, 1
mov edx, dword [esp + 0x15c8]
je 0x409331
mov edx, ecx
not edx
and edx, 1
mov esi, ecx
and esi, 0x3ffffffe
sub esi, edx
mov edx, dword [esp + 0x15c8]
add eax, dword [esp + esi*4 + 0x30]
add eax, eax
mov dword [esp + ecx*4 + 0x934], eax
test edx, edx
jle 0x409412
xor eax, eax
mov ecx, dword [esp + 0x24]
lea esi, [ecx + ecx*8]
mov edi, esi
shl edi, 5
mov ecx, dword [esp + 0x10]
add edi, ecx
mov dword [esp + 4], edi
shl esi, 6
add esi, ecx
mov dword [esp + 8], esi
jmp 0x40937c
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov edx, dword [esp + 0x15c8]
inc eax
cmp eax, edx
je 0x409412
mov ecx, dword [esp + 4]
movzx ebx, byte [eax + ecx + 0x8f12]
test ebx, ebx
je 0x409373
mov edx, dword [esp + ebx*4 + 0x934]
mov ecx, edx
and ecx, 1
mov edi, edx
xor edi, 1
lea ecx, [edi + ecx*2]
mov dword [esp + ebx*4 + 0x934], ecx
xor edi, edi
cmp bl, 4
jb 0x4093ef
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, edx
shr ecx, 2
mov esi, edx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, edx
and edi, 2
or edi, esi
mov esi, edx
shr esi, 3
and ecx, 1
or ecx, edi
shr edx, 4
and esi, 1
lea edi, [esi + ecx*2]
add ebp, 0xfffffffc
jne 0x4093c0
and ebx, 3
je 0x409360
mov ecx, edx
nop
nop
nop
nop
nop
nop
shr ecx, 1
and edx, 1
lea edi, [edx + edi*2]
mov edx, ecx
dec ebx
jne 0x409400
jmp 0x409360
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 0x409448
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x409430
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
dec eax
cmp eax, edx
jne 0x40941d
jmp 0x409155