Function at 0x557880
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x18
mov eax, dword [esp + 0x40]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x30]
push ebx
push ebp
push esi
mov eax, dword [eax + ecx*4]
mov esi, 1
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0xc], edx
push edi
mov eax, dword [eax + ecx*4]
cmp eax, esi
mov dword [esp + 0x14], eax
cmovg esi, eax
mov eax, esi
cdq
xor eax, edx
sub eax, edx
test eax, 0xffff0000
je 0x5578cd
sar eax, 0x10
mov ecx, eax
call fcn.0053dee0
jmp 0x5578d7
mov ecx, eax
call fcn.0053dee0
add eax, 0x10
lea ebx, [eax - 1]
mov eax, 0x1fffffff
mov ecx, ebx
cdq
shl esi, cl
mov ecx, esi
movzx esi, si
sar ecx, 0x10
idiv ecx
mov edi, eax
movsx edx, di
mov ebp, edi
imul esi, edx
imul ecx, edx
sar ebp, 0xf
inc ebp
shl edi, 0x10
sar ebp, 1
sar esi, 0x10
add esi, ecx
mov ecx, 0xe
neg esi
sub ecx, ebx
shl esi, 3
imul ebp, esi
movzx eax, si
imul eax, edx
sar esi, 0x10
imul esi, edx
sar eax, 0x10
add ebp, eax
add ebp, esi
add ebp, edi
test ecx, ecx
jg 0x557969
neg ecx
mov esi, SysReAllocString
mov eax, SysReAllocString
sar esi, cl
sar eax, cl
cmp esi, eax
jle 0x557954
cmp ebp, esi
jg 0x557965
cmp ebp, eax
mov esi, ebp
cmovl esi, eax
shl esi, cl
jmp 0x557976
cmp ebp, eax
jle 0x55795e
mov esi, eax
shl esi, cl
jmp 0x557976
cmp ebp, esi
cmovl ebp, esi
mov esi, ebp
shl esi, cl
jmp 0x557976
cmp ecx, 0x20
jge 0x557974
mov esi, ebp
sar esi, cl
jmp 0x557976
xor esi, esi
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x50], esi
mov ecx, dword [edi + 0x1114]
cmp eax, ecx
je 0x55799b
push ecx
mov edx, eax
call fcn.005550c0
add esp, 4
mov ebx, eax
jmp 0x5579a0
mov ebx, 0x10000
mov ecx, dword [esp + 0x18]
mov eax, esi
sar eax, 7
inc eax
mov dword [esp + 0x4c], ebx
sar eax, 1
mov ecx, dword [ecx + 0x1204]
mov dword [esp + 0x24], ecx
test ecx, ecx
jle 0x557a17
mov ebp, dword [esp + 0x34]
mov ecx, eax
mov ebx, dword [esp + 0x24]
sar ecx, 0xf
inc ecx
movsx esi, ax
mov eax, dword [esp + 0x30]
sar ecx, 1
sub eax, ebp
mov dword [esp + 0x20], ecx
mov edi, ecx
mov dword [esp + 0x30], eax
mov edx, dword [eax + ebp]
lea ebp, [ebp + 4]
movzx ecx, dx
mov eax, edx
imul ecx, esi
sar eax, 0x10
imul eax, esi
imul edx, edi
sar ecx, 0x10
add ecx, eax
mov eax, dword [esp + 0x30]
add ecx, edx
mov dword [ebp - 4], ecx
sub ebx, 1
jne 0x5579e1
mov ebx, dword [esp + 0x4c]
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x10]
cmp dword [edi + 0x1118], 0
mov eax, dword [esp + 0x14]
mov dword [edi + 0x1114], eax
je 0x557aa3
cmp dword [esp + 0x40], 0
jne 0x557a4a
movsx eax, word [esp + 0x48]
movzx ecx, si
sar esi, 0x10
imul ecx, eax
imul esi, eax
sar ecx, 0x10
add esi, ecx
shl esi, 2
mov eax, dword [edi + 0x1108]
mov edi, eax
sub edi, dword [esp + 0x1c]
sub edi, 2
cmp edi, eax
jge 0x557a9f
mov ebp, dword [esp + 0x10]
mov ebx, dword [esp + 0x3c]
movzx eax, si
mov dword [esp + 0x40], eax
sar esi, 0x10
nop
mov ecx, dword [esp + 0x38]
mov edx, eax
mov eax, esi
movsx ecx, word [ecx + edi*2]
imul edx, ecx
imul eax, ecx
sar edx, 0x10
add edx, eax
mov eax, dword [esp + 0x40]
mov dword [ebx + edi*4], edx
inc edi
cmp edi, dword [ebp + 0x1108]
jl 0x557a70
mov ebx, dword [esp + 0x4c]
mov edi, ebp
jmp 0x557aa3
mov edi, dword [esp + 0x10]
cmp ebx, 0x10000
je 0x557ce2
mov edx, dword [esp + 0x18]
mov eax, dword [edi + 0x110c]
mov ecx, eax
movzx ebp, bx
sub ecx, dword [edx + 0x1208]
mov dword [esp + 0x40], ecx
cmp ecx, eax
jge 0x557b19
mov eax, ebx
lea esi, [ecx + 0x140]
sar eax, 0x10
lea esi, [edi + esi*4]
mov dword [esp + 0x50], eax
mov edi, edi
mov edx, dword [esi]
lea esi, [esi + 4]
movsx ecx, word [esi - 4]
sar edx, 0xf
mov eax, ecx
inc edx
imul eax, ebp
sar edx, 1
imul edx, ebx
sar eax, 0x10
add edx, eax
mov eax, dword [esp + 0x50]
imul eax, ecx
add edx, eax
mov eax, dword [esp + 0x40]
inc eax
mov dword [esi - 4], edx
mov dword [esp + 0x40], eax
cmp eax, dword [edi + 0x110c]
jl 0x557ae0
cmp dword [esp + 0x54], 2
jne 0x557b8d
cmp dword [edi + 0x1118], 0
jne 0x557b8d
mov eax, dword [edi + 0x1108]
mov esi, eax
sub esi, dword [esp + 0x1c]
sub eax, dword [esp + 0x58]
sub esi, 2
cmp esi, eax
jge 0x557b8d
mov eax, ebx
sar eax, 0x10
mov dword [esp + 0x40], eax
lea esp, [esp]
mov eax, dword [esp + 0x3c]
mov edx, dword [eax + esi*4]
movsx ecx, word [eax + esi*4]
mov eax, ebp
sar edx, 0xf
inc edx
imul eax, ecx
sar edx, 1
imul edx, ebx
sar eax, 0x10
add edx, eax
mov eax, dword [esp + 0x40]
imul eax, ecx
add edx, eax
mov eax, dword [esp + 0x3c]
mov dword [eax + esi*4], edx
inc esi
mov eax, dword [edi + 0x1108]
sub eax, dword [esp + 0x58]
cmp esi, eax
jl 0x557b50
cmp dword [esp + 0x44], 0
jle 0x557ce2
mov eax, dword [esp + 0x2c]
mov edi, ebx
sar edi, 0x10
add eax, 0x480
mov dword [esp + 0x4c], edi
mov dword [esp + 0x40], eax
mov edi, edi
mov edx, dword [eax]
movsx ecx, word [eax]
mov eax, ebp
sar edx, 0xf
inc edx
imul eax, ecx
sar edx, 1
imul edx, ebx
sar eax, 0x10
add edx, eax
mov eax, edi
imul eax, ecx
add edx, eax
mov eax, dword [esp + 0x40]
xor esi, esi
mov dword [eax], edx
jmp 0x557be0
mov edx, dword [eax + esi*4 - 0x480]
movsx ecx, word [eax + esi*4 - 0x480]
mov eax, ebp
sar edx, 0xf
inc edx
imul eax, ecx
sar edx, 1
imul edx, ebx
sar eax, 0x10
add edx, eax
mov eax, edi
imul eax, ecx
add edx, eax
mov eax, dword [esp + 0x40]
mov dword [eax + esi*4 - 0x480], edx
inc esi
cmp esi, 0x20
jl 0x557be0
add eax, 0xffffff40
mov dword [esp + 0x50], 0x10
mov dword [esp + 0x24], eax
lea edi, [eax + 0x80]
mov eax, dword [esp + 0x4c]
mov esi, dword [edi]
lea edi, [edi + 4]
movsx edx, word [edi - 4]
sar esi, 0xf
mov ecx, edx
inc esi
imul ecx, ebp
sar esi, 1
imul esi, ebx
sar ecx, 0x10
add esi, ecx
mov ecx, eax
imul ecx, edx
add esi, ecx
sub dword [esp + 0x50], 1
mov dword [edi - 4], esi
jne 0x557c35
mov eax, dword [esp + 0x24]
mov edi, dword [esp + 0x4c]
mov dword [esp + 0x50], 0x20
mov esi, dword [eax - 0x80]
lea eax, [eax + 4]
movsx edx, word [eax - 0x84]
mov ecx, ebp
sar esi, 0xf
inc esi
imul ecx, edx
sar esi, 1
imul esi, ebx
sar ecx, 0x10
add esi, ecx
mov ecx, edi
imul ecx, edx
movsx edx, word [eax - 4]
add esi, ecx
mov ecx, ebp
mov dword [eax - 0x84], esi
mov esi, dword [eax - 4]
sar esi, 0xf
inc esi
imul ecx, edx
sar esi, 1
imul esi, ebx
sar ecx, 0x10
add esi, ecx
mov ecx, edi
imul ecx, edx
add esi, ecx
sub dword [esp + 0x50], 1
mov dword [eax - 4], esi
jne 0x557c72
mov eax, dword [esp + 0x40]
add eax, 0x490
sub dword [esp + 0x44], 1
mov dword [esp + 0x40], eax
jne 0x557bb0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret