Function at 0x408000
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408a20
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00408be0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x1c], ebx
je 0x4080bc
test esi, esi
mov ecx, esi
jle 0x408880
xor eax, eax
cmp ecx, 1
je 0x408088
mov ecx, dword [esp + 0x15c8]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x1c]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
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 0x408070
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408880
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c8]
inc dword [esp + eax*4 + 0x30]
jmp 0x408880
lea eax, [ebx + ebx*8]
mov dword [esp + 0x10], eax
shl eax, 6
test esi, esi
mov dword [esp + 0x18], edi
mov dword [esp + 0x24], eax
jle 0x4081b9
cmp esi, 1
jne 0x4083fb
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408115
mov ecx, dword [esp + 0x24]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408115
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.00408be0
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x4081d0
xor eax, eax
cmp ebx, 1
je 0x40818f
mov ecx, ebx
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 0x408150
test bl, 1
je 0x4081b0
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 0x4081d9
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408be0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x2c], eax
lea eax, [ebx - 1]
mov dword [esp + 0x14], eax
mov edx, ebx
and edx, 0xfffffffe
lea edi, [esp + 0x4b4]
lea eax, [esp + 0x1134]
xor ecx, ecx
lea ebp, [esp + 0x934]
mov dword [esp + 0x28], 0
mov dword [esp], ebx
mov dword [esp + 0x20], edx
jmp 0x408242
mov edi, dword [esp + 0x28]
inc edi
add ecx, 8
add ebp, 0x400
mov eax, esi
mov dword [esp + 0x28], edi
cmp edi, dword [esp + 0x2c]
mov edi, dword [esp + 0xc]
je 0x408339
mov esi, edi
mov dword [esp + 0xc], eax
mov eax, 3
xor edx, edx
nop
mov dword [esp + eax*4 + 0xa8], edx
add edx, dword [ebp + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xac], edx
add edx, dword [ebp + eax*4 - 8]
mov dword [esp + eax*4 + 0xb0], edx
add edx, dword [ebp + eax*4 - 4]
mov dword [esp + eax*4 + 0xb4], edx
add edx, dword [ebp + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x408250
cmp byte [esp + 7], 0
jne 0x408220
cmp dword [esp + 0x14], 0
mov dword [esp + 8], esi
je 0x4082fb
xor eax, eax
nop
nop
nop
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 edi, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], edi
mov edx, dword [esi + eax*4]
mov edi, dword [esp + 0xc]
mov dword [edi + ebx*4], edx
movzx edx, word [esi + 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 edx, dword [esi + eax*4 + 4]
mov esi, dword [esp + 0xc]
mov dword [esi + edi*4], edx
mov edx, dword [esp + 0x20]
add eax, 2
cmp edx, eax
jne 0x4082a0
jmp 0x4082fd
xor eax, eax
mov ebx, dword [esp]
test bl, 1
mov esi, dword [esp + 8]
je 0x408220
movzx edx, word [esi + 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]
mov eax, dword [esi + eax*4]
mov edx, dword [esp + 0xc]
mov dword [edx + edi*4], eax
jmp 0x408220
test ebx, ebx
mov ebp, dword [esp + 0x10]
je 0x408737
cmp dword [esp], 1
jne 0x408355
mov word [edi], 1
jmp 0x4085fe
movzx eax, word [edi + 4]
add word [edi], ax
cmp dword [esp + 0x14], 2
jl 0x408455
mov eax, 2
mov ecx, 2
mov ebp, dword [esp]
sub ecx, ebp
mov dword [esp + 8], ecx
xor edx, edx
mov esi, 1
jmp 0x4083b1
movzx ecx, word [edi + edx*4]
add word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
mov ebp, dword [esp]
mov ecx, dword [esp + 8]
add ecx, esi
inc ecx
inc esi
cmp ecx, 1
je 0x408467
movzx ecx, word [edi + edx*4]
cmp eax, ebp
jge 0x4083c2
movzx ebp, word [edi + eax*4]
cmp cx, bp
jae 0x4083d0
mov word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
jmp 0x4083d5
inc eax
mov word [edi + esi*4], bp
mov ecx, dword [esp]
cmp eax, ecx
jge 0x408390
cmp edx, esi
jge 0x4083f0
movzx ecx, word [edi + edx*4]
movzx ebp, word [edi + eax*4]
cmp cx, bp
jb 0x408394
jmp 0x4083f4
movzx ebp, word [edi + eax*4]
inc eax
add word [edi + esi*4], bp
jmp 0x40839d
mov ecx, esi
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40841b
add eax, 2
cmp ecx, eax
je 0x4080e3
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408436
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 0x408410
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
jmp 0x408410
mov eax, dword [esp]
lea ebx, [eax - 2]
mov word [edi + eax*4 - 8], 0
jmp 0x4084f1
lea ebx, [ebp - 2]
mov word [edi + ebp*4 - 8], 0
cmp ebp, 3
jl 0x4084f1
lea edx, [ebp - 3]
lea ecx, [ebp + 2]
mov eax, edx
and ecx, 3
je 0x4084a1
mov eax, edx
nop
nop
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 0x408490
cmp edx, 3
jb 0x4084f1
inc eax
nop
nop
nop
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 0x4084b0
mov esi, 1
mov dword [esp + 8], 0
mov eax, dword [esp + 0x14]
jmp 0x408529
mov ecx, dword [esp + 0xc]
mov esi, ebp
add esi, ebp
inc edi
mov dword [esp + 8], edi
test ebp, ebp
mov ebp, dword [esp + 0x10]
jle 0x4085f2
xor ebp, ebp
test ebx, ebx
js 0x408570
mov edi, dword [esp + 8]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, dword [esp + 0xc]
movzx ecx, word [ecx + ebx*4]
cmp edi, ecx
jne 0x408574
mov ecx, ebp
and ecx, 1
xor ebp, 1
lea ebp, [ebp + ecx*2]
lea ecx, [ebx - 1]
test ebx, ebx
mov ebx, ecx
jg 0x408540
mov ebx, 0xffffffff
jmp 0x408574
mov edi, dword [esp + 8]
mov edx, esi
sub edx, ebp
jle 0x408510
mov ecx, ebp
not ecx
add ecx, esi
and edx, 3
je 0x4085b5
mov dword [esp + 0x20], ecx
mov ecx, dword [esp + 0xc]
mov dword [esp + 8], edx
lea edx, [ecx + eax*4]
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edx], di
inc ecx
add edx, 0xfffffffc
cmp dword [esp + 8], ecx
jne 0x4085a0
sub esi, ecx
sub eax, ecx
mov ecx, dword [esp + 0x20]
cmp ecx, 3
mov ecx, dword [esp + 0xc]
jb 0x408514
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ecx + eax*4], di
mov word [ecx + eax*4 - 4], di
mov word [ecx + eax*4 - 8], di
mov word [ecx + eax*4 - 0xc], di
add eax, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebp
jg 0x4085d0
jmp 0x408514
mov edi, ecx
cmp dword [esp], 0
jle 0x408737
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x14], 3
jb 0x40864a
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
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 0x408620
test eax, eax
je 0x40866d
lea ecx, [edi + 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 + 0x30]
inc edx
cmp eax, edx
jne 0x408660
cmp dword [esp], 2
jl 0x408737
mov edx, dword [esp + 0x15cc]
lea eax, [edx + 1]
cmp eax, 0x21
jge 0x4086ec
mov ecx, dword [esp + edx*4 + 0x30]
neg edx
mov esi, dword [esp + 0x15cc]
and edx, 3
je 0x4086ac
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + esi*4 + 0x30], ecx
inc eax
dec edx
jne 0x4086a0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x4086e8
add eax, 3
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x24]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + edx*4 + 0x30], ecx
add eax, 4
cmp eax, 0x24
jne 0x4086c0
test edx, edx
jle 0x408727
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x2c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x408700
mov edx, 1
mov ecx, dword [esp + 0x15cc]
shl edx, cl
cmp eax, edx
jne 0x4089d7
jmp 0x408737
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x4089d7
shl ebp, 5
mov esi, dword [esp + 0x18]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408be0
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408be0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
jle 0x408875
add edi, 0xfffffffe
mov eax, 1
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], ebp
jmp 0x4087bc
mov ebx, ebp
mov ebp, dword [esp]
mov dword [esp], ebp
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
mov ebp, ebx
je 0x408875
mov ebx, dword [esp + eax*4 + 0x30]
test ebx, ebx
jle 0x4087a0
mov edx, ebx
and edx, 3
je 0x408810
mov dword [esp + 8], ebx
mov ecx, dword [esp + 0x18]
mov esi, dword [esp]
lea ebp, [edi + esi*4]
xor esi, esi
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 0x4087e0
sub dword [esp], esi
mov ebx, dword [esp + 8]
mov edx, ebx
sub edx, esi
mov ecx, dword [esp + 0x10]
jmp 0x408814
mov ecx, ebp
mov edx, ebx
cmp ebx, 4
mov ebp, dword [esp]
mov edi, dword [esp + 0xc]
mov ebx, ecx
jb 0x4087a5
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebp*4]
mov esi, dword [esp + 0x18]
add esi, ebx
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebp*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebp*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebp*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
add ebp, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408830
jmp 0x4087a5
mov ecx, dword [esp + 0x15c8]
mov edi, dword [esp + 0x18]
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x4088fd
lea ecx, [eax - 1]
cmp eax, 2
jne 0x4088a8
xor eax, eax
mov edx, 2
jmp 0x4088e4
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 0x4088c0
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c8]
je 0x4088fd
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
test ecx, ecx
jle 0x4089cc
xor eax, eax
mov edx, dword [esp + 0x1c]
lea edx, [edx + edx*8]
mov esi, edx
shl esi, 5
add esi, edi
mov dword [esp + 0xc], esi
shl edx, 6
add edx, edi
mov dword [esp + 8], edx
jmp 0x40894c
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c8]
inc eax
cmp eax, ecx
je 0x4089cc
mov edx, dword [esp + 0xc]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x408943
mov edx, dword [esp + ebx*4 + 0x934]
lea ecx, [edx + 1]
mov dword [esp + ebx*4 + 0x934], ecx
xor edi, edi
cmp bl, 1
je 0x4089b0
mov ebp, ebx
and ebp, 0xfffffffe
xor ecx, ecx
nop
nop
nop
nop
nop
mov edi, edx
xor edi, 0x7ffffffe
mov esi, edx
or esi, 1
and esi, edi
mov edi, edx
shr edi, 1
shl ecx, 2
add esi, esi
or esi, ecx
mov ecx, edi
xor ecx, 0xfffffffe
or edi, 1
and edi, ecx
or edi, esi
shr edx, 2
mov ecx, edi
add ebp, 0xfffffffe
jne 0x408980
test bl, 1
je 0x408930
add edi, edi
mov ecx, edx
xor ecx, 0xfffffffe
or edx, 1
and edx, ecx
or edi, edx
jmp 0x408930
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
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408a08
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x4089f0
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
dec eax
cmp eax, edx
jne 0x4089d7
jmp 0x408737