Function at 0x407440
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15a8
call fcn.00407e80
mov ebx, dword [esp + 0x15c8]
mov esi, dword [esp + 0x15c4]
mov edi, dword [esp + 0x15c0]
lea eax, [esp + 0x24]
push 0x84
push 0
push eax
call fcn.00408140
add esp, 0xc
cmp dword [esp + 0x15cc], 0
je 0x407524
test esi, esi
mov ecx, esi
jle 0x407a66
xor eax, eax
cmp ecx, 1
je 0x4074e8
mov ecx, dword [esp + 0x15c4]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x15c0]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0x15bc]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x24]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x24]
add eax, 2
cmp ecx, eax
jne 0x4074d0
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x407a66
mov ecx, dword [esp + 0x15c0]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0x15bc]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c4]
inc dword [esp + eax*4 + 0x24]
jmp 0x407a66
lea ebp, [edi + edi*8]
mov eax, ebp
shl eax, 6
mov dword [esp + 0x10], eax
test esi, esi
jle 0x4075e5
cmp esi, 1
jne 0x4078d5
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x407582
mov ecx, dword [esp + 0x15bc]
mov edx, dword [esp + 0x10]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x407582
mov edx, edi
mov word [esp + edi*4 + 0x4a8], cx
mov word [esp + edi*4 + 0x4aa], ax
inc edx
mov edi, edx
lea eax, [esp + 0x928]
push 0x800
push 0
push eax
call fcn.00408140
add esp, 0xc
mov eax, edi
test edi, edi
sete byte [esp + 3]
je 0x4075fc
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0x4a8]
mov edx, ecx
not edx
or edx, 0xff
add edx, ecx
inc dword [esp + edx*4 + 0x92c]
shr ecx, 8
inc dword [esp + ecx*4 + 0xd28]
inc eax
cmp edi, eax
jne 0x4075b0
mov edx, edi
mov eax, dword [esp + 0xd28]
jmp 0x407605
lea eax, [esp + 0x928]
push 0x800
push 0
push eax
call fcn.00408140
add esp, 0xc
xor edx, edx
mov byte [esp + 3], 1
xor eax, eax
xor ecx, ecx
cmp eax, edx
setne cl
inc ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 4], edx
and edx, 0xfffffffe
mov dword [esp + 0x20], edx
lea eax, [esp + 0x4a8]
mov dword [esp + 8], eax
lea eax, [esp + 0x1128]
xor ecx, ecx
lea edi, [esp + 0x928]
xor edx, edx
mov dword [esp + 0x18], ebp
jmp 0x407658
add ecx, 8
inc eax
add edi, 0x400
mov edx, eax
mov eax, esi
cmp edx, dword [esp + 0x1c]
je 0x4077a8
mov dword [esp + 0x14], edx
mov esi, dword [esp + 8]
mov dword [esp + 8], eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0x9c], eax
add eax, dword [edi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xa0], eax
add eax, dword [edi + edx*4 - 8]
mov dword [esp + edx*4 + 0xa4], eax
add eax, dword [edi + edx*4 - 4]
mov dword [esp + edx*4 + 0xa8], eax
add eax, dword [edi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x407670
cmp byte [esp + 3], 0
mov eax, dword [esp + 0x14]
jne 0x407640
xor edx, edx
cmp dword [esp + 4], 1
je 0x40774a
xor edx, edx
mov dword [esp + 0xc], esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [esi + edx*4]
shr eax, cl
mov ebp, eax
xor ebp, 0x3fffff00
or eax, 0xff
and eax, ebp
mov ebp, dword [esp + eax*4 + 0xa8]
mov esi, dword [esp + 0xc]
mov ebx, dword [esi + edx*4]
mov esi, dword [esp + 8]
mov dword [esi + ebp*4], ebx
lea ebx, [ebp + 1]
mov esi, dword [esp + 0xc]
movzx ebp, word [esi + edx*4 + 4]
shr ebp, cl
mov dword [esp + eax*4 + 0xa8], ebx
mov eax, ebp
xor eax, 0x3fffff00
or ebp, 0xff
and ebp, eax
mov eax, dword [esp + ebp*4 + 0xa8]
lea ebx, [eax + 1]
mov dword [esp + ebp*4 + 0xa8], ebx
mov esi, dword [esp + 0xc]
mov ebx, dword [esi + edx*4 + 4]
mov ebp, dword [esp + 8]
mov dword [ebp + eax*4], ebx
mov ebx, dword [esp + 0x20]
add edx, 2
cmp ebx, edx
jne 0x4076d0
test byte [esp + 4], 1
mov ebx, dword [esp + 0x15c8]
mov ebp, dword [esp + 0x18]
mov eax, dword [esp + 0x14]
je 0x407640
movzx eax, word [esi + edx*4]
shr eax, cl
mov ebx, eax
xor ebx, 0x3fffff00
or eax, 0xff
and eax, ebx
mov ebx, dword [esp + eax*4 + 0xa8]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xa8], ebp
mov ebp, dword [esp + 0x18]
mov eax, dword [esi + edx*4]
mov edx, dword [esp + 8]
mov dword [edx + ebx*4], eax
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x15c8]
jmp 0x407640
mov esi, dword [esp + 4]
push esi
mov edi, dword [esp + 0xc]
push edi
call fcn.00407bf0
add esp, 8
test esi, esi
jle 0x407955
mov edx, dword [esp + 4]
mov eax, edx
and eax, 3
xor ecx, ecx
cmp edx, 4
jb 0x40780a
mov edx, dword [esp + 4]
and edx, 0x7ffffffc
xor ecx, ecx
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x24]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x24]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x24]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x24]
add ecx, 4
cmp edx, ecx
jne 0x4077e0
test eax, eax
je 0x40782d
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 + 0x24]
inc edx
cmp eax, edx
jne 0x407820
cmp dword [esp + 4], 1
je 0x407955
cmp ebx, 0x20
jge 0x4078a0
mov eax, dword [esp + ebx*4 + 0x24]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x40785c
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x28]
inc ecx
mov dword [esp + ebx*4 + 0x24], eax
dec edx
jne 0x407850
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x407898
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x28]
mov dword [esp + ebx*4 + 0x24], eax
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + ebx*4 + 0x24], eax
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x24], eax
add eax, dword [esp + ecx*4 + 0x34]
add ecx, 4
mov dword [esp + ebx*4 + 0x24], eax
cmp ecx, 0x20
jne 0x407870
test ebx, ebx
jle 0x407945
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x20]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x4078b0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x407bad
jmp 0x407955
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x15bc]
mov edx, dword [esp + 0x10]
add edx, eax
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x40790b
add eax, 2
cmp ecx, eax
je 0x407545
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x407926
mov word [esp + edi*4 + 0x4a8], si
mov word [esp + edi*4 + 0x4aa], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x407900
mov word [esp + edi*4 + 0x4a8], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4aa], si
inc edi
jmp 0x407900
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x407bad
shl ebp, 5
mov esi, dword [esp + 0x15bc]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408140
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408140
add esp, 0xc
test ebx, ebx
jle 0x407a5f
add edi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0x15bc]
mov dword [esp + 8], edi
jmp 0x4079c5
mov esi, dword [esp + 4]
mov dword [esp + 4], esi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x407a5f
mov ecx, dword [esp + eax*4 + 0x24]
test ecx, ecx
jle 0x4079b0
mov edx, ecx
and edx, 3
je 0x407a10
mov esi, dword [esp + 4]
lea edi, [edi + esi*4]
xor esi, esi
nop
nop
nop
movzx ebx, word [edi]
mov byte [ebx + ebp + 0x8f12], al
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x4079e0
sub dword [esp + 4], esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c8]
mov edi, dword [esp + 8]
jmp 0x407a12
mov edx, ecx
cmp ecx, 4
mov esi, dword [esp + 4]
jb 0x4079b4
dec edx
nop
nop
nop
nop
movzx ecx, word [edi + esi*4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 8]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 0xc]
add esi, 0xfffffffc
mov byte [ecx + ebp + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x407a20
jmp 0x4079b4
mov ecx, dword [esp + 0x15c4]
mov dword [esp + 0x92c], 0
cmp ebx, 2
jl 0x407acd
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x407a87
xor eax, eax
mov edx, 2
jmp 0x407ab4
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x930], eax
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
add edx, 2
cmp ebx, edx
jne 0x407a90
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c4]
je 0x407acd
add eax, dword [esp + edx*4 + 0x20]
add eax, eax
mov dword [esp + edx*4 + 0x928], eax
test ecx, ecx
jle 0x407ba2
xor eax, eax
mov edx, dword [esp + 0x15c0]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0x15bc]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp + 0xc], edi
jmp 0x407b1c
mov ecx, dword [esp + 0xc]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c4]
inc eax
cmp eax, ecx
je 0x407ba2
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x407b13
mov ecx, dword [esp + ebx*4 + 0x928]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x928], edi
xor edi, edi
cmp bl, 4
jb 0x407b7f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, ecx
and edi, 2
or edi, esi
mov esi, ecx
shr esi, 2
and esi, 1
or esi, edi
mov edi, ecx
shr edi, 3
and edi, 1
lea edi, [edi + esi*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x407b50
and ebx, 3
je 0x407b00
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
lea edi, [esi + edi*2]
shr ecx, 1
dec ebx
jne 0x407b90
jmp 0x407b00
add esp, 0x15a8
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x24]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x407bd8
mov esi, dword [esp + ecx*4 + 0x20]
dec ecx
test esi, esi
je 0x407bc0
dec esi
mov dword [esp + ecx*4 + 0x24], esi
add dword [esp + ecx*4 + 0x28], 2
dec eax
cmp eax, edx
jne 0x407bad
jmp 0x407955