Function at 0x408960
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00409370
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00409420
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x14], edi
mov dword [esp + 0x20], ebx
je 0x408a27
test esi, esi
mov ebx, dword [esp + 0x15cc]
jle 0x4091d6
xor eax, eax
cmp dword [esp + 0x15c8], 1
je 0x4089f8
mov ecx, dword [esp + 0x15c8]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x20]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0x14]
add edx, eax
add edx, 0x8f13
xor eax, eax
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 0x4089e0
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x4091d6
mov ecx, dword [esp + 0x20]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0x14]
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x4091d6
lea eax, [ebx + ebx*8]
mov dword [esp + 0x10], eax
shl eax, 6
test esi, esi
mov dword [esp + 0x28], eax
jle 0x408b2e
cmp esi, 1
jne 0x408b57
xor ebp, ebp
xor eax, eax
mov ebx, dword [esp + 0x15cc]
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408a83
mov ecx, dword [esp + 0x28]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408a83
mov word [esp + ebp*4 + 0x4b4], cx
mov word [esp + ebp*4 + 0x4b6], ax
inc ebp
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00409420
add esp, 0xc
test ebp, ebp
sete byte [esp + 0xb]
je 0x408bc5
mov ecx, ebp
xor eax, eax
cmp ebp, 1
je 0x408aff
mov ecx, ebp
and ecx, 0xfffffffe
xor eax, eax
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 0x408ac0
mov edx, ebp
test dl, 1
je 0x408b22
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 0x408bce
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00409420
add esp, 0xc
xor edx, edx
mov byte [esp + 0xb], 1
xor eax, eax
mov ebx, dword [esp + 0x15cc]
jmp 0x408bce
mov ecx, esi
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor ebp, ebp
xor eax, eax
mov ebx, dword [esp + 0x15cc]
jmp 0x408b8b
add eax, 2
cmp ecx, eax
je 0x408a51
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408ba6
mov word [esp + ebp*4 + 0x4b4], si
mov word [esp + ebp*4 + 0x4b6], ax
inc ebp
movzx esi, word [edx + eax*2]
test si, si
je 0x408b80
mov word [esp + ebp*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0x4b6], si
inc ebp
jmp 0x408b80
xor edx, edx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, edx
sete cl
mov ebp, 2
sub ebp, ecx
lea eax, [edx - 1]
mov dword [esp + 0x24], eax
mov dword [esp + 4], edx
and edx, 0xfffffffe
lea eax, [esp + 0x4b4]
mov dword [esp], eax
xor ecx, ecx
lea eax, [esp + 0x1134]
lea esi, [esp + 0x934]
mov dword [esp + 0x18], 0
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x1c], edx
jmp 0x408c3e
mov edi, dword [esp + 0x18]
inc edi
add ecx, 8
add esi, 0x400
mov eax, dword [esp + 0xc]
mov dword [esp + 0x18], edi
cmp edi, ebp
je 0x408d4e
mov edx, dword [esp]
mov dword [esp + 0xc], edx
mov dword [esp], eax
mov eax, 3
xor edx, edx
nop
mov dword [esp + eax*4 + 0xa8], edx
add edx, dword [esi + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xac], edx
add edx, dword [esi + eax*4 - 8]
mov dword [esp + eax*4 + 0xb0], edx
add edx, dword [esi + eax*4 - 4]
mov dword [esp + eax*4 + 0xb4], edx
add edx, dword [esi + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x408c50
cmp byte [esp + 0xb], 0
jne 0x408c20
cmp dword [esp + 0x24], 0
je 0x408cfd
xor eax, eax
mov ebp, dword [esp]
mov ebx, dword [esp + 0xc]
nop
nop
nop
nop
movzx edx, word [ebx + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea edi, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], edi
mov edx, dword [esp + 0xc]
mov edx, dword [edx + eax*4]
mov dword [ebp + ebx*4], edx
mov edx, dword [esp + 0xc]
movzx edx, word [edx + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb4]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb4], ebx
mov ebx, dword [esp + 0xc]
mov edx, dword [ebx + eax*4 + 4]
mov dword [ebp + edi*4], edx
mov edx, dword [esp + 0x1c]
add eax, 2
cmp edx, eax
jne 0x408ca0
jmp 0x408cff
xor eax, eax
test byte [esp + 4], 1
mov ebx, dword [esp + 0x15cc]
mov ebp, dword [esp + 0x2c]
je 0x408c20
mov ebp, dword [esp + 0xc]
movzx edx, word [ebp + eax*4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb4]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb4], ebx
mov ebx, dword [esp + 0x15cc]
mov eax, dword [ebp + eax*4]
mov ebp, dword [esp + 0x2c]
mov edx, dword [esp]
mov dword [edx + edi*4], eax
jmp 0x408c20
cmp dword [esp + 4], 0
mov ebp, dword [esp + 0x10]
je 0x409094
mov ecx, dword [esp + 4]
cmp ecx, 1
jne 0x408d73
mov eax, dword [esp]
mov word [eax], 1
jmp 0x408fad
mov edx, dword [esp]
movzx eax, word [edx + 4]
add word [edx], ax
cmp ecx, 3
jl 0x408e0b
mov eax, 2
mov ebx, 2
sub ebx, ecx
xor edx, edx
mov esi, 1
mov edi, dword [esp]
jmp 0x408dbb
movzx ecx, word [edi + edx*4]
add word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
mov ebp, dword [esp + 0x10]
lea ecx, [ebx + esi]
inc ecx
inc esi
cmp ecx, 1
je 0x408e1a
movzx ecx, word [edi + edx*4]
cmp eax, dword [esp + 4]
jge 0x408dce
movzx ebp, word [edi + eax*4]
cmp cx, bp
jae 0x408de0
mov word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
cmp eax, dword [esp + 4]
jge 0x408da0
jmp 0x408deb
inc eax
mov word [edi + esi*4], bp
cmp eax, dword [esp + 4]
jge 0x408da0
cmp edx, esi
jge 0x408e00
movzx ecx, word [edi + edx*4]
movzx ebp, word [edi + eax*4]
cmp cx, bp
jb 0x408da4
jmp 0x408e04
movzx ebp, word [edi + eax*4]
inc eax
add word [edi + esi*4], bp
jmp 0x408dad
lea edi, [ecx - 2]
mov word [edx + ecx*4 - 8], 0
jmp 0x408eb1
mov eax, dword [esp + 4]
mov edi, dword [esp]
mov word [edi + eax*4 - 8], 0
lea edx, [eax - 3]
lea ecx, [eax + 2]
mov eax, edx
and ecx, 3
je 0x408e51
mov eax, edx
nop
nop
nop
nop
nop
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 ecx
jne 0x408e40
mov ecx, dword [esp + 4]
lea edi, [ecx - 2]
cmp edx, 3
jb 0x408eb1
inc eax
mov edx, dword [esp]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edx + eax*4 - 4]
movzx ecx, word [edx + ecx*4]
inc ecx
mov word [edx + eax*4 - 4], cx
movzx ecx, word [edx + eax*4 - 8]
movzx ecx, word [edx + ecx*4]
inc ecx
mov word [edx + eax*4 - 8], cx
movzx ecx, word [edx + eax*4 - 0xc]
movzx ecx, word [edx + ecx*4]
inc ecx
mov word [edx + eax*4 - 0xc], cx
movzx ecx, word [edx + eax*4 - 0x10]
movzx ecx, word [edx + ecx*4]
inc ecx
mov word [edx + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x408e70
mov esi, 1
xor edx, edx
mov eax, dword [esp + 0x24]
jmp 0x408ed3
lea esi, [ebx + ebx]
inc edx
test ebx, ebx
mov ebx, dword [esp + 0x15cc]
jle 0x408fa2
test edi, edi
js 0x408f00
lea ebx, [edi + 1]
xor ebp, ebp
nop
nop
nop
nop
mov ecx, dword [esp]
movzx ecx, word [ecx + edi*4]
cmp edx, ecx
jne 0x408f10
inc ebp
dec edi
cmp ebx, ebp
jne 0x408ee0
mov edi, 0xffffffff
jmp 0x408f12
xor ebx, ebx
jmp 0x408f16
mov ebx, ebp
mov ebp, dword [esp + 0x10]
mov ecx, esi
sub ecx, ebx
jle 0x408ec0
mov ebp, ecx
mov ecx, ebx
not ecx
add ecx, esi
mov dword [esp + 0x1c], ecx
and ebp, 3
mov dword [esp + 0x18], ebp
mov dword [esp + 0xc], ebx
je 0x408f5f
mov ecx, dword [esp]
lea ecx, [ecx + eax*4]
xor ebp, ebp
mov ebx, dword [esp + 0x18]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ecx], dx
inc ebp
add ecx, 0xfffffffc
cmp ebx, ebp
jne 0x408f50
sub esi, ebp
sub eax, ebp
mov ebp, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
cmp ecx, 3
mov ecx, dword [esp]
mov ebx, dword [esp + 0xc]
jb 0x408ec0
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ecx + eax*4], dx
mov word [ecx + eax*4 - 4], dx
mov word [ecx + eax*4 - 8], dx
mov word [ecx + eax*4 - 0xc], dx
add eax, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebx
jg 0x408f80
jmp 0x408ec0
cmp dword [esp + 4], 0
jle 0x409094
mov eax, dword [esp + 4]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x24], 3
mov edi, dword [esp]
jb 0x408ffa
mov edx, dword [esp + 4]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x30]
add ecx, 4
cmp edx, ecx
jne 0x408fd0
test eax, eax
je 0x40901d
mov edx, dword [esp]
lea ecx, [edx + ecx*4]
xor edx, edx
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 0x409010
cmp dword [esp + 4], 2
jl 0x409094
cmp ebx, 0x20
jge 0x409050
lea eax, [ebx + 1]
mov ecx, dword [esp + ebx*4 + 0x30]
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + ebx*4 + 0x30], ecx
mov edx, eax
and edx, 1
xor eax, 1
lea eax, [eax + edx*2]
cmp eax, 0x21
jl 0x409030
test ebx, ebx
jle 0x40932d
mov edx, ebx
not edx
xor eax, eax
mov esi, ebx
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, dword [esp + esi*4 + 0x30]
mov edi, esi
xor edi, ebx
mov ecx, edx
and ecx, ebx
add ecx, ecx
sub ecx, edi
shl ebp, cl
add eax, ebp
lea ecx, [esi - 1]
inc edx
cmp esi, 1
mov esi, ecx
ja 0x409060
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
mov ebp, dword [esp + 0x10]
jne 0x409349
shl ebp, 5
mov edi, dword [esp + 0x14]
mov esi, ebp
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00409420
add esp, 0xc
mov eax, dword [esp + 0x28]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00409420
add esp, 0xc
test ebx, ebx
jle 0x4091d6
add dword [esp], 0xfffffffe
mov eax, 1
mov dword [esp + 0x10], esi
jmp 0x409110
mov ebx, dword [esp + 4]
mov edi, esi
mov esi, edi
mov dword [esp + 4], ebx
lea ecx, [eax + 1]
mov ebx, dword [esp + 0x15cc]
cmp eax, ebx
mov eax, ecx
je 0x4091d6
mov ecx, dword [esp + eax*4 + 0x30]
test ecx, ecx
jle 0x4090f0
mov edx, ecx
and edx, 3
je 0x409170
mov dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 4]
mov edi, dword [esp]
lea ebp, [edi + esi*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp]
mov ebx, dword [esp + 0x10]
add ebx, ecx
mov byte [edi + ebx + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x409140
mov ecx, dword [esp + 0xc]
mov edx, ecx
sub edx, esi
sub dword [esp + 4], esi
mov esi, dword [esp + 0x10]
jmp 0x409172
mov edx, ecx
cmp ecx, 4
mov ebx, dword [esp + 4]
mov ebp, dword [esp]
mov edi, esi
jb 0x4090f6
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebp + ebx*4]
mov esi, dword [esp + 0x14]
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 0x409190
jmp 0x4090f6
mov dword [esp + 0x938], 0
cmp ebx, 2
jl 0x409245
lea eax, [ebx - 1]
cmp ebx, 2
jne 0x4091fb
mov edx, 2
xor ecx, ecx
test al, 1
jne 0x409238
jmp 0x409245
mov ebx, eax
and ebx, 0xfffffffe
xor ecx, ecx
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + edx*4 + 0x34]
add ecx, ecx
mov dword [esp + edx*4 + 0x93c], ecx
add ecx, dword [esp + edx*4 + 0x38]
add ecx, ecx
mov dword [esp + edx*4 + 0x940], ecx
add edx, 2
cmp ebx, edx
jne 0x409210
add edx, 2
test al, 1
je 0x409245
add ecx, dword [esp + edx*4 + 0x2c]
add ecx, ecx
mov dword [esp + edx*4 + 0x934], ecx
cmp dword [esp + 0x15c8], 0
jle 0x409322
xor eax, eax
mov ecx, dword [esp + 0x20]
lea esi, [ecx + ecx*8]
mov edx, esi
shl edx, 5
mov ecx, dword [esp + 0x14]
add edx, ecx
shl esi, 6
add esi, ecx
mov dword [esp + 0xc], esi
jmp 0x40929a
mov ecx, dword [esp + 0xc]
mov word [ecx + eax*2 + 0x8852], bx
inc eax
cmp eax, dword [esp + 0x15c8]
je 0x409322
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x40928c
mov ebp, dword [esp + ecx*4 + 0x934]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x934], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x4092ff
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 0x4092d0
test edi, edi
je 0x409280
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 0x409310
jmp 0x409280
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x409349
dec eax
cmp eax, edx
je 0x409094
dec dword [esp + ebx*4 + 0x30]
mov ecx, ebx
nop
cmp ecx, 2
jl 0x409340
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x409350
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
jmp 0x409340