Function at 0x478640
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1c
mov edi, eax
mov eax, dword [eax + 0x2c]
mov dword [ebp - 0x1c], eax
add eax, eax
mov ecx, dword [edi + 0x74]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
lea edx, [eax - 0x106]
mov dword [ebp - 0x28], edx
jmp 0x478746
mov ebx, dword [edi]
mov esi, dword [ebx + 4]
test esi, esi
je 0x47880a
mov edx, dword [edi + 0x38]
mov dword [ebp - 0x18], edx
mov ecx, dword [edi + 0x6c]
mov dword [ebp - 0x14], ecx
mov eax, dword [edi + 0x74]
mov dword [ebp - 0x24], eax
xor eax, eax
cmp dword [ebp - 0x20], esi
jae 0x4786a7
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x4786f3
mov eax, esi
mov edx, dword [ebp - 0x20]
sub eax, edx
mov esi, dword [ebp - 0x20]
mov dword [ebx + 4], eax
mov eax, dword [ebx + 0x1c]
mov eax, dword [eax + 0x18]
cmp eax, 1
je 0x47886e
cmp eax, 2
je 0x478887
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x24]
add eax, ecx
push ecx
push esi
add eax, edx
mov edx, dword [ebx]
push edx
push eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx]
mov ecx, dword [ebx + 8]
add eax, esi
add ecx, esi
mov dword [ebx], eax
mov dword [ebx + 8], ecx
mov eax, esi
mov edx, dword [edi + 0x74]
add esp, 0x10
mov dword [ebp - 0x24], edx
mov ecx, dword [ebp - 0x24]
lea esi, [eax + ecx]
mov dword [edi + 0x74], esi
cmp esi, 2
jbe 0x478728
mov ebx, dword [edi + 0x38]
mov edx, dword [edi + 0x6c]
xor eax, eax
mov ecx, dword [edi + 0x58]
mov al, byte [ebx + edx]
mov dword [edi + 0x48], eax
mov dl, byte [edx + ebx + 1]
and edx, 0xff
shl eax, cl
xor eax, edx
mov edx, dword [edi + 0x54]
and eax, edx
mov dword [edi + 0x48], eax
mov ecx, esi
cmp esi, 0x105
ja 0x478812
mov eax, dword [edi]
mov eax, dword [eax + 4]
test eax, eax
je 0x478812
mov eax, dword [edi + 0x2c]
mov ebx, dword [edi + 0x3c]
mov edx, dword [edi + 0x6c]
sub ebx, ecx
mov esi, dword [ebp - 0x28]
sub ebx, edx
add eax, esi
mov dword [ebp - 0x20], ebx
cmp edx, eax
jb 0x478670
mov edx, dword [edi + 0x38]
mov ecx, dword [ebp - 0x1c]
push ebx
push ecx
lea eax, [edx + ecx]
push eax
push edx
call sub.msvcrt.dll_memcpy
mov ebx, dword [ebp - 0x1c]
mov eax, dword [edi + 0x70]
mov ecx, dword [edi + 0x4c]
sub eax, ebx
add esp, 0x10
mov dword [edi + 0x70], eax
mov eax, dword [edi + 0x6c]
sub eax, ebx
lea edx, [ecx + ecx]
mov dword [edi + 0x6c], eax
mov eax, dword [edi + 0x5c]
sub eax, ebx
mov dword [edi + 0x5c], eax
mov eax, dword [edi + 0x44]
add edx, eax
nop
lea esi, [esi]
mov bx, word [edx - 2]
xor esi, esi
mov eax, ebx
and eax, 0xffff
cmp dword [ebp - 0x1c], eax
ja 0x4787b8
mov esi, ebx
sub si, word [ebp - 0x1c]
mov word [edx - 2], si
sub edx, 2
dec ecx
jne 0x4787a0
mov edx, dword [ebp - 0x10]
mov esi, dword [edi + 0x40]
add edx, esi
mov ecx, dword [ebp - 0x1c]
lea esi, [esi]
mov bx, word [edx - 2]
xor esi, esi
mov eax, ebx
and eax, 0xffff
cmp dword [ebp - 0x1c], eax
ja 0x4787e8
mov esi, ebx
sub si, word [ebp - 0x1c]
mov word [edx - 2], si
sub edx, 2
dec ecx
jne 0x4787d0
mov ebx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x1c]
add ebx, eax
mov dword [ebp - 0x20], ebx
mov ebx, dword [edi]
mov esi, dword [ebx + 4]
test esi, esi
jne 0x47867d
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [edi + 0x16c0]
mov ecx, dword [edi + 0x3c]
cmp edx, ecx
jae 0x47880a
mov ebx, esi
mov esi, dword [edi + 0x6c]
add ebx, esi
cmp edx, ebx
jb 0x4788a0
lea eax, [ebx + 0x102]
cmp edx, eax
jae 0x47880a
sub ebx, edx
mov eax, ecx
sub eax, edx
add ebx, 0x102
cmp ebx, eax
jbe 0x478846
mov ebx, eax
mov ecx, dword [edi + 0x38]
push eax
add edx, ecx
push ebx
push 0
push edx
call sub.msvcrt.dll_memset
mov eax, dword [edi + 0x16c0]
add eax, ebx
add esp, 0x10
mov dword [edi + 0x16c0], eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
push eax
push esi
mov eax, dword [ebx]
push eax
mov eax, dword [ebx + 0x30]
push eax
call fcn.00480670
add esp, 0x10
mov dword [ebx + 0x30], eax
jmp 0x4786c2
push eax
push esi
mov eax, dword [ebx]
push eax
mov eax, dword [ebx + 0x30]
push eax
call fcn.0047ae90
add esp, 0x10
mov dword [ebx + 0x30], eax
jmp 0x4786c2
mov esi, ecx
sub esi, ebx
cmp esi, 0x102
jbe 0x4788b1
mov esi, 0x102
mov ecx, dword [edi + 0x38]
mov eax, ebx
add eax, ecx
push edx
push esi
push 0
push eax
call sub.msvcrt.dll_memset
lea eax, [esi + ebx]
add esp, 0x10
mov dword [edi + 0x16c0], eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret