Function at 0x1007d8a0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 8
push ebx
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 0x20]
push edi
cmp eax, dword [esi + 0x3c]
jbe 0x1007d8b8
mov edx, dword [esi]
mov eax, dword [edx + 4]
call eax
cmp dword [esi + 0x14], 0xf96
jl 0x1007db08
mov ecx, dword [esp + 0x1c]
mov ebp, dword [ecx + 4]
shr ebp, 5
cmp ebp, 1
jbe 0x1007d8da
mov dword [esp + 0x14], ebp
jmp 0x1007d8e6
mov dword [esp + 0x14], 1
mov ebp, dword [esp + 0x14]
xor ebx, ebx
push 0x10
mov ecx, esi
mov dword [esp + 0x14], ebx
call fcn.1007d7a0
cmp eax, 0x4c7a
jb 0x1007d90e
lea esp, [esp]
inc ebx
cmp eax, dword [ebx*4 + 0x100b181c]
jae 0x1007d900
mov dword [esp + 0x10], ebx
mov eax, dword [esi + 0x34]
mov edx, dword [ebx*4 + 0x100b1818]
imul edx, eax
sub dword [esi + 0x30], edx
mov ecx, dword [ebx*4 + 0x100b1920]
imul ecx, eax
mov dword [esi + 0x34], ecx
cmp ebx, 0x3f
jne 0x1007d94f
push 0x10
mov ecx, esi
call fcn.1007d820
mov edi, eax
push 0x10
mov ecx, esi
shl edi, 0x10
call fcn.1007d820
or edi, eax
mov dword [esp + 0x10], edi
mov ebx, edi
cmp ebp, 0x10000
jl 0x1007da89
xor ecx, ecx
test ebp, ebp
jle 0x1007d96a
inc ecx
mov edx, ebp
sar edx, cl
test edx, edx
jg 0x1007d961
add ecx, 0xfffffff0
mov ebx, 1
shl ebx, cl
mov eax, ebp
cdq
idiv ebx
mov edi, eax
inc edi
cmp dword [esi + 0x34], 0x800000
ja 0x1007d9d8
mov ebp, dword [esi + 0x24]
mov eax, dword [esi + 0x20]
mov edx, eax
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
mov edx, eax
shr edx, 5
mov edx, dword [ebp + edx*4]
shl dword [esi + 0x34], 8
add eax, 8
mov dword [esi + 0x20], eax
mov eax, dword [esi + 0x38]
shr edx, cl
mov ecx, dword [esi + 0x30]
shl eax, 8
shl ecx, 8
and edx, 0xff
or eax, edx
mov dword [esi + 0x38], eax
shr eax, 1
and eax, 0xff
or eax, ecx
mov dword [esi + 0x30], eax
cmp dword [esi + 0x34], 0x800000
jbe 0x1007d988
mov eax, dword [esi + 0x34]
xor edx, edx
div edi
mov edi, dword [esi + 0x30]
xor edx, edx
mov ecx, eax
mov eax, edi
div ecx
mov edx, ecx
mov dword [esi + 0x34], ecx
mov ebp, eax
imul edx, ebp
sub edi, edx
mov dword [esi + 0x30], edi
cmp ecx, 0x800000
ja 0x1007da53
mov edi, dword [esi + 0x24]
mov eax, dword [esi + 0x20]
mov edx, eax
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
mov edx, eax
shr edx, 5
mov edx, dword [edi + edx*4]
shl dword [esi + 0x34], 8
add eax, 8
mov dword [esi + 0x20], eax
mov eax, dword [esi + 0x38]
shr edx, cl
mov ecx, dword [esi + 0x30]
shl eax, 8
shl ecx, 8
and edx, 0xff
or eax, edx
mov dword [esi + 0x38], eax
shr eax, 1
and eax, 0xff
or eax, ecx
mov dword [esi + 0x30], eax
cmp dword [esi + 0x34], 0x800000
jbe 0x1007da04
mov eax, dword [esi + 0x34]
imul ebp, ebx
xor edx, edx
div ebx
mov edi, dword [esi + 0x30]
xor edx, edx
mov ebx, dword [esp + 0x10]
mov ecx, eax
mov eax, edi
div ecx
mov dword [esi + 0x34], ecx
add ebp, eax
imul ecx, eax
mov eax, ebp
mov ebp, dword [esp + 0x14]
imul ebx, ebp
sub edi, ecx
mov dword [esi + 0x30], edi
add ebx, eax
jmp 0x1007db78
cmp dword [esi + 0x34], 0x800000
ja 0x1007dae4
mov edi, dword [esi + 0x24]
mov eax, dword [esi + 0x20]
mov edx, eax
and edx, 0x1f
mov ecx, 0x18
sub ecx, edx
mov edx, eax
shr edx, 5
mov edx, dword [edi + edx*4]
shl dword [esi + 0x34], 8
add eax, 8
mov dword [esi + 0x20], eax
mov eax, dword [esi + 0x38]
shr edx, cl
mov ecx, dword [esi + 0x30]
shl eax, 8
shl ecx, 8
and edx, 0xff
or eax, edx
mov dword [esi + 0x38], eax
shr eax, 1
and eax, 0xff
or eax, ecx
mov dword [esi + 0x30], eax
cmp dword [esi + 0x34], 0x800000
jbe 0x1007da95
mov eax, dword [esi + 0x34]
imul ebx, ebp
xor edx, edx
div ebp
mov edi, dword [esi + 0x30]
xor edx, edx
mov ecx, eax
mov eax, edi
div ecx
mov dword [esi + 0x34], ecx
imul ecx, eax
sub edi, ecx
mov dword [esi + 0x30], edi
add ebx, eax
jmp 0x1007db78
push 0x10
mov ecx, esi
call fcn.1007d7a0
xor edi, edi
cmp eax, 0x39e8
jb 0x1007db2a
lea ebx, [ebx]
inc edi
cmp eax, dword [edi*4 + 0x100b1614]
jae 0x1007db20
mov eax, dword [esi + 0x34]
mov edx, dword [edi*4 + 0x100b1610]
imul edx, eax
sub dword [esi + 0x30], edx
mov ecx, dword [edi*4 + 0x100b1718]
imul ecx, eax
mov dword [esi + 0x34], ecx
cmp edi, 0x3f
jne 0x1007db5b
push 5
mov ecx, esi
call fcn.1007d820
mov ebp, eax
xor edi, edi
jmp 0x1007dba3
mov edx, dword [esp + 0x1c]
mov ebp, dword [edx]
cmp ebp, 1
jae 0x1007dba2
xor ebp, ebp
push ebp
mov ecx, esi
call fcn.1007d820
mov ebx, eax
mov ecx, ebp
shl edi, cl
add ebx, edi
mov esi, dword [esp + 0x1c]
mov ecx, dword [esi + 4]
lea eax, [ebx + 1]
cdq
sub eax, edx
lea edx, [ecx + 0x10]
sar eax, 1
shr edx, 5
sub eax, edx
add eax, ecx
mov ecx, dword [esi]
mov dword [esi + 4], eax
cmp eax, dword [ecx*4 + 0x100b1590]
jae 0x1007dbd4
dec ecx
jmp 0x1007dbde
dec ebp
cmp ebp, 0x10
jle 0x1007db68
cmp dword [esi + 0x14], 0xf46
jl 0x1007db68
push 0x10
mov ecx, esi
call fcn.1007d820
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x10]
push eax
mov ecx, esi
call fcn.1007d820
mov ebx, eax
shl ebx, 0x10
or ebx, dword [esp + 0x14]
jmp 0x1007db72
cmp eax, dword [ecx*4 + 0x100b1594]
jb 0x1007dbe0
inc ecx
mov dword [esi], ecx
test bl, 1
je 0x1007dbf4
pop edi
sar ebx, 1
pop esi
inc ebx
pop ebp
mov eax, ebx
pop ebx
add esp, 8
ret 4
pop edi
sar ebx, 1
pop esi
neg ebx
pop ebp
mov eax, ebx
pop ebx
add esp, 8
ret 4