Function at 0x407fe0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.00408a30
mov edi, edx
mov ebp, ecx
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.00408ae0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x18], edi
je 0x4080ac
test esi, esi
mov ecx, esi
jle 0x40881b
xor eax, eax
cmp ecx, 1
je 0x408078
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + ebp]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
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 0x408060
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40881b
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, ebp
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x28]
jmp 0x40881b
lea eax, [edi + edi*8]
mov dword [esp + 0x1c], eax
shl eax, 6
mov dword [esp + 0x10], eax
test esi, esi
mov dword [esp + 0x14], ebp
jle 0x4081a9
cmp esi, 1
jne 0x40839d
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x408105
mov ecx, dword [esp + 0x10]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408105
mov word [esp + ebx*4 + 0xac], cx
mov word [esp + ebx*4 + 0xae], ax
inc ebx
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.00408ae0
add esp, 0xc
test ebx, ebx
sete byte [esp + 0xb]
je 0x4081c0
xor eax, eax
cmp ebx, 1
je 0x40817f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xac]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
add eax, 2
cmp ecx, eax
jne 0x408140
test bl, 1
je 0x4081a0
movzx eax, word [esp + eax*4 + 0xac]
movzx ecx, al
inc dword [esp + ecx*4 + 0x52c]
shr eax, 8
inc dword [esp + eax*4 + 0x92c]
mov eax, dword [esp + 0x92c]
jmp 0x4081c9
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.00408ae0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x20], ecx
lea ebp, [esp + 0xac]
lea eax, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x52c]
xor edx, edx
mov dword [esp + 4], ebx
jmp 0x408220
mov edx, dword [esp + 0xc]
inc edx
add ecx, 8
mov esi, dword [esp + 0x24]
add esi, 0x400
mov eax, ebp
cmp edx, dword [esp + 0x20]
mov ebp, edi
je 0x4082c1
mov dword [esp + 0xc], edx
mov dword [esp], eax
mov edx, 3
xor eax, eax
nop
nop
mov dword [esp + edx*4 + 0xd20], eax
add eax, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xd24], eax
add eax, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0xd28], eax
add eax, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0xd2c], eax
add eax, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x408230
mov dword [esp + 0x24], esi
cmp byte [esp + 0xb], 0
mov edi, dword [esp]
jne 0x408200
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [ebp + edx*4]
shr eax, cl
mov esi, ebp
mov ebp, edi
mov edi, eax
not edi
or edi, 0xff
add edi, eax
mov eax, dword [esp + edi*4 + 0xd30]
lea ebx, [eax + 1]
mov dword [esp + edi*4 + 0xd30], ebx
mov ebx, dword [esp + 4]
mov edi, dword [esi + edx*4]
mov dword [ebp + eax*4], edi
mov edi, ebp
mov ebp, esi
inc edx
cmp ebx, edx
jne 0x408280
jmp 0x408200
test ebx, ebx
mov ebx, dword [esp + 0x15c4]
je 0x4086f4
mov esi, dword [esp + 4]
cmp esi, 1
jne 0x4082e4
mov word [ebp], 1
jmp 0x4085c0
movzx eax, word [ebp + 4]
add word [ebp], ax
lea edi, [esi - 1]
cmp edi, 2
jl 0x408405
mov ecx, 2
mov ebx, 2
sub ebx, esi
xor esi, esi
mov ebp, 1
mov dword [esp + 0xc], edi
jmp 0x40833e
mov edx, dword [esp]
movzx eax, word [edx + ecx*4]
inc ecx
add word [edx + ebp*4], ax
mov edi, dword [esp + 0xc]
lea eax, [ebx + ebp]
inc eax
inc ebp
cmp eax, 1
je 0x408414
mov edx, dword [esp]
movzx eax, word [edx + esi*4]
cmp ecx, dword [esp + 4]
jge 0x408354
movzx edi, word [edx + ecx*4]
cmp ax, di
jae 0x408380
mov word [edx + ebp*4], ax
mov word [edx + esi*4], bp
inc esi
cmp ecx, dword [esp + 4]
jge 0x40838b
cmp esi, ebp
jge 0x408320
mov edx, dword [esp]
movzx edi, word [edx + esi*4]
movzx eax, word [edx + ecx*4]
cmp di, ax
jae 0x408327
jmp 0x408392
inc ecx
mov word [edx + ebp*4], di
cmp ecx, dword [esp + 4]
jl 0x408363
mov edx, dword [esp]
movzx edi, word [edx + esi*4]
add word [edx + ebp*4], di
mov word [edx + esi*4], bp
inc esi
jmp 0x40832c
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
lea edx, [eax + ebp]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x4083cb
add eax, 2
cmp ecx, eax
je 0x4080d3
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4083e6
mov word [esp + ebx*4 + 0xac], si
mov word [esp + ebx*4 + 0xae], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x4083c0
mov word [esp + ebx*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xae], si
inc ebx
jmp 0x4083c0
lea ecx, [esi - 2]
mov word [ebp + esi*4 - 8], 0
jmp 0x4084b1
mov ebp, dword [esp + 4]
lea ecx, [ebp - 2]
mov eax, dword [esp]
mov word [eax + ebp*4 - 8], 0
cmp ebp, 3
jl 0x4084b1
lea esi, [ebp - 3]
and ebp, 3
xor ebp, 2
mov edx, esi
mov edi, dword [esp]
je 0x408451
mov edx, esi
movzx eax, word [edi + edx*4]
movzx eax, word [edi + eax*4]
inc eax
mov word [edi + edx*4], ax
dec edx
dec ebp
jne 0x408440
cmp esi, 3
jae 0x40845c
mov edi, dword [esp + 0xc]
jmp 0x4084b1
inc edx
mov esi, dword [esp]
mov edi, dword [esp + 0xc]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [esi + edx*4 - 4]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 4], ax
movzx eax, word [esi + edx*4 - 8]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 8], ax
movzx eax, word [esi + edx*4 - 0xc]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 0xc], ax
movzx eax, word [esi + edx*4 - 0x10]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 0x10], ax
add edx, 0xfffffffc
jne 0x408470
mov ebp, 1
xor edx, edx
jmp 0x4084ef
mov ebp, dword [esp + 0xc]
mov ebx, dword [esp + 0x15c4]
inc edx
mov eax, ebp
or eax, 2
mov esi, ebp
and ebp, 2
imul eax, ebp
and esi, 0x7ffffffd
xor ebp, 2
imul ebp, esi
add ebp, eax
test ebp, ebp
jle 0x4085b2
test ecx, ecx
js 0x408520
lea ebx, [ecx + 1]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [esp]
movzx eax, word [eax + ecx*4]
cmp edx, eax
jne 0x408530
inc esi
dec ecx
cmp ebx, esi
jne 0x408500
mov ecx, 0xffffffff
jmp 0x408532
xor ebx, ebx
jmp 0x408532
mov ebx, esi
mov esi, ebp
mov dword [esp + 0xc], ebx
sub esi, ebx
jle 0x4084c0
and esi, 3
je 0x408565
mov eax, dword [esp]
mov ebx, edi
lea eax, [eax + edi*4]
xor edi, edi
nop
nop
nop
nop
nop
mov word [eax], dx
inc edi
add eax, 0xfffffffc
cmp esi, edi
jne 0x408550
mov esi, ebp
sub esi, edi
sub ebx, edi
mov edi, ebx
jmp 0x408567
mov esi, ebp
mov ebx, dword [esp + 0xc]
mov eax, ebx
sub eax, ebp
mov ebp, ebx
cmp eax, 0xfffffffc
mov eax, dword [esp]
mov ebx, dword [esp + 0x15c4]
ja 0x4084cb
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [eax + edi*4], dx
mov word [eax + edi*4 - 4], dx
mov word [eax + edi*4 - 8], dx
mov word [eax + edi*4 - 0xc], dx
add edi, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebp
jg 0x408590
jmp 0x4084cb
cmp dword [esp + 4], 0
mov ebp, dword [esp]
jle 0x4086f4
mov eax, dword [esp + 4]
lea edx, [eax - 1]
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x40860b
mov edx, dword [esp + 4]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x4085e0
test eax, eax
je 0x40862d
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 + 0x28]
inc edx
cmp eax, edx
jne 0x408620
cmp dword [esp + 4], 2
jl 0x4086f4
lea eax, [ebx + 1]
cmp eax, 0x21
jge 0x4086a0
mov ecx, dword [esp + ebx*4 + 0x28]
mov edx, ebx
neg edx
and edx, 3
je 0x40865c
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + ebx*4 + 0x28], ecx
inc eax
dec edx
jne 0x408650
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x408698
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + ebx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + ebx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + ebx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x34]
mov dword [esp + ebx*4 + 0x28], ecx
add eax, 4
cmp eax, 0x21
jne 0x408670
test ebx, ebx
jle 0x40896d
mov edx, ebx
not edx
xor edi, edi
mov esi, ebx
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [esp + esi*4 + 0x28]
mov dword [esp], eax
mov ebx, esi
mov eax, dword [esp + 0x15c4]
xor ebx, eax
mov ecx, edx
and ecx, eax
add ecx, ecx
sub ecx, ebx
mov eax, dword [esp]
shl eax, cl
add edi, eax
lea ecx, [esi - 1]
inc edx
cmp esi, 1
mov esi, ecx
ja 0x4086b0
mov edx, 1
mov ecx, dword [esp + 0x15c4]
shl edx, cl
cmp edi, edx
mov ebx, ecx
jne 0x408993
mov esi, dword [esp + 0x1c]
shl esi, 5
mov edi, dword [esp + 0x14]
lea eax, [edi + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408ae0
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408ae0
add esp, 0xc
test ebx, ebx
jle 0x408810
add ebp, 0xfffffffe
mov eax, 1
add esi, dword [esp + 0x14]
mov dword [esp], ebp
jmp 0x408765
mov edi, dword [esp + 4]
mov dword [esp + 4], edi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x408810
mov ecx, dword [esp + eax*4 + 0x28]
test ecx, ecx
jle 0x408750
mov edx, ecx
and edx, 3
je 0x4087c0
mov edi, dword [esp + 4]
lea edi, [edi*4]
add edi, ebp
mov ebp, esi
xor esi, esi
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 0x408790
sub dword [esp + 4], esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c4]
mov esi, ebp
mov ebp, dword [esp]
jmp 0x4087c2
mov edx, ecx
cmp ecx, 4
mov edi, dword [esp + 4]
jb 0x408754
dec edx
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 0x4087d0
jmp 0x408754
mov ecx, dword [esp + 0x15c0]
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x530], 0
cmp ebx, 2
jl 0x40888d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x40883c
xor eax, eax
mov edx, 2
jmp 0x408874
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x534], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add edx, 2
cmp ebx, edx
jne 0x408850
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x40888d
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x52c], eax
test ecx, ecx
jle 0x408962
xor eax, eax
mov edx, dword [esp + 0x18]
lea edx, [edx + edx*8]
mov esi, edx
shl esi, 5
add esi, ebp
mov dword [esp + 4], esi
shl edx, 6
add edx, ebp
mov dword [esp], edx
jmp 0x4088db
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x408962
mov edx, dword [esp + 4]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x4088d2
mov edx, dword [esp + ebx*4 + 0x52c]
lea edi, [edx + 1]
mov dword [esp + ebx*4 + 0x52c], edi
xor edi, edi
cmp bl, 4
jb 0x40893f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
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, 2
and esi, 1
mov ecx, edx
shr ecx, 3
or esi, edi
and ecx, 1
shr edx, 4
lea edi, [ecx + esi*2]
add ebp, 0xfffffffc
jne 0x408910
and ebx, 3
je 0x4088c0
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, edx
and ecx, 1
shr edx, 1
lea edi, [ecx + edi*2]
dec ebx
jne 0x408950
jmp 0x4088c0
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
mov ecx, ebx
shl edx, cl
xor edi, edi
jmp 0x408993
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec edi
cmp edi, edx
je 0x4086f4
dec dword [esp + ebx*4 + 0x28]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40898a
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x4089a0
jmp 0x408980