Function at 0x405747
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
mov ebx, dword [esi + 0x2c]
push edi
mov edi, dword [esi + 0x3c]
sub edi, dword [esi + 0x74]
mov eax, dword [esi + 0x6c]
mov ecx, dword [esi + 0x2c]
sub edi, eax
lea ecx, [ebx + ecx - 0x106]
mov dword [ebp - 8], edi
cmp eax, ecx
jb 0x4057d6
mov eax, dword [esi + 0x38]
push ebx
lea ecx, [eax + ebx]
push ecx
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [esi + 0x4c]
mov ecx, dword [esi + 0x44]
sub dword [esi + 0x70], ebx
sub dword [esi + 0x6c], ebx
add esp, 0xc
sub dword [esi + 0x5c], ebx
mov dword [ebp - 4], eax
lea eax, [ecx + eax*2]
sub eax, 2
movzx ecx, word [eax]
mov edx, ecx
sub edx, ebx
cmp ecx, ebx
sbb ecx, ecx
not ecx
and ecx, edx
dec dword [ebp - 4]
mov word [eax], cx
jne 0x405794
mov eax, dword [esi + 0x40]
mov dword [ebp - 4], ebx
lea eax, [eax + ebx*2]
sub eax, 2
movzx ecx, word [eax]
mov edx, ecx
sub edx, ebx
cmp ecx, ebx
sbb ecx, ecx
not ecx
and ecx, edx
dec dword [ebp - 4]
mov word [eax], cx
jne 0x4057b7
add edi, ebx
mov dword [ebp - 8], edi
mov edi, dword [esi]
cmp dword [edi + 4], 0
je 0x4058ed
mov eax, dword [esi + 0x74]
add eax, dword [esi + 0x6c]
mov ecx, dword [edi + 4]
add eax, dword [esi + 0x38]
mov edx, dword [ebp - 8]
mov dword [ebp - 0xc], eax
mov dword [ebp - 4], ecx
cmp ecx, edx
jbe 0x4057fe
mov dword [ebp - 4], edx
cmp dword [ebp - 4], 0
jne 0x405808
xor eax, eax
jmp 0x405840
sub ecx, dword [ebp - 4]
mov dword [edi + 4], ecx
mov ecx, dword [edi + 0x1c]
cmp dword [ecx + 0x18], 1
jne 0x40582a
push dword [ebp - 4]
mov ecx, dword [edi]
mov eax, dword [edi + 0x30]
call fcn.004074ed
mov dword [edi + 0x30], eax
mov eax, dword [ebp - 0xc]
push dword [ebp - 4]
push dword [edi]
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [ebp - 4]
add dword [edi], eax
add esp, 0xc
add dword [edi + 8], eax
add dword [esi + 0x74], eax
mov edx, dword [esi + 0x74]
cmp edx, 3
jb 0x405868
mov edi, dword [esi + 0x6c]
add edi, dword [esi + 0x38]
mov ecx, dword [esi + 0x58]
movzx eax, byte [edi]
mov dword [esi + 0x48], eax
shl eax, cl
movzx ecx, byte [edi + 1]
xor eax, ecx
and eax, dword [esi + 0x54]
mov dword [esi + 0x48], eax
cmp edx, 0x106
jae 0x40587c
mov eax, dword [esi]
cmp dword [eax + 4], 0
jne 0x405752
mov ecx, dword [esi + 0x16c0]
mov eax, dword [esi + 0x3c]
cmp ecx, eax
jae 0x4058ed
mov edi, dword [esi + 0x6c]
add edi, edx
cmp ecx, edi
jae 0x4058bc
sub eax, edi
mov ebx, eax
mov eax, 0x102
cmp ebx, eax
jbe 0x4058a1
mov ebx, eax
mov eax, dword [esi + 0x38]
push ebx
add eax, edi
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
add ebx, edi
mov dword [esi + 0x16c0], ebx
jmp 0x4058ed
lea edx, [edi + 0x102]
cmp ecx, edx
jae 0x4058ed
sub edi, ecx
add edi, 0x102
sub eax, ecx
cmp edi, eax
jbe 0x4058d6
mov edi, eax
mov eax, dword [esi + 0x38]
push edi
add eax, ecx
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
add dword [esi + 0x16c0], edi
pop edi
pop ebx
leave
ret

Function at 0x408934
Capabilities:
Encode data using xor

Disassembly:
mov esi, 0x4085d8
call fcn.0040895b
add ecx, 0xa6a84adb
add ecx, 0x31a7163f
xor dword [eax], esi
inc eax
cmp eax, edi
jne fcn.00408934
mov ecx, 0xa963fc4d
or edx, edx
ret