Function at 0xa16530
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0x2c
mov eax, dword [eax + 0x2c]
mov ecx, dword [esi + 0x74]
mov dword [ebp - 0x1c], eax
add eax, eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
lea edx, [eax - 0x106]
mov dword [ebp - 0x24], edx
jmp 0xa16623
mov ebx, dword [esi]
mov edi, dword [ebx + 4]
test edi, edi
je 0xa166d3
mov eax, dword [esi + 0x74]
mov edx, dword [esi + 0x38]
mov ecx, dword [esi + 0x6c]
mov dword [ebp - 0x28], eax
xor eax, eax
cmp dword [ebp - 0x20], edi
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x18], ecx
jae 0xa16595
mov edx, dword [ebp - 0x20]
test edx, edx
je 0xa165d8
mov eax, edi
mov edi, dword [ebp - 0x20]
sub eax, dword [ebp - 0x20]
mov dword [ebx + 4], eax
mov eax, dword [ebx + 0x1c]
mov eax, dword [eax + 0x18]
cmp eax, 1
je 0xa166db
cmp eax, 2
je 0xa166f8
mov edx, dword [ebx]
mov eax, dword [ebp - 0x14]
add eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x28]
mov dword [esp + 4], edx
mov dword [esp + 8], edi
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov edx, dword [esi + 0x74]
mov eax, edi
add dword [ebx], edi
add dword [ebx + 8], edi
mov dword [ebp - 0x28], edx
mov ecx, dword [ebp - 0x28]
lea edi, [eax + ecx]
cmp edi, 2
mov dword [esi + 0x74], edi
jbe 0xa16605
mov ebx, dword [esi + 0x38]
mov edx, dword [esi + 0x6c]
mov ecx, dword [esi + 0x58]
movzx eax, byte [ebx + edx]
mov dword [esi + 0x48], eax
movzx edx, byte [edx + ebx + 1]
shl eax, cl
xor eax, edx
and eax, dword [esi + 0x54]
mov dword [esi + 0x48], eax
cmp edi, 0x105
mov ecx, edi
ja 0xa166d3
mov eax, dword [esi]
mov ebx, dword [eax + 4]
test ebx, ebx
je 0xa166d3
mov eax, dword [esi + 0x2c]
mov ebx, dword [esi + 0x3c]
mov edx, dword [esi + 0x6c]
add eax, dword [ebp - 0x24]
sub ebx, ecx
sub ebx, edx
cmp edx, eax
mov dword [ebp - 0x20], ebx
jb 0xa16560
mov ecx, dword [ebp - 0x1c]
mov edx, dword [esi + 0x38]
mov dword [esp + 8], ecx
lea eax, [edx + ecx]
mov dword [esp + 4], eax
mov dword [esp], edx
call sub.msvcrt.dll_memcpy
mov ebx, dword [ebp - 0x1c]
sub dword [esi + 0x70], ebx
sub dword [esi + 0x6c], ebx
sub dword [esi + 0x5c], ebx
mov ebx, dword [esi + 0x4c]
lea ecx, [ebx + ebx]
add ecx, dword [esi + 0x44]
lea esi, [esi]
movzx eax, word [ecx - 2]
movzx edx, ax
sub ax, word [ebp - 0x1c]
cmp edx, dword [ebp - 0x1c]
sbb edx, edx
not edx
and eax, edx
mov word [ecx - 2], ax
sub ecx, 2
sub ebx, 1
jne 0xa16670
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x1c]
add ecx, dword [esi + 0x40]
lea esi, [esi]
movzx eax, word [ecx - 2]
movzx edx, ax
sub ax, word [ebp - 0x1c]
cmp edx, dword [ebp - 0x1c]
sbb edx, edx
not edx
and eax, edx
mov word [ecx - 2], ax
sub ecx, 2
sub ebx, 1
jne 0xa166a0
mov ebx, dword [esi]
mov eax, dword [ebp - 0x1c]
add dword [ebp - 0x20], eax
mov edi, dword [ebx + 4]
test edi, edi
jne 0xa1656d
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], edi
mov eax, dword [ebx]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x30]
mov dword [esp], eax
call fcn.00a19f80
mov dword [ebx + 0x30], eax
jmp 0xa165b0
mov dword [esp + 8], edi
mov eax, dword [ebx]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x30]
mov dword [esp], eax
call fcn.00a18870
mov dword [ebx + 0x30], eax
jmp 0xa165b0