Function at 0x407770
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15a4
call fcn.004081a0
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp + 0x15c0]
mov edi, dword [esp + 0x15bc]
lea eax, [esp + 0x20]
push 0x84
push 0
push eax
call fcn.00408450
add esp, 0xc
cmp dword [esp + 0x15c8], 0
je 0x407854
test esi, esi
mov ecx, esi
jle 0x407d86
xor eax, eax
cmp ecx, 1
je 0x407818
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x15bc]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0x15b8]
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 + 0x20]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x20]
add eax, 2
cmp ecx, eax
jne 0x407800
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x407d86
mov ecx, dword [esp + 0x15bc]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0x15b8]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x20]
jmp 0x407d86
lea ebp, [edi + edi*8]
mov edi, ebp
shl edi, 6
test esi, esi
mov dword [esp + 0x10], edi
jle 0x407921
cmp esi, 1
jne 0x407946
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x4078ae
mov ecx, dword [esp + 0x15b8]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4078ae
mov edx, ebx
mov word [esp + ebx*4 + 0x4a4], cx
mov word [esp + ebx*4 + 0x4a6], ax
inc edx
mov ebx, edx
lea eax, [esp + 0x924]
push 0x800
push 0
push eax
call fcn.00408450
add esp, 0xc
mov eax, ebx
test ebx, ebx
sete byte [esp + 3]
je 0x4079b5
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0x4a4]
movzx edx, cl
mov esi, dword [esp + edx*4 + 0x924]
mov edi, esi
and edi, 1
xor esi, 1
lea esi, [esi + edi*2]
mov dword [esp + edx*4 + 0x924], esi
shr ecx, 8
inc dword [esp + ecx*4 + 0xd24]
inc eax
cmp ebx, eax
jne 0x4078e0
mov edx, ebx
mov eax, dword [esp + 0xd24]
jmp 0x4079be
lea eax, [esp + 0x924]
push 0x800
push 0
push eax
call fcn.00408450
add esp, 0xc
xor edx, edx
mov byte [esp + 3], 1
xor eax, eax
jmp 0x4079c5
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x15b8]
lea edx, [edi + eax]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40797b
add eax, 2
cmp ecx, eax
je 0x407875
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x407996
mov word [esp + ebx*4 + 0x4a4], si
mov word [esp + ebx*4 + 0x4a6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x407970
mov word [esp + ebx*4 + 0x4a4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4a6], si
inc ebx
jmp 0x407970
xor edx, edx
mov byte [esp + 3], 1
xor eax, eax
mov ebx, dword [esp + 0x15c4]
xor ecx, ecx
cmp eax, edx
setne cl
inc ecx
mov dword [esp + 0x18], ecx
mov dword [esp + 8], edx
and edx, 0xfffffffe
mov dword [esp + 0x1c], edx
lea eax, [esp + 0x4a4]
mov dword [esp + 4], eax
lea eax, [esp + 0x1124]
xor ecx, ecx
lea edi, [esp + 0x924]
xor edx, edx
mov dword [esp + 0x14], ebp
jmp 0x407a18
inc eax
add ecx, 8
add edi, 0x400
mov edx, eax
mov eax, esi
cmp edx, dword [esp + 0x18]
je 0x407b2e
mov dword [esp + 0xc], edx
mov esi, dword [esp + 4]
mov dword [esp + 4], eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0x98], eax
add eax, dword [edi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0x9c], eax
add eax, dword [edi + edx*4 - 8]
mov dword [esp + edx*4 + 0xa0], eax
add eax, dword [edi + edx*4 - 4]
mov dword [esp + edx*4 + 0xa4], eax
add eax, dword [edi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x407a30
cmp byte [esp + 3], 0
mov eax, dword [esp + 0xc]
jne 0x407a00
xor edx, edx
cmp dword [esp + 8], 1
mov ebp, esi
je 0x407ada
xor edx, edx
nop
nop
movzx eax, word [ebp + edx*4]
shr eax, cl
movzx eax, al
mov esi, ebp
mov ebp, dword [esp + eax*4 + 0xa4]
lea ebx, [ebp + 1]
mov dword [esp + eax*4 + 0xa4], ebx
mov eax, dword [esi + edx*4]
mov ebx, dword [esp + 4]
mov dword [ebx + ebp*4], eax
movzx eax, word [esi + edx*4 + 4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xa4]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xa4], ebp
mov ebp, esi
mov eax, dword [esi + edx*4 + 4]
mov esi, dword [esp + 4]
mov dword [esi + ebx*4], eax
mov esi, dword [esp + 0x1c]
add edx, 2
cmp esi, edx
jne 0x407a80
test byte [esp + 8], 1
mov ebx, dword [esp + 0x15c4]
mov esi, ebp
mov ebp, dword [esp + 0x14]
mov eax, dword [esp + 0xc]
je 0x407a00
movzx eax, word [esi + edx*4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xa4]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xa4], ebp
mov ebp, dword [esp + 0x14]
mov eax, dword [esi + edx*4]
mov edx, dword [esp + 4]
mov dword [edx + ebx*4], eax
mov eax, dword [esp + 0xc]
mov ebx, dword [esp + 0x15c4]
jmp 0x407a00
mov esi, dword [esp + 8]
push esi
push dword [esp + 8]
call fcn.00407f10
add esp, 8
test esi, esi
mov edi, dword [esp + 0x10]
jle 0x407c72
mov edx, dword [esp + 8]
mov eax, edx
and eax, 3
xor ecx, ecx
cmp edx, 4
mov edi, dword [esp + 4]
jb 0x407b9a
mov edx, dword [esp + 8]
and edx, 0x7ffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x20]
add ecx, 4
cmp edx, ecx
jne 0x407b70
test eax, eax
je 0x407bbd
mov edx, dword [esp + 4]
lea ecx, [edx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x20]
inc edx
cmp eax, edx
jne 0x407bb0
cmp dword [esp + 8], 1
mov edi, dword [esp + 0x10]
je 0x407c72
cmp ebx, 0x20
jge 0x407c2c
mov eax, dword [esp + ebx*4 + 0x20]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x407bec
add eax, dword [esp + ecx*4 + 0x24]
inc ecx
mov dword [esp + ebx*4 + 0x20], eax
dec edx
jne 0x407be0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x407c28
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x24]
mov dword [esp + ebx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x28]
mov dword [esp + ebx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + ebx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x30]
add ecx, 4
mov dword [esp + ebx*4 + 0x20], eax
cmp ecx, 0x20
jne 0x407c00
test ebx, ebx
jle 0x407c62
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x1c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x407c40
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x407ecd
jmp 0x407c72
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x407ecd
shl ebp, 5
mov esi, dword [esp + 0x15b8]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408450
add esp, 0xc
lea eax, [esi + edi]
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408450
add esp, 0xc
test ebx, ebx
mov edi, dword [esp + 4]
jle 0x407d7f
add edi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0x15b8]
mov dword [esp + 4], edi
jmp 0x407ce5
mov esi, dword [esp + 8]
mov dword [esp + 8], esi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x407d7f
mov ecx, dword [esp + eax*4 + 0x20]
test ecx, ecx
jle 0x407cd0
mov edx, ecx
and edx, 3
je 0x407d30
mov esi, dword [esp + 8]
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 0x407d00
sub dword [esp + 8], esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c4]
mov edi, dword [esp + 4]
jmp 0x407d32
mov edx, ecx
cmp ecx, 4
mov esi, dword [esp + 8]
jb 0x407cd4
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 0x407d40
jmp 0x407cd4
mov ecx, dword [esp + 0x15c0]
mov dword [esp + 0x928], 0
cmp ebx, 2
jl 0x407ded
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x407da7
xor eax, eax
mov edx, 2
jmp 0x407dd4
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x92c], eax
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x930], eax
add edx, 2
cmp ebx, edx
jne 0x407db0
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x407ded
add eax, dword [esp + edx*4 + 0x1c]
add eax, eax
mov dword [esp + edx*4 + 0x924], eax
test ecx, ecx
jle 0x407ec2
xor eax, eax
mov edx, dword [esp + 0x15bc]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0x15b8]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp + 4], edi
jmp 0x407e3c
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x407ec2
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x407e33
mov ecx, dword [esp + ebx*4 + 0x924]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x924], edi
xor edi, edi
cmp bl, 4
jb 0x407e9f
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 0x407e70
and ebx, 3
je 0x407e20
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 0x407eb0
jmp 0x407e20
add esp, 0x15a4
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x20]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x407ef8
mov esi, dword [esp + ecx*4 + 0x1c]
dec ecx
test esi, esi
je 0x407ee0
dec esi
mov dword [esp + ecx*4 + 0x20], esi
add dword [esp + ecx*4 + 0x24], 2
dec eax
cmp eax, edx
jne 0x407ecd
jmp 0x407c72