Function at 0x4b9185
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xdc
mov eax, dword [0x5d061c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 0x18]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0xd4], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xd8], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0xdc], eax
mov eax, dword [esi]
push edi
xor edi, edi
mov dword [ebp - 0xcc], esi
mov dword [ebp - 0xb8], ebx
mov dword [eax + 8], edi
cmp ebx, 4
ja 0x4b99b3
push esi
call fcn.004bcd1f
pop ecx
test eax, eax
je 0x4b99aa
xor ecx, ecx
inc ecx
push 3
pop edx
test ebx, ebx
jne 0x4b9201
mov eax, dword [esi]
mov ebx, ecx
cmp dword [eax + 8], edx
cmovge ebx, edx
mov dword [ebp - 0xb8], ebx
mov eax, dword [esi]
push 3
mov edx, dword [eax + 8]
pop eax
mov dword [ebp - 0xbc], edx
cmp edx, eax
jne 0x4b9235
cmp dword [esi + 0x47ec], eax
je 0x4b922b
cmp dword [esi + 0x47e8], edi
jne 0x4b9235
cmp dword [esi + 0x47e4], edi
jne 0x4b9235
mov eax, ecx
mov dword [ebp - 0xc4], eax
jmp 0x4b9242
mov eax, edi
mov dword [ebp - 0xc4], eax
cmp edx, 3
jne 0x4b9253
cmp ebx, 3
jge 0x4b9253
test eax, eax
jne 0x4b9253
mov dword [ebp - 0xbc], ecx
jmp 0x4b925b
test edx, edx
jle 0x4b99aa
xorps xmm0, xmm0
mov dword [ebp - 0xb0], edi
lea eax, [esi + 0x46a0]
movups xmmword [ebp - 0x14], xmm0
lea edi, [ebp - 0x88]
mov dword [ebp - 0x98], eax
mov eax, dword [esi]
mov eax, dword [eax]
add eax, 3
push eax
call fcn.004fa51d
pop ecx
mov ecx, dword [ebp - 0x98]
mov dword [ecx + 0x34], eax
test eax, eax
je 0x4b9384
mov eax, dword [esi + 0x4684]
cdq
idiv dword [ecx]
and dword [edi + 0x10], 0
mov dword [ebp - 0xa0], eax
mov dword [edi], eax
mov eax, dword [esi + 0x4688]
cdq
idiv dword [ecx + 4]
xor edx, edx
mov ecx, eax
mov dword [ebp - 0xb4], eax
sar ecx, 1
mov dword [edi + 4], eax
mov eax, dword [ebp - 0xa0]
mov dword [edi + 0xc], ecx
dec eax
mov ecx, dword [esi]
add eax, dword [ecx]
div dword [ebp - 0xa0]
mov ecx, dword [ebp - 0x98]
xor edx, edx
mov dword [edi + 8], eax
inc edx
mov eax, dword [ecx + 0x28]
mov dword [edi - 4], eax
mov dword [edi - 8], eax
mov eax, dword [ebp - 0xa0]
cmp eax, edx
jne 0x4b9317
mov eax, dword [ebp - 0xb4]
cmp eax, edx
jne 0x4b930b
mov eax, 0x4b99dd
jmp 0x4b933f
cmp eax, 2
jne 0x4b933a
mov eax, 0x4c57ac
jmp 0x4b933f
cmp eax, 2
jne 0x4b933a
mov eax, dword [ebp - 0xb4]
cmp eax, edx
jne 0x4b932d
mov eax, 0x4c54df
jmp 0x4b933f
cmp eax, 2
jne 0x4b933a
mov eax, dword [esi + 0x4814]
jmp 0x4b933f
mov eax, 0x4c54a3
mov dword [edi - 0xc], eax
add ecx, 0x48
mov eax, dword [ebp - 0xb0]
add edi, 0x20
inc eax
mov dword [ebp - 0x98], ecx
mov dword [ebp - 0xb0], eax
cmp eax, dword [ebp - 0xbc]
jl 0x4b927a
mov eax, dword [esi]
push edx
push dword [eax + 4]
push dword [eax]
push ebx
call fcn.004c1407
mov edx, eax
add esp, 0x10
mov dword [ebp - 0xd0], edx
test edx, edx
jne 0x4b93a9
push esi
call fcn.004bb18f
mov eax, dword fs:[0x2c]
pop ecx
mov ecx, dword [0x5da1ac]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.outofmem
jmp 0x4b99cc
mov eax, dword [esi]
xor ecx, ecx
mov dword [ebp - 0x98], ecx
cmp dword [eax + 4], ecx
jbe 0x4b9968
mov edi, dword [eax]
imul edi, ecx
imul edi, ebx
add edi, edx
xor edx, edx
mov dword [ebp - 0xa4], edi
mov dword [ebp - 0x9c], edx
cmp dword [ebp - 0xbc], edx
jbe 0x4b94b5
mov edi, dword [ebp - 0xbc]
lea eax, [esi + 0x46bc]
mov dword [ebp - 0xac], eax
lea ebx, [ebp - 0x7c]
mov esi, eax
mov eax, dword [ebx - 8]
lea ecx, [ebx - 0x10]
sar eax, 1
lea edx, [ebx - 0x14]
mov dword [ebp - 0xac], ecx
mov dword [ebp - 0xc8], edx
cmp dword [ebx], eax
jl 0x4b941e
mov eax, dword [edx]
mov edx, ecx
mov dword [ebp - 0xa0], ecx
jmp 0x4b9434
mov eax, ecx
mov dword [ebp - 0xc8], edx
mov dword [ebp - 0xa0], eax
mov dword [ebp - 0xac], eax
mov eax, dword [ecx]
push dword [ebx - 0xc]
push dword [ebx - 4]
push eax
push dword [edx]
push dword [esi + 0x18]
call dword [ebx - 0x18]
mov ecx, dword [ebp - 0x9c]
add esp, 0x14
mov dword [ebp + ecx*4 - 0x14], eax
mov eax, dword [ebx]
inc eax
mov dword [ebx], eax
cmp eax, dword [ebx - 8]
jl 0x4b9484
mov edx, dword [ebp - 0xa0]
mov eax, dword [ebp - 0xc8]
and dword [ebx], 0
inc dword [ebx + 4]
mov edx, dword [edx]
mov dword [eax], edx
mov eax, dword [ebx + 4]
cmp eax, dword [esi]
jge 0x4b9484
mov eax, dword [esi + 4]
add eax, edx
mov edx, dword [ebp - 0xac]
mov dword [edx], eax
inc ecx
add ebx, 0x20
add esi, 0x48
mov dword [ebp - 0x9c], ecx
cmp ecx, edi
jl 0x4b93f7
mov esi, dword [ebp - 0xcc]
xor edx, edx
mov edi, dword [ebp - 0xa4]
mov ebx, dword [ebp - 0xb8]
mov ecx, dword [ebp - 0x98]
mov eax, dword [esi]
cmp ebx, 3
jl 0x4b96ca
cmp dword [eax + 8], 3
jne 0x4b954a
cmp dword [ebp - 0xc4], 0
je 0x4b952f
cmp dword [eax], 0
jbe 0x4b9950
mov ecx, dword [ebp - 0x10]
add edi, 2
mov eax, dword [ebp - 0x14]
mov esi, dword [ebp - 0xc]
sub eax, ecx
mov dword [ebp - 0xa0], esi
sub dword [ebp - 0xa0], ecx
mov esi, dword [ebp - 0xcc]
mov dword [ebp - 0xa4], eax
mov al, byte [ecx + eax]
mov byte [edi - 2], al
mov al, byte [ecx]
mov byte [edi - 1], al
mov eax, dword [ebp - 0xa0]
mov al, byte [ecx + eax]
mov byte [edi], al
mov byte [edi + 1], 0xff
add edi, ebx
mov eax, dword [esi]
inc edx
inc ecx
cmp edx, dword [eax]
mov eax, dword [ebp - 0xa4]
jb 0x4b9500
jmp 0x4b994a
push ebx
push dword [eax]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push edi
call dword [esi + 0x4810]
add esp, 0x18
jmp 0x4b994a
cmp dword [eax + 8], 4
jne 0x4b969f
mov ecx, dword [esi + 0x47e8]
test ecx, ecx
jne 0x4b960b
mov dword [ebp - 0x9c], edx
cmp dword [eax], edx
jbe 0x4b994a
mov edx, dword [ebp - 0x14]
add edi, 2
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
sub ecx, edx
mov dword [ebp - 0xa4], ecx
sub eax, edx
mov ecx, dword [ebp - 0xc]
sub ecx, edx
mov dword [ebp - 0xac], eax
mov dword [ebp - 0xa8], ecx
mov al, byte [edx + eax]
mov byte [ebp - 0xc0], al
push dword [ebp - 0xc0]
movzx eax, byte [edx]
push eax
call fcn.004b9d34
push dword [ebp - 0xc0]
mov byte [edi - 2], al
mov eax, dword [ebp - 0xa4]
movzx eax, byte [edx + eax]
push eax
call fcn.004b9d34
push dword [ebp - 0xc0]
mov byte [edi - 1], al
mov eax, dword [ebp - 0xa8]
movzx eax, byte [edx + eax]
push eax
call fcn.004b9d34
mov ecx, dword [ebp - 0x9c]
add esp, 0x18
mov byte [edi], al
mov byte [edi + 1], 0xff
add edi, ebx
mov eax, dword [esi]
inc ecx
inc edx
mov dword [ebp - 0x9c], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xac]
jb 0x4b9597
jmp 0x4b994a
mov eax, dword [eax]
mov edx, dword [esi + 0x4810]
push ebx
push eax
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push edi
cmp ecx, 2
jne 0x4b9698
call edx
mov eax, dword [esi]
xor edx, edx
add esp, 0x18
cmp dword [eax], edx
jbe 0x4b994a
add edi, 2
mov eax, dword [ebp - 8]
mov al, byte [edx + eax]
mov byte [ebp - 0xb0], al
mov al, byte [edi - 2]
push dword [ebp - 0xb0]
not al
movzx eax, al
push eax
call fcn.004b9d34
push dword [ebp - 0xb0]
mov byte [edi - 2], al
mov al, byte [edi - 1]
not al
movzx eax, al
push eax
call fcn.004b9d34
push dword [ebp - 0xb0]
mov byte [edi - 1], al
mov al, byte [edi]
not al
movzx eax, al
push eax
call fcn.004b9d34
mov byte [edi], al
add esp, 0x18
mov eax, dword [esi]
add edi, ebx
inc edx
cmp edx, dword [eax]
jb 0x4b9638
jmp 0x4b994a
call edx
jmp 0x4b9542
mov ecx, edx
cmp dword [eax], edx
jbe 0x4b994a
inc edi
mov eax, dword [ebp - 0x14]
mov al, byte [ecx + eax]
mov byte [edi + 1], al
mov byte [edi], al
mov byte [edi - 1], al
mov byte [edi + 2], 0xff
add edi, ebx
mov eax, dword [esi]
inc ecx
cmp ecx, dword [eax]
jb 0x4b96aa
jmp 0x4b994a
cmp dword [ebp - 0xc4], 0
je 0x4b97ba
mov eax, dword [eax]
mov dword [ebp - 0x9c], edx
cmp ebx, 1
jne 0x4b974d
test eax, eax
je 0x4b9950
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
sub eax, edx
mov dword [ebp - 0xa4], eax
mov eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0xa4]
sub eax, edx
mov dword [ebp - 0xa8], eax
sub edi, edx
movzx eax, byte [eax + edx]
imul ecx, eax, 0x4d
movzx eax, byte [ebx + edx]
imul eax, eax, 0x1d
add ecx, eax
movzx eax, byte [edx]
imul eax, eax, 0x96
add ecx, eax
shr ecx, 8
mov byte [edi + edx], cl
mov eax, dword [esi]
mov ecx, dword [ebp - 0x9c]
inc ecx
inc edx
mov dword [ebp - 0x9c], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xa8]
jb 0x4b970d
jmp 0x4b9944
test eax, eax
je 0x4b9950
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
sub eax, edx
mov dword [ebp - 0xa4], eax
mov eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0xa4]
sub eax, edx
mov dword [ebp - 0xa8], eax
movzx eax, byte [eax + edx]
imul ecx, eax, 0x4d
movzx eax, byte [ebx + edx]
imul eax, eax, 0x1d
add ecx, eax
movzx eax, byte [edx]
imul eax, eax, 0x96
mov byte [edi + 1], 0xff
add ecx, eax
shr ecx, 8
mov byte [edi], cl
lea edi, [edi + 2]
mov eax, dword [esi]
mov ecx, dword [ebp - 0x9c]
inc ecx
inc edx
mov dword [ebp - 0x9c], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xa8]
jb 0x4b9774
jmp 0x4b9944
cmp dword [eax + 8], 4
jne 0x4b9909
mov ecx, dword [esi + 0x47e8]
test ecx, ecx
jne 0x4b98b0
mov dword [ebp - 0x9c], edx
cmp dword [eax], edx
jbe 0x4b994a
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
sub edx, ecx
mov dword [ebp - 0xa4], edx
sub eax, ecx
mov edx, dword [ebp - 0x14]
sub edx, ecx
mov dword [ebp - 0xa0], ecx
mov dword [ebp - 0xa8], eax
mov dword [ebp - 0xac], edx
mov al, byte [eax + ecx]
mov byte [ebp - 0xb4], al
push dword [ebp - 0xb4]
movzx eax, byte [edx + ecx]
push eax
call fcn.004b9d34
mov ecx, dword [ebp - 0xa4]
push dword [ebp - 0xb4]
movzx eax, al
imul edx, eax, 0x4d
mov eax, dword [ebp - 0xa0]
movzx eax, byte [ecx + eax]
push eax
call fcn.004b9d34
push dword [ebp - 0xb4]
movzx eax, al
imul eax, eax, 0x96
add edx, eax
mov eax, dword [ebp - 0xa0]
movzx eax, byte [eax]
push eax
call fcn.004b9d34
mov ecx, dword [ebp - 0xa0]
add esp, 0x18
movzx eax, al
imul eax, eax, 0x1d
mov byte [edi + 1], 0xff
add edx, eax
shr edx, 8
mov byte [edi], dl
add edi, ebx
mov eax, dword [esi]
mov edx, dword [ebp - 0x9c]
inc edx
inc ecx
mov dword [ebp - 0x9c], edx
cmp edx, dword [eax]
mov eax, dword [ebp - 0xa8]
mov edx, dword [ebp - 0xac]
mov dword [ebp - 0xa0], ecx
jb 0x4b980a
jmp 0x4b994a
cmp ecx, 2
jne 0x4b9909
mov dword [ebp - 0x9c], edx
cmp dword [eax], edx
jbe 0x4b994a
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x14]
sub eax, edx
mov dword [ebp - 0xa4], eax
movzx eax, byte [eax + edx]
push eax
mov al, byte [edx]
not al
movzx eax, al
push eax
call fcn.004b9d34
mov byte [edi], al
pop ecx
mov byte [edi + 1], 0xff
add edi, ebx
mov eax, dword [esi]
pop ecx
mov ecx, dword [ebp - 0x9c]
inc ecx
inc edx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xa4]
mov dword [ebp - 0x9c], ecx
jb 0x4b98d1
jmp 0x4b994a
mov eax, dword [eax]
cmp ebx, 1
jne 0x4b9928
test eax, eax
je 0x4b994a
mov ecx, dword [ebp - 0x14]
sub ecx, edi
mov al, byte [ecx + edi]
inc edx
mov byte [edi], al
inc edi
mov eax, dword [esi]
cmp edx, dword [eax]
jb 0x4b9919
jmp 0x4b994a
mov ecx, edx
test eax, eax
je 0x4b994a
mov ebx, dword [ebp - 0x14]
mov al, byte [ecx + ebx]
inc ecx
mov byte [edi], al
lea edi, [edi + 2]
mov byte [edi - 1], 0xff
mov eax, dword [esi]
cmp ecx, dword [eax]
jb 0x4b9931
mov ebx, dword [ebp - 0xb8]
mov ecx, dword [ebp - 0x98]
mov eax, dword [esi]
inc ecx
mov edx, dword [ebp - 0xd0]
mov dword [ebp - 0x98], ecx
cmp ecx, dword [eax + 4]
jb 0x4b93bc
push esi
call fcn.004bb18f
mov eax, dword [esi]
pop ecx
mov ecx, dword [ebp - 0xd4]
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [esi]
mov ecx, dword [ebp - 0xd8]
mov eax, dword [eax + 4]
mov dword [ecx], eax
mov ecx, dword [ebp - 0xdc]
test ecx, ecx
je 0x4b99a2
mov eax, dword [esi]
push 3
pop edx
push 1
cmp dword [eax + 8], edx
pop eax
cmovge eax, edx
mov dword [ecx], eax
mov eax, dword [ebp - 0xd0]
jmp 0x4b99ce
push esi
call fcn.004bb18f
pop ecx
jmp 0x4b99cc
mov ecx, dword [0x5da1ac]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.bad_req_comp
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004cc144
leave
ret