Function at 0x405c60
Capabilities:
Compute adler32 checksum
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd0
or eax, 0xffffffff
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, edx
push esi
mov eax, dword [eax]
add eax, edx
mov dword [ebp - 0x18], ebx
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x14]
push edi
mov edi, ecx
mov dword [ebp - 0x10], edx
mov dword [ebp - 0x14], edi
mov eax, dword [eax]
lea ecx, [eax + edx]
mov dword [ebp - 0x40], ecx
mov ecx, dword [ebp + 0x18]
and ecx, 4
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebp + 0xc]
je 0x405cad
or esi, 0xffffffff
jmp 0x405cb4
sub eax, ecx
lea esi, [edx - 1]
add esi, eax
lea eax, [esi + 1]
mov dword [ebp - 0x34], esi
test esi, eax
jne 0x407081
cmp edx, ecx
jb 0x407081
mov eax, dword [edi + 0x20]
mov edx, dword [edi + 0x38]
mov ecx, dword [edi + 0x24]
mov esi, dword [edi + 4]
mov dword [ebp - 0x28], eax
mov eax, dword [edi + 0x28]
mov dword [ebp - 0x38], eax
mov eax, dword [edi + 0x3c]
mov dword [ebp - 0x48], eax
mov eax, dword [edi]
mov dword [ebp - 4], edx
mov dword [ebp - 8], ecx
cmp eax, 0x35
ja 0x406e94
movzx eax, byte [eax + 0x406524]
jmp dword [eax*4 + 0x4064a0]
xor eax, eax
mov dword [edi + 4], esi
xor ecx, ecx
bts ecx, esi
cmp esi, 0x20
cmovae eax, ecx
xor ecx, eax
cmp esi, 0x40
cmovae eax, ecx
sub ebx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x28]
dec ecx
mov dword [edi + 0x20], eax
and ecx, edx
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x10]
sub edx, dword [ebp + 0x10]
test byte [ebp + 0x18], 9
mov dword [edi + 0x24], eax
mov eax, dword [ebp - 0x38]
mov dword [edi + 0x28], eax
mov eax, dword [ebp - 0x48]
mov dword [edi + 0x3c], eax
mov eax, dword [ebp + 8]
mov dword [edi + 0x38], ecx
mov dword [ebp - 0x10], edx
mov dword [eax], ebx
mov eax, dword [ebp + 0x14]
mov ebx, dword [ebp - 0xc]
mov dword [eax], edx
je 0x407078
test ebx, ebx
js 0x407078
mov esi, dword [edi + 0x1c]
mov eax, 0x5e6ea9af
mul edx
movzx ecx, si
shr edx, 0xb
imul eax, edx, 0x15b0
mov edx, dword [ebp - 0x10]
shr esi, 0x10
mov dword [ebp - 0x3c], esi
sub edx, eax
cmp dword [ebp - 0x10], 0
mov dword [ebp - 0x34], edx
je 0x40705b
mov ebx, edx
xor edx, edx
mov dword [ebp + 0x14], edx
cmp ebx, 7
jbe 0x406faf
mov eax, dword [ebp + 0x10]
mov edi, 7
sub edi, eax
lea ecx, [ecx]
movzx eax, byte [eax]
add edx, 8
add ecx, eax
mov eax, dword [ebp + 0x10]
add esi, ecx
movzx eax, byte [eax + 1]
add ecx, eax
mov eax, dword [ebp + 0x10]
add esi, ecx
movzx eax, byte [eax + 2]
add ecx, eax
mov eax, dword [ebp + 0x10]
add esi, ecx
movzx eax, byte [eax + 3]
add ecx, eax
mov eax, dword [ebp + 0x10]
add esi, ecx
movzx eax, byte [eax + 4]
add ecx, eax
mov eax, dword [ebp + 0x10]
add esi, ecx
movzx eax, byte [eax + 5]
add ecx, eax
mov eax, dword [ebp + 0x10]
add esi, ecx
movzx eax, byte [eax + 6]
add ecx, eax
mov eax, dword [ebp + 0x10]
add esi, ecx
movzx eax, byte [eax + 7]
add ecx, eax
mov eax, dword [ebp + 0x10]
add eax, 8
add esi, ecx
mov dword [ebp + 0x10], eax
add eax, edi
cmp eax, ebx
mov eax, dword [ebp + 0x10]
jb 0x406f40
mov dword [ebp + 0x14], edx
mov dword [ebp - 0x3c], esi
xor edi, edi
mov dword [ebp + 8], edi
cmp edx, ebx
jae 0x40701d
mov eax, ebx
sub eax, edx
cmp eax, 2
jb 0x407004
mov eax, dword [ebp + 0x14]
mov edx, ebx
mov esi, dword [ebp + 0x10]
sub edx, eax
sub edx, 2
mov ebx, edi
shr edx, 1
inc edx
lea eax, [eax + edx*2]
mov dword [ebp + 0x14], eax
lea esp, [esp]
movzx eax, byte [esi]
add ecx, eax
movzx eax, byte [esi + 1]
add edi, ecx
add esi, 2
add ecx, eax
add ebx, ecx
dec edx
jne 0x406fe0
mov edx, dword [ebp + 0x14]
mov dword [ebp + 0x10], esi
mov esi, dword [ebp - 0x3c]
mov dword [ebp + 8], ebx
mov ebx, dword [ebp - 0x34]
cmp edx, ebx
jae 0x407016
mov edx, dword [ebp + 0x10]
movzx eax, byte [edx]
add ecx, eax
add esi, ecx
inc edx
mov dword [ebp + 0x10], edx
mov eax, dword [ebp + 8]
add eax, edi
add esi, eax
mov eax, 0x80078071
mul ecx
shr edx, 0xf
imul eax, edx, 0xffff000f
add ecx, eax
mov eax, 0x80078071
mul esi
shr edx, 0xf
imul eax, edx, 0xffff000f
add esi, eax
sub dword [ebp - 0x10], ebx
mov ebx, 0x15b0
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x34], ebx
jne 0x406f25
mov edi, dword [ebp - 0x14]
mov ebx, dword [ebp - 0xc]
shl esi, 0x10
add esi, ecx
mov dword [edi + 0x1c], esi
test ebx, ebx
jne 0x407078
test byte [ebp + 0x18], 1
je 0x407078
cmp esi, dword [edi + 0x10]
mov eax, 0xfffffffe
cmovne ebx, eax
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0x14]
pop edi
pop esi
pop ebx
mov dword [eax], 0
mov eax, dword [ebp + 8]
mov dword [eax], 0
mov eax, 0xfffffffd
mov esp, ebp
pop ebp
ret