Function at 0x407aa0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b8
call fcn.00408490
mov edi, edx
mov dword [esp + 0xc], ecx
mov ebx, dword [esp + 0x15d0]
mov esi, dword [esp + 0x15cc]
lea eax, [esp + 0x34]
push 0x84
push 0
push eax
call fcn.00408540
add esp, 0xc
cmp dword [esp + 0x15d4], 0
mov dword [esp + 0x1c], edi
je 0x407b67
test esi, esi
jle 0x4082f2
xor eax, eax
cmp esi, 1
je 0x407b38
mov ecx, dword [esp + 0x15cc]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x1c]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0xc]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x34]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x34]
add eax, 2
cmp ecx, eax
jne 0x407b20
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x4082f2
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x34]
jmp 0x4082f2
lea eax, [edi + edi*8]
mov dword [esp + 0x10], eax
shl eax, 6
mov dword [esp + 0x18], eax
test esi, esi
jle 0x407c6b
cmp esi, 1
jne 0x407ede
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x407bc0
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x18]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x407bc0
mov word [esp + edi*4 + 0x4b8], cx
mov word [esp + edi*4 + 0x4ba], ax
inc edi
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.00408540
add esp, 0xc
test edi, edi
sete byte [esp + 7]
je 0x407c82
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x407c3f
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b8]
movzx esi, dl
inc dword [esp + esi*4 + 0x938]
shr edx, 8
inc dword [esp + edx*4 + 0xd38]
movzx edx, word [esp + eax*4 + 0x4bc]
movzx esi, dl
inc dword [esp + esi*4 + 0x938]
shr edx, 8
inc dword [esp + edx*4 + 0xd38]
add eax, 2
cmp ecx, eax
jne 0x407c00
mov ecx, edi
test cl, 1
je 0x407c62
movzx eax, word [esp + eax*4 + 0x4b8]
movzx ecx, al
inc dword [esp + ecx*4 + 0x938]
shr eax, 8
inc dword [esp + eax*4 + 0xd38]
mov eax, dword [esp + 0xd38]
jmp 0x407c8b
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.00408540
add esp, 0xc
xor edi, edi
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, edi
setne cl
inc ecx
mov dword [esp + 0x30], ecx
lea eax, [edi - 1]
mov dword [esp + 0x20], eax
mov dword [esp + 8], edi
mov edx, edi
and edx, 0xfffffffe
lea ebp, [esp + 0x4b8]
lea eax, [esp + 0x1138]
xor ecx, ecx
lea esi, [esp + 0x938]
xor edi, edi
mov dword [esp + 0x14], edx
jmp 0x407ce7
add ecx, 8
inc edi
add esi, 0x400
mov eax, dword [esp]
cmp edi, dword [esp + 0x30]
je 0x407e08
mov dword [esp + 0x24], edi
mov dword [esp], ebp
mov ebp, eax
mov eax, 3
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + eax*4 + 0xac], edx
add edx, dword [esi + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xb0], edx
add edx, dword [esi + eax*4 - 8]
mov dword [esp + eax*4 + 0xb4], edx
add edx, dword [esi + eax*4 - 4]
mov dword [esp + eax*4 + 0xb8], edx
add edx, dword [esi + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x407d00
cmp byte [esp + 7], 0
mov edi, dword [esp + 0x24]
jne 0x407cd0
cmp dword [esp + 0x20], 0
je 0x407dad
xor eax, eax
mov edi, dword [esp]
nop
nop
nop
nop
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov edi, ebp
mov ebp, dword [esp + edx*4 + 0xb8]
lea ebx, [ebp + 1]
mov dword [esp + edx*4 + 0xb8], ebx
mov edx, dword [esp]
mov edx, dword [edx + eax*4]
mov dword [edi + ebp*4], edx
mov edx, dword [esp]
movzx edx, word [edx + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb8]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb8], ebp
mov ebp, edi
mov edi, dword [esp]
mov edx, dword [edi + eax*4 + 4]
mov dword [ebp + ebx*4], edx
mov edx, dword [esp + 0x14]
add eax, 2
cmp edx, eax
jne 0x407d50
jmp 0x407daf
xor eax, eax
test byte [esp + 8], 1
mov ebx, dword [esp + 0x15d0]
mov edi, dword [esp + 0x24]
je 0x407cd0
mov edx, dword [esp]
movzx edx, word [edx + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb8]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebp
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb8], ebp
mov ebp, dword [esp + 0x2c]
mov ebx, dword [esp]
mov eax, dword [ebx + eax*4]
mov ebx, dword [esp + 0x28]
mov dword [ebp + ebx*4], eax
mov ebx, dword [esp + 0x15d0]
jmp 0x407cd0
cmp dword [esp + 8], 0
mov edi, dword [esp + 0x10]
je 0x408222
mov ecx, dword [esp + 8]
cmp ecx, 1
jne 0x407e2b
mov word [ebp], 1
jmp 0x408105
movzx eax, word [ebp + 4]
add word [ebp], ax
mov eax, ecx
not eax
cmp ecx, 3
mov ebx, ecx
jl 0x407f45
mov dword [esp], eax
mov ecx, 2
mov edx, 2
sub edx, ebx
xor esi, esi
mov edi, 1
jmp 0x407e7d
movzx ebx, word [ebp + ecx*4]
inc ecx
add word [ebp + edi*4], bx
lea eax, [edx + edi]
inc eax
inc edi
cmp eax, 1
mov ebx, dword [esp + 8]
je 0x407f5b
movzx eax, word [ebp + esi*4]
cmp ecx, ebx
jge 0x407e90
movzx ebx, word [ebp + ecx*4]
cmp ax, bx
jae 0x407ec0
mov word [ebp + edi*4], ax
mov word [ebp + esi*4], di
inc esi
cmp ecx, dword [esp + 8]
jge 0x407ecc
cmp esi, edi
jge 0x407e60
movzx eax, word [ebp + esi*4]
movzx ebx, word [ebp + ecx*4]
cmp ax, bx
jae 0x407e65
jmp 0x407ed1
inc ecx
mov word [ebp + edi*4], bx
cmp ecx, dword [esp + 8]
jl 0x407ea1
movzx eax, word [ebp + esi*4]
add word [ebp + edi*4], ax
mov word [ebp + esi*4], di
inc esi
jmp 0x407e6b
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0xc]
mov edx, dword [esp + 0x18]
add edx, eax
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x407f0b
add eax, 2
cmp ecx, eax
je 0x407b8a
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x407f26
mov word [esp + edi*4 + 0x4b8], si
mov word [esp + edi*4 + 0x4ba], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x407f00
mov word [esp + edi*4 + 0x4b8], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4ba], si
inc edi
jmp 0x407f00
and eax, 2
mov ecx, ebx
and ecx, 0xfffffffd
sub ecx, eax
mov word [ebp + ecx*4], 0
jmp 0x408005
mov eax, dword [esp]
and eax, 2
mov ecx, ebx
and ecx, 0x7ffffffd
sub ecx, eax
mov word [ebp + ecx*4], 0
lea edx, [ebx - 3]
mov esi, ebx
and esi, 3
xor esi, 2
mov eax, edx
je 0x407fa4
mov eax, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp + eax*4]
movzx edi, word [ebp + edi*4]
inc edi
mov word [ebp + eax*4], di
dec eax
dec esi
jne 0x407f90
cmp edx, 3
jae 0x407faf
mov edi, dword [esp + 0x10]
jmp 0x408005
inc eax
mov edi, dword [esp + 0x10]
nop
nop
nop
nop
nop
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 0x407fc0
mov ebx, 1
xor eax, eax
mov edx, dword [esp + 0x20]
jmp 0x40802c
lea ebx, [esi + esi]
inc eax
test esi, esi
je 0x4080f3
test ecx, ecx
mov dword [esp], ebx
js 0x408060
lea esi, [ecx + 1]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, esi
movzx esi, word [ebp + ecx*4]
cmp eax, esi
jne 0x408070
inc ebx
dec ecx
mov esi, edi
cmp edi, ebx
jne 0x408040
mov ecx, 0xffffffff
jmp 0x408072
xor esi, esi
sub ebx, esi
jle 0x408020
jmp 0x40807d
mov esi, ebx
mov edi, dword [esp + 0x10]
mov ebx, dword [esp]
sub ebx, esi
jle 0x408020
and ebx, 3
je 0x4080b8
mov dword [esp + 0x14], esi
lea esi, [edx*4]
add esi, ebp
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi], ax
inc edi
add esi, 0xfffffffc
cmp ebx, edi
jne 0x4080a0
mov ebx, dword [esp]
sub ebx, edi
sub edx, edi
mov esi, dword [esp + 0x14]
jmp 0x4080bb
mov ebx, dword [esp]
mov edi, esi
sub esi, dword [esp]
cmp esi, 0xfffffffc
mov esi, edi
mov edi, dword [esp + 0x10]
ja 0x408020
nop
mov word [ebp + edx*4], ax
mov word [ebp + edx*4 - 4], ax
mov word [ebp + edx*4 - 8], ax
mov word [ebp + edx*4 - 0xc], ax
add edx, 0xfffffffc
add ebx, 0xfffffffc
cmp ebx, esi
jg 0x4080d0
jmp 0x408020
cmp dword [esp + 8], 0
mov ebx, dword [esp + 0x15d0]
jle 0x408222
mov eax, dword [esp + 8]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x20], 3
jb 0x40814b
mov edx, dword [esp + 8]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x34]
add ecx, 4
cmp edx, ecx
jne 0x408120
test eax, eax
je 0x40816d
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 + 0x34]
inc edx
cmp eax, edx
jne 0x408160
cmp dword [esp + 8], 2
jl 0x408222
cmp ebx, 0x20
jge 0x4081de
mov ecx, dword [esp + ebx*4 + 0x34]
test bl, 1
jne 0x40818a
mov eax, ebx
jmp 0x40819e
lea eax, [ebx + 1]
mov edx, dword [esp + ebx*4 + 0x38]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x34], ecx
cmp ebx, 0x1f
je 0x4081da
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edx, dword [esp + eax*4 + 0x38]
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x34], ecx
mov edx, dword [esp + eax*4 + 0x3c]
add eax, 2
mov esi, edx
and esi, ecx
xor edx, ecx
lea ecx, [edx + esi*2]
mov dword [esp + ebx*4 + 0x34], ecx
cmp eax, 0x20
jne 0x4081b0
test ebx, ebx
jle 0x408212
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x30]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x4081f0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x4083f5
jmp 0x408222
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x4083f5
shl edi, 5
mov esi, dword [esp + 0xc]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408540
add esp, 0xc
mov eax, dword [esp + 0x18]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408540
add esp, 0xc
test ebx, ebx
jle 0x4082f2
mov eax, 1
add edi, dword [esp + 0xc]
jmp 0x408281
mov esi, dword [esp + 8]
mov dword [esp + 8], esi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x4082f2
mov edx, dword [esp + eax*4 + 0x34]
test edx, edx
jle 0x408270
test dl, 1
jne 0x4082a0
mov ecx, edx
jmp 0x4082be
mov esi, dword [esp + 8]
mov ecx, esi
not ecx
lea esi, [ecx + esi*2]
mov dword [esp + 8], esi
movzx ecx, word [ebp + esi*4 + 2]
mov byte [ecx + edi + 0x8f12], al
lea ecx, [edx - 1]
cmp edx, 1
mov esi, dword [esp + 8]
je 0x408274
dec ecx
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebp + esi*4 - 2]
mov byte [edx + edi + 0x8f12], al
movzx edx, word [ebp + esi*4 - 6]
mov byte [edx + edi + 0x8f12], al
add esi, 0xfffffffe
add ecx, 0xfffffffe
jb 0x4082d0
jmp 0x408274
mov dword [esp + 0x93c], 0
cmp ebx, 2
jl 0x40833a
xor eax, eax
mov ecx, 2
nop
nop
nop
nop
nop
nop
nop
lea edx, [ecx + ecx]
mov esi, edx
and esi, 0x3ffffffc
mov edi, ecx
xor edi, 1
sub esi, edi
add eax, dword [esp + esi*4 + 0x34]
add eax, eax
mov dword [esp + ecx*4 + 0x938], eax
and edx, 2
add edx, edi
mov ecx, edx
cmp edx, ebx
jle 0x408310
mov ecx, dword [esp + 0x15cc]
test ecx, ecx
jle 0x4083ea
xor eax, eax
mov edx, dword [esp + 0x1c]
lea esi, [edx + edx*8]
mov edi, esi
shl edi, 5
mov edx, dword [esp + 0xc]
add edi, edx
mov dword [esp], edi
shl esi, 6
add esi, edx
mov dword [esp + 0x14], esi
jmp 0x408388
mov ecx, dword [esp + 0x14]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15cc]
inc eax
cmp eax, ecx
je 0x4083ea
mov edx, dword [esp]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x408383
mov edx, dword [esp + ebx*4 + 0x938]
lea ecx, [edx + 1]
mov dword [esp + ebx*4 + 0x938], ecx
xor edi, edi
cmp ebx, 1
je 0x4083dd
mov ebp, ebx
and ebp, 0xfffffffe
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, edx
shr edi, 1
mov esi, edx
and esi, 1
add esi, esi
lea ecx, [esi + ecx*4]
and edi, 1
or edi, ecx
shr edx, 2
mov ecx, edi
add ebp, 0xfffffffe
jne 0x4083c0
test bl, 1
je 0x408370
and edx, 1
lea edi, [edx + edi*2]
jmp 0x408370
add esp, 0x15b8
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x34]
mov ecx, ebx
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408418
mov esi, dword [esp + ecx*4 + 0x30]
dec ecx
test esi, esi
je 0x408400
dec esi
mov dword [esp + ecx*4 + 0x34], esi
add dword [esp + ecx*4 + 0x38], 2
dec eax
cmp eax, edx
jne 0x4083f5
jmp 0x408222