Function at 0x406f60
Capabilities:
Compute adler32 checksum
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x10
mov ebp, dword [esp + 0x28]
test ebp, ebp
je 0x407116
mov ebx, dword [esp + 0x2c]
mov esi, dword [esp + 0x24]
movzx edi, si
shr esi, 0x10
test ebx, ebx
je 0x40710f
mov ecx, 0x5e6ea9af
mov eax, ebx
mul ecx
shr edx, 0xb
imul eax, edx, 0x15b0
mov ecx, ebx
sub ecx, eax
jmp 0x406ff6
mov ecx, dword [esp + 4]
mov eax, ecx
sub eax, dword [esp]
add ebp, eax
mov eax, edi
mov edx, 0x80078071
mul edx
mov ebx, edx
shr ebx, 0xf
mov eax, esi
mov edx, 0x80078071
mul edx
imul eax, ebx, 0xfff1
sub edi, eax
shr edx, 0xf
imul eax, edx, 0xfff1
sub esi, eax
mov ebx, dword [esp + 0xc]
sub ebx, ecx
mov ecx, 0x15b0
je 0x40710f
xor edx, edx
cmp ecx, 8
mov dword [esp + 4], ecx
jb 0x40707b
and ecx, 0x1ff8
mov dword [esp], ecx
xor eax, eax
nop
nop
nop
nop
mov edx, eax
movzx eax, byte [ebp + eax]
add eax, edi
add esi, eax
movzx ecx, byte [ebp + edx + 1]
add ecx, eax
add esi, ecx
movzx edi, byte [ebp + edx + 2]
add edi, ecx
mov eax, esi
and eax, edi
xor esi, edi
movzx ecx, byte [ebp + edx + 3]
add ecx, edi
movzx edi, byte [ebp + edx + 4]
add edi, ecx
add ecx, esi
lea eax, [ecx + eax*2]
movzx ecx, byte [ebp + edx + 5]
add ecx, edi
add eax, edi
movzx esi, byte [ebp + edx + 6]
add esi, ecx
add eax, ecx
add eax, esi
movzx edi, byte [ebp + edx + 7]
add edi, esi
mov ecx, eax
and ecx, edi
xor eax, edi
lea esi, [eax + ecx*2]
mov ecx, dword [esp + 4]
lea eax, [edx + 8]
add edx, 0xf
cmp edx, ecx
jb 0x407010
add ebp, eax
mov edx, dword [esp]
mov eax, edx
sub eax, ecx
mov dword [esp + 0xc], ebx
jae 0x406fbb
mov dword [esp + 8], eax
mov eax, ecx
and eax, 3
mov dword [esp], edx
je 0x4070bf
neg eax
xor ebx, ebx
mov edx, ebp
nop
nop
nop
movzx ecx, byte [edx]
inc edx
add edi, ecx
add esi, edi
dec ebx
cmp eax, ebx
jne 0x4070a0
mov eax, dword [esp]
sub eax, ebx
cmp dword [esp + 8], 0xfffffffc
ja 0x406fb0
jmp 0x4070ce
mov eax, edx
mov edx, ebp
cmp dword [esp + 8], 0xfffffffc
ja 0x406fb0
mov ebx, dword [esp + 4]
sub ebx, eax
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, byte [edx + eax]
add ecx, edi
add esi, ecx
movzx edi, byte [edx + eax + 1]
add edi, ecx
add esi, edi
movzx ecx, byte [edx + eax + 2]
add ecx, edi
add esi, ecx
movzx edi, byte [edx + eax + 3]
add edi, ecx
add esi, edi
add eax, 4
cmp ebx, eax
jne 0x4070e0
jmp 0x406fb0
shl esi, 0x10
or esi, edi
jmp 0x40711b
mov esi, 1
mov eax, esi
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret

Function at 0x407130
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov ecx, dword [esp + 0x18]
test ecx, ecx
je 0x407193
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
test edx, edx
je 0x407195
not eax
xor esi, esi
nop
nop
nop
nop
movzx ebp, byte [ecx + esi]
mov edi, eax
shr edi, 4
xor eax, ebp
and eax, 0xf
xor edi, dword [eax*4 + 0x447c50]
mov ebx, edi
shr ebx, 4
shr ebp, 4
mov eax, edi
and eax, 0xf
and edi, ebp
add eax, ebp
add edi, edi
sub eax, edi
mov edi, dword [eax*4 + 0x447c50]
lea eax, [ebx + edi]
and ebx, edi
add ebx, ebx
sub eax, ebx
inc esi
cmp edx, esi
jne 0x407150
not eax
jmp 0x407195
xor eax, eax
pop esi
pop edi
pop ebx
pop ebp
ret