Function at 0x1007b910
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd4
mov eax, dword [0x103dda04]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0xcc], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xd0], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0xd4], eax
mov eax, dword [ebx]
push edi
mov edi, dword [ebp + 0x18]
mov dword [ebp - 0xc4], ebx
mov dword [eax + 8], 0
mov dword [ebp - 0x8c], edi
cmp edi, 4
ja 0x1007c34f
push ebx
call fcn.1007fa70
add esp, 4
test eax, eax
jne 0x1007b992
push eax
mov eax, dword [ebx]
push dword [eax + 8]
push ebx
call fcn.1007fe30
add esp, 0xc
xor eax, eax
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100b684e
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x8c]
test ecx, ecx
jne 0x1007b9b2
mov eax, dword [ebx]
cmp dword [eax + 8], 3
setge cl
lea ecx, [ecx*2 + 1]
mov dword [ebp - 0x8c], ecx
mov eax, dword [ebx]
mov edx, dword [eax + 8]
mov dword [ebp - 0xa4], edx
cmp edx, 3
jne 0x1007b9e9
cmp dword [ebx + 0x47ec], edx
je 0x1007b9dc
cmp dword [ebx + 0x47e8], 0
jne 0x1007b9e9
cmp dword [ebx + 0x47e4], 0
jne 0x1007b9e9
mov eax, 1
mov dword [ebp - 0xb8], eax
jmp 0x1007b9fa
xor eax, eax
mov dword [ebp - 0xb8], eax
cmp edx, 3
jne 0x1007bab7
cmp ecx, 3
jge 0x1007bab7
test eax, eax
jne 0x1007bab7
mov dword [ebp - 0xa4], 1
push esi
xor eax, eax
lea esi, [ebx + 0x46a0]
xorps xmm0, xmm0
mov dword [ebp - 0xa0], eax
movups xmmword [ebp - 0xb4], xmm0
lea edi, [ebp - 0x78]
mov dword [ebp - 0x88], esi
mov eax, dword [ebx]
mov eax, dword [eax]
add eax, 3
push eax
call fcn.100bbf26
add esp, 4
mov dword [esi + 0x34], eax
test eax, eax
je 0x1007c313
mov eax, dword [ebx + 0x4684]
cdq
idiv dword [esi]
mov dword [edi + 0x10], 0
mov dword [ebp - 0x90], eax
mov dword [edi], eax
mov eax, dword [ebx + 0x4688]
cdq
idiv dword [esi + 4]
xor edx, edx
mov esi, eax
mov eax, dword [ebp - 0x90]
mov ecx, esi
mov dword [edi + 4], esi
sar ecx, 1
dec eax
mov dword [edi + 0xc], ecx
mov ecx, dword [ebx]
add eax, dword [ecx]
mov ecx, dword [ebp - 0x90]
div ecx
mov dword [edi + 8], eax
mov eax, dword [ebp - 0x88]
mov eax, dword [eax + 0x28]
mov dword [edi - 4], eax
mov dword [edi - 8], eax
cmp ecx, 1
jne 0x1007baef
cmp esi, ecx
jne 0x1007bae3
mov eax, 0x1007c380
jmp 0x1007bb12
mov dword [ebp - 0xb8], eax
test edx, edx
jg 0x1007ba15
push 0
push edx
push ebx
call fcn.1007fe30
add esp, 0xc
xor eax, eax
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100b684e
mov esp, ebp
pop ebp
ret
cmp esi, 2
jne 0x1007bb0d
mov eax, 0x10089130
jmp 0x1007bb12
cmp ecx, 2
jne 0x1007bb0d
cmp esi, 1
jne 0x1007bb00
mov eax, 0x10088e10
jmp 0x1007bb12
cmp esi, 2
jne 0x1007bb0d
mov eax, dword [ebx + 0x4814]
jmp 0x1007bb12
mov eax, 0x10088dc0
mov esi, dword [ebp - 0x88]
mov dword [edi - 0xc], eax
add esi, 0x48
mov eax, dword [ebp - 0xa0]
add edi, 0x20
inc eax
mov dword [ebp - 0x88], esi
mov dword [ebp - 0xa0], eax
cmp eax, dword [ebp - 0xa4]
jl 0x1007ba37
mov eax, dword [ebx]
mov edi, dword [ebp - 0x8c]
mov esi, dword [eax + 4]
mov ecx, dword [eax]
test edi, edi
js 0x1007c313
test ecx, ecx
js 0x1007c313
je 0x1007bb6f
mov eax, SysReAllocString
cdq
idiv ecx
cmp edi, eax
jg 0x1007c313
mov eax, ecx
imul eax, edi
mov dword [ebp - 0x94], eax
test eax, eax
js 0x1007c313
test esi, esi
js 0x1007c313
je 0x1007bba0
mov eax, SysReAllocString
cdq
idiv esi
cmp dword [ebp - 0x94], eax
jg 0x1007c313
imul ecx, esi
mov eax, ecx
imul eax, edi
cmp eax, 0x7ffffffe
jg 0x1007c313
imul ecx, edi
inc ecx
push ecx
call fcn.100bbf26
mov ecx, eax
add esp, 4
mov eax, dword [ebx]
mov dword [ebp - 0xa0], ecx
test ecx, ecx
je 0x1007c315
xor edi, edi
mov dword [ebp - 0x88], edi
cmp dword [eax + 4], edi
jbe 0x1007bfb0
mov edx, dword [ebp - 0x8c]
mov dword [ebp - 0xa0], ecx
jmp 0x1007bbf7
mov ecx, dword [ebp - 0xa0]
mov esi, dword [eax]
imul esi, edi
mov dword [ebp - 0x94], 0
imul esi, edx
add esi, ecx
cmp dword [ebp - 0xa4], 0
mov dword [ebp - 0x98], esi
jle 0x1007bd4b
mov esi, dword [ebp - 0xa4]
lea eax, [ebx + 0x46bc]
mov dword [ebp - 0xc0], eax
lea edi, [ebp - 0x6c]
mov ebx, eax
jmp 0x1007bc46
mov ecx, dword [ebp - 0xa0]
mov eax, dword [ebp - 0xb8]
lea edx, [edi - 0x14]
mov dword [ebp - 0xbc], eax
mov dword [ebp - 0xb8], eax
mov eax, dword [edi - 8]
mov dword [ebp - 0xc8], ecx
mov dword [ebp - 0xa0], ecx
lea ecx, [edi - 0x10]
sar eax, 1
mov dword [ebp - 0x9c], esi
mov dword [ebp - 0xc0], ecx
mov dword [ebp - 0xa4], edx
cmp dword [edi], eax
jl 0x1007bca9
mov eax, dword [edx]
mov edx, ecx
mov dword [ebp - 0x90], ecx
mov ecx, dword [ebp - 0xc8]
mov dword [ebp - 0xa0], ecx
mov ecx, dword [ebp - 0xbc]
mov dword [ebp - 0xb8], ecx
jmp 0x1007bcbf
mov eax, ecx
mov dword [ebp - 0xa4], edx
mov dword [ebp - 0x90], eax
mov dword [ebp - 0xc0], eax
mov eax, dword [ecx]
push dword [edi - 0xc]
push dword [edi - 4]
push eax
mov eax, dword [edx]
push eax
push dword [ebx + 0x18]
call dword [edi - 0x18]
mov ecx, dword [ebp - 0x94]
add esp, 0x14
mov dword [ebp + ecx*4 - 0xb4], eax
mov eax, dword [edi]
inc eax
mov dword [edi], eax
cmp eax, dword [edi - 8]
jl 0x1007bd16
mov edx, dword [ebp - 0x90]
mov eax, dword [ebp - 0xa4]
inc dword [edi + 4]
mov dword [edi], 0
mov edx, dword [edx]
mov dword [eax], edx
mov eax, dword [edi + 4]
cmp eax, dword [ebx]
jge 0x1007bd16
mov eax, dword [ebx + 4]
add eax, edx
mov edx, dword [ebp - 0xc0]
mov dword [edx], eax
inc ecx
add edi, 0x20
add ebx, 0x48
mov dword [ebp - 0x94], ecx
cmp ecx, esi
jl 0x1007bc40
mov ebx, dword [ebp - 0xc4]
mov edx, dword [ebp - 0x8c]
mov edi, dword [ebp - 0x88]
mov dword [ebp - 0xa4], esi
mov eax, dword [ebx]
mov esi, dword [ebp - 0x98]
cmp edx, 3
jl 0x1007c036
mov ecx, dword [eax + 8]
cmp ecx, 3
jne 0x1007be04
cmp dword [ebp - 0xb8], 0
je 0x1007bdd8
xor edi, edi
cmp dword [eax], edi
jbe 0x1007bf98
mov ecx, dword [ebp - 0xb0]
add esi, 2
mov eax, dword [ebp - 0xb4]
mov ebx, dword [ebp - 0xac]
sub eax, ecx
mov dword [ebp - 0x90], ebx
sub dword [ebp - 0x90], ecx
mov ebx, dword [ebp - 0xc4]
mov dword [ebp - 0x98], eax
movzx eax, byte [ecx + eax]
lea ecx, [ecx + 1]
mov byte [esi - 2], al
inc edi
movzx eax, byte [ecx - 1]
mov byte [esi - 1], al
mov eax, dword [ebp - 0x90]
movzx eax, byte [ecx + eax - 1]
mov byte [esi], al
mov byte [esi + 1], 0xff
add esi, edx
mov eax, dword [ebx]
cmp edi, dword [eax]
mov eax, dword [ebp - 0x98]
jb 0x1007bda2
jmp 0x1007bf98
push edx
push dword [eax]
mov eax, dword [ebx + 0x4810]
push dword [ebp - 0xac]
push dword [ebp - 0xb0]
push dword [ebp - 0xb4]
push esi
call eax
mov edx, dword [ebp - 0x8c]
add esp, 0x18
jmp 0x1007bf9e
cmp ecx, 4
jne 0x1007c00c
mov ecx, dword [ebx + 0x47e8]
test ecx, ecx
jne 0x1007bee3
mov dword [ebp - 0x94], ecx
cmp dword [eax], ecx
jbe 0x1007bf9e
mov ecx, dword [ebp - 0xb0]
lea edi, [esi + 2]
mov esi, dword [ebp - 0xa8]
sub ecx, esi
mov eax, dword [ebp - 0xb4]
mov dword [ebp - 0x98], ecx
sub eax, esi
mov ecx, dword [ebp - 0xac]
sub ecx, esi
mov dword [ebp - 0xbc], eax
mov dword [ebp - 0x9c], ecx
nop dword [eax]
movzx ecx, byte [esi + eax]
lea esi, [esi + 1]
movzx edx, byte [esi - 1]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [edi - 2], al
mov eax, dword [ebp - 0x98]
movzx ecx, byte [esi + eax - 1]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [edi - 1], al
mov eax, dword [ebp - 0x9c]
movzx ecx, byte [esi + eax - 1]
imul ecx, edx
mov edx, dword [ebp - 0x8c]
mov byte [edi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0x94]
shr eax, 8
inc ecx
mov byte [edi], al
add edi, edx
mov eax, dword [ebx]
mov dword [ebp - 0x94], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xbc]
jb 0x1007be60
jmp 0x1007bf98
mov eax, dword [eax]
mov edi, dword [ebx + 0x4810]
push edx
push eax
push dword [ebp - 0xac]
push dword [ebp - 0xb0]
push dword [ebp - 0xb4]
push esi
cmp ecx, 2
jne 0x1007bf8d
call edi
mov eax, dword [ebx]
xor edi, edi
add esp, 0x18
cmp dword [eax], edi
jbe 0x1007bf92
add esi, 2
nop dword [eax]
mov eax, dword [ebp - 0xa8]
movzx edx, byte [edi + eax]
inc edi
movzx eax, byte [esi - 2]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 2], al
movzx eax, byte [esi - 1]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi - 1], al
movzx eax, byte [esi]
not al
movzx ecx, al
imul ecx, edx
mov edx, dword [ebp - 0x8c]
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [esi], al
add esi, edx
mov eax, dword [ebx]
cmp edi, dword [eax]
jb 0x1007bf20
jmp 0x1007bf98
call edi
add esp, 0x18
mov edx, dword [ebp - 0x8c]
mov edi, dword [ebp - 0x88]
mov eax, dword [ebx]
inc edi
mov dword [ebp - 0x88], edi
cmp edi, dword [eax + 4]
jb 0x1007bbf1
push 0
push dword [eax + 8]
push ebx
call fcn.1007fe30
mov eax, dword [ebx]
add esp, 0xc
mov ecx, dword [ebp - 0xcc]
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [ebx]
mov ecx, dword [ebp - 0xd0]
mov eax, dword [eax + 4]
mov dword [ecx], eax
mov eax, dword [ebp - 0xd4]
test eax, eax
je 0x1007bff5
mov ecx, dword [ebx]
xor edx, edx
cmp dword [ecx + 8], 3
setge dl
lea edx, [edx*2 + 1]
mov dword [eax], edx
mov eax, dword [ebp - 0xa0]
pop esi
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100b684e
mov esp, ebp
pop ebp
ret
xor ecx, ecx
cmp dword [eax], ecx
jbe 0x1007bf9e
inc esi
mov eax, dword [ebp - 0xb4]
mov al, byte [ecx + eax]
inc ecx
mov byte [esi + 1], al
mov byte [esi], al
mov byte [esi - 1], al
mov byte [esi + 2], 0xff
add esi, edx
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x1007c013
jmp 0x1007bf9e
cmp dword [ebp - 0xb8], 0
je 0x1007c135
mov eax, dword [eax]
xor edi, edi
cmp edx, 1
jne 0x1007c0bf
test eax, eax
je 0x1007bf98
mov edx, dword [ebp - 0xb4]
mov eax, dword [ebp - 0xb0]
sub eax, edx
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0xac]
sub eax, edx
sub esi, edx
mov dword [ebp - 0x9c], eax
nop dword [eax + eax]
movzx eax, byte [edx + eax]
lea edx, [edx + 1]
imul ecx, eax, 0x1d
inc edi
mov eax, dword [ebp - 0x98]
movzx eax, byte [edx + eax - 1]
imul eax, eax, 0x96
add ecx, eax
movzx eax, byte [edx - 1]
imul eax, eax, 0x4d
add ecx, eax
shr ecx, 8
mov byte [edx + esi - 1], cl
mov eax, dword [ebx]
cmp edi, dword [eax]
mov eax, dword [ebp - 0x9c]
jb 0x1007c080
jmp 0x1007bf92
test eax, eax
je 0x1007bf98
mov edx, dword [ebp - 0xb4]
mov eax, dword [ebp - 0xb0]
sub eax, edx
mov dword [ebp - 0x98], eax
mov eax, dword [ebp - 0xac]
sub eax, edx
mov dword [ebp - 0x9c], eax
nop dword [eax]
movzx eax, byte [edx + eax]
lea edx, [edx + 1]
imul ecx, eax, 0x1d
lea esi, [esi + 2]
mov eax, dword [ebp - 0x98]
inc edi
movzx eax, byte [edx + eax - 1]
imul eax, eax, 0x96
add ecx, eax
movzx eax, byte [edx - 1]
imul eax, eax, 0x4d
mov byte [esi - 1], 0xff
add ecx, eax
shr ecx, 8
mov byte [esi - 2], cl
mov eax, dword [ebx]
cmp edi, dword [eax]
mov eax, dword [ebp - 0x9c]
jb 0x1007c0f0
jmp 0x1007bf92
cmp dword [eax + 8], 4
jne 0x1007c2b8
mov ecx, dword [ebx + 0x47e8]
test ecx, ecx
jne 0x1007c241
mov dword [ebp - 0x94], ecx
cmp dword [eax], ecx
jbe 0x1007bf9e
mov ecx, dword [ebp - 0xa8]
mov eax, dword [ebp - 0xb0]
mov edi, dword [ebp - 0xb4]
sub eax, ecx
mov dword [ebp - 0x98], eax
sub edi, ecx
mov eax, dword [ebp - 0xac]
sub eax, ecx
mov dword [ebp - 0x90], ecx
mov dword [ebp - 0xbc], edi
mov dword [ebp - 0x9c], eax
movzx edi, byte [ecx + edi]
movzx eax, byte [ecx]
mov edx, dword [ebp - 0x98]
mov ebx, dword [ebp - 0x9c]
imul edi, eax
movzx ecx, byte [ecx + edx]
mov edx, dword [ebp - 0x90]
imul ecx, eax
sub edi, 0xffffff80
movzx edx, byte [edx + ebx]
imul edx, eax
sub ecx, 0xffffff80
mov ebx, dword [ebp - 0xc4]
mov eax, ecx
mov byte [esi + 1], 0xff
shr eax, 8
add eax, ecx
shr eax, 8
sub edx, 0xffffff80
movzx eax, al
imul ecx, eax, 0x96
mov eax, edx
shr eax, 8
add eax, edx
mov edx, dword [ebp - 0x8c]
shr eax, 8
movzx eax, al
imul eax, eax, 0x1d
add ecx, eax
mov eax, edi
shr eax, 8
add eax, edi
mov edi, dword [ebp - 0x94]
shr eax, 8
inc edi
movzx eax, al
imul eax, eax, 0x4d
mov dword [ebp - 0x94], edi
add ecx, eax
shr ecx, 8
mov byte [esi], cl
add esi, edx
mov eax, dword [ebx]
mov ecx, dword [ebp - 0x90]
inc ecx
mov dword [ebp - 0x90], ecx
cmp edi, dword [eax]
mov edi, dword [ebp - 0xbc]
jb 0x1007c191
jmp 0x1007bf98
cmp ecx, 2
jne 0x1007c2b8
cmp dword [eax], 0
mov dword [ebp - 0x94], 0
jbe 0x1007bf9e
mov eax, dword [ebp - 0xb4]
mov edx, dword [ebp - 0xa8]
sub eax, edx
mov edi, dword [ebp - 0x8c]
mov dword [ebp - 0x98], eax
mov al, byte [edx + eax]
lea edx, [edx + 1]
not al
movzx ecx, al
movzx eax, byte [edx - 1]
imul ecx, eax
mov byte [esi + 1], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0x94]
shr eax, 8
inc ecx
mov byte [esi], al
add esi, edi
mov eax, dword [ebx]
mov dword [ebp - 0x94], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0x98]
jb 0x1007c273
jmp 0x1007bf92
mov eax, dword [eax]
xor ecx, ecx
cmp edx, 1
jne 0x1007c2e6
test eax, eax
je 0x1007bf9e
mov edi, dword [ebp - 0xb4]
sub edi, esi
mov al, byte [edi + esi]
lea esi, [esi + 1]
mov byte [esi - 1], al
inc ecx
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x1007c2d1
jmp 0x1007bf98
test eax, eax
je 0x1007bf9e
mov edx, dword [ebp - 0xb4]
mov al, byte [ecx + edx]
lea esi, [esi + 2]
mov byte [esi - 2], al
inc ecx
mov byte [esi - 1], 0xff
mov eax, dword [ebx]
cmp ecx, dword [eax]
jb 0x1007c2f4
mov edx, dword [ebp - 0x8c]
jmp 0x1007bf9e
mov eax, dword [ebx]
push 0
push dword [eax + 8]
push ebx
call fcn.1007fe30
mov ecx, dword [0x103e91b0]
add esp, 0xc
mov eax, dword fs:[0x2c]
pop esi
mov eax, dword [eax + ecx*4]
pop edi
pop ebx
mov dword [eax + 0xc], str.outofmem
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100b684e
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x103e91b0]
mov eax, dword fs:[0x2c]
pop edi
pop ebx
mov eax, dword [eax + ecx*4]
mov ecx, dword [ebp - 4]
xor ecx, ebp
mov dword [eax + 0xc], str.bad_req_comp
xor eax, eax
call fcn.100b684e
mov esp, ebp
pop ebp
ret