Function at 0x407810
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15a4
call fcn.00408210
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.004083b0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
je 0x4078f4
test esi, esi
mov ecx, esi
jle 0x407de7
xor eax, eax
cmp ecx, 1
je 0x4078b8
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 0x4078a0
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x407de7
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 0x407de7
lea eax, [edi + edi*8]
mov dword [esp + 0x10], eax
mov edi, eax
shl edi, 6
test esi, esi
mov dword [esp + 0xc], edi
jle 0x4079e9
cmp esi, 1
jne 0x407c42
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40794e
mov ecx, dword [esp + 0x15b8]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40794e
mov word [esp + ebx*4 + 0xa4], cx
mov word [esp + ebx*4 + 0xa6], ax
inc ebx
lea eax, [esp + 0x524]
push 0x800
push 0
push eax
call fcn.004083b0
add esp, 0xc
test ebx, ebx
sete byte [esp + 3]
je 0x407a00
xor eax, eax
cmp ebx, 1
je 0x4079bf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
movzx edx, word [esp + eax*4 + 0xa4]
movzx esi, dl
inc dword [esp + esi*4 + 0x524]
shr edx, 8
inc dword [esp + edx*4 + 0x924]
movzx edx, word [esp + eax*4 + 0xa8]
movzx esi, dl
inc dword [esp + esi*4 + 0x524]
shr edx, 8
inc dword [esp + edx*4 + 0x924]
add eax, 2
cmp ecx, eax
jne 0x407980
test bl, 1
je 0x4079e0
movzx eax, word [esp + eax*4 + 0xa4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x524]
shr eax, 8
inc dword [esp + eax*4 + 0x924]
mov eax, dword [esp + 0x924]
jmp 0x407a09
lea eax, [esp + 0x524]
push 0x800
push 0
push eax
call fcn.004083b0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 3], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x14], ecx
lea ebp, [esp + 0xa4]
lea eax, [esp + 0x1124]
xor ecx, ecx
lea edi, [esp + 0x524]
xor edx, edx
mov dword [esp + 4], ebx
jmp 0x407a62
add ecx, 8
mov edx, dword [esp + 0x1c]
inc edx
mov edi, dword [esp + 0x18]
add edi, 0x400
mov eax, esi
cmp edx, dword [esp + 0x14]
mov ebp, dword [esp + 8]
je 0x407b0e
mov dword [esp + 0x1c], edx
mov esi, ebp
mov ebp, eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xd18], eax
add eax, dword [edi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xd1c], eax
add eax, dword [edi + edx*4 - 8]
mov dword [esp + edx*4 + 0xd20], eax
add eax, dword [edi + edx*4 - 4]
mov dword [esp + edx*4 + 0xd24], eax
add eax, dword [edi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x407a80
mov dword [esp + 0x18], edi
cmp byte [esp + 3], 0
mov dword [esp + 8], ebp
jne 0x407a40
xor edx, edx
nop
nop
nop
nop
nop
movzx eax, word [esi + edx*4]
shr eax, cl
movzx eax, al
mov ebp, dword [esp + eax*4 + 0xd24]
mov ebx, dword [esi + edx*4]
mov edi, esi
mov esi, dword [esp + 8]
mov dword [esi + ebp*4], ebx
mov esi, edi
mov ebx, ebp
and ebp, 1
xor ebx, 1
lea ebx, [ebx + ebp*2]
mov dword [esp + eax*4 + 0xd24], ebx
mov ebx, dword [esp + 4]
inc edx
cmp ebx, edx
jne 0x407ad0
jmp 0x407a40
push ebx
push ebp
call fcn.00407f80
add esp, 8
test ebx, ebx
mov ebx, dword [esp + 0x15c4]
jle 0x407cb5
mov edx, dword [esp + 4]
mov eax, edx
and eax, 3
xor ecx, ecx
cmp edx, 4
jb 0x407b7b
mov edx, dword [esp + 4]
and edx, 0x7ffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x20]
add ecx, 4
cmp edx, ecx
jne 0x407b50
test eax, eax
je 0x407b9d
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 + 0x20]
inc edx
cmp eax, edx
jne 0x407b90
cmp dword [esp + 4], 1
je 0x407cb5
cmp ebx, 0x20
jge 0x407c10
mov eax, dword [esp + ebx*4 + 0x20]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x407bcc
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x24]
inc ecx
mov dword [esp + ebx*4 + 0x20], eax
dec edx
jne 0x407bc0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x407c08
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 0x407be0
test ebx, ebx
jle 0x407ca5
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 + 0x1c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x407c20
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x407f3d
jmp 0x407cb5
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 0x407c6b
add eax, 2
cmp ecx, eax
je 0x407919
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x407c86
mov word [esp + ebx*4 + 0xa4], si
mov word [esp + ebx*4 + 0xa6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x407c60
mov word [esp + ebx*4 + 0xa4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xa6], si
inc ebx
jmp 0x407c60
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x407f3d
mov esi, dword [esp + 0x10]
shl esi, 5
mov edi, dword [esp + 0x15b8]
lea eax, [edi + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.004083b0
add esp, 0xc
mov eax, dword [esp + 0xc]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.004083b0
add esp, 0xc
test ebx, ebx
jle 0x407de0
add ebp, 0xfffffffe
mov eax, 1
add esi, dword [esp + 0x15b8]
mov dword [esp + 8], ebp
jmp 0x407d35
mov edi, dword [esp + 4]
mov dword [esp + 4], edi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x407de0
mov ecx, dword [esp + eax*4 + 0x20]
test ecx, ecx
jle 0x407d20
mov edx, ecx
and edx, 3
je 0x407d90
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 0x407d60
sub dword [esp + 4], esi
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c4]
mov esi, ebp
mov ebp, dword [esp + 8]
jmp 0x407d92
mov edx, ecx
cmp ecx, 4
mov edi, dword [esp + 4]
jb 0x407d24
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 0x407da0
jmp 0x407d24
mov ecx, dword [esp + 0x15c0]
mov dword [esp + 0x528], 0
cmp ebx, 2
jl 0x407e5d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x407e08
xor eax, eax
mov edx, 2
jmp 0x407e44
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 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x52c], eax
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x530], eax
add edx, 2
cmp ebx, edx
jne 0x407e20
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x407e5d
add eax, dword [esp + edx*4 + 0x1c]
add eax, eax
mov dword [esp + edx*4 + 0x524], eax
test ecx, ecx
jle 0x407f32
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 + 8], edi
jmp 0x407eac
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x407f32
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x407ea3
mov ecx, dword [esp + ebx*4 + 0x524]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x524], edi
xor edi, edi
cmp bl, 4
jb 0x407f0f
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 0x407ee0
and ebx, 3
je 0x407e90
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 0x407f20
jmp 0x407e90
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 0x407f68
mov esi, dword [esp + ecx*4 + 0x1c]
dec ecx
test esi, esi
je 0x407f50
dec esi
mov dword [esp + ecx*4 + 0x20], esi
add dword [esp + ecx*4 + 0x24], 2
dec eax
cmp eax, edx
jne 0x407f3d
jmp 0x407cb5