Function at 0x4aa4fa
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd4
mov eax, dword [0x590700]
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 - 0xd0], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0xcc], eax
mov eax, dword [esi]
push edi
mov dword [ebp - 0xc4], esi
and dword [eax + 8], 0
cmp ebx, 4
ja 0x4aace2
push esi
call fcn.004ada36
pop ecx
test eax, eax
jne 0x4aa55c
push esi
call fcn.004ac1d3
jmp 0x4aacec
xor edi, edi
inc edi
push 3
pop edx
test ebx, ebx
jne 0x4aa573
mov eax, dword [esi]
mov ebx, edi
cmp dword [eax + 8], edx
cmovge ebx, edx
mov dword [ebp + 0x18], ebx
mov ecx, dword [esi]
mov eax, dword [ecx + 8]
mov dword [ebp - 0xb4], eax
cmp eax, edx
jne 0x4aa5a6
cmp dword [esi + 0x47ec], edx
je 0x4aa59c
cmp dword [esi + 0x47e8], 0
jne 0x4aa5a6
cmp dword [esi + 0x47e4], 0
jne 0x4aa5a6
mov edx, edi
mov dword [ebp - 0xbc], edi
jmp 0x4aa5ae
xor edx, edx
mov dword [ebp - 0xbc], edx
cmp eax, 3
jne 0x4aa5c3
cmp ebx, eax
jge 0x4aa5c3
test edx, edx
jne 0x4aa5c3
mov eax, edi
mov dword [ebp - 0xb4], edi
and dword [ebp - 0xac], 0
xorps xmm0, xmm0
movdqu xmmword [ebp - 0x14], xmm0
test eax, eax
jle 0x4aa6df
lea eax, [esi + 0x46a0]
lea edi, [ebp - 0x84]
mov dword [ebp - 0x9c], eax
mov eax, dword [ecx]
add eax, 3
push eax
call fcn.004b1485
pop ecx
mov ecx, dword [ebp - 0x9c]
mov dword [ecx + 0x34], eax
test eax, eax
je 0x4aa764
mov eax, dword [esi + 0x4684]
cdq
idiv dword [ecx]
and dword [edi + 0xc], 0
mov dword [ebp - 0xa0], eax
mov dword [edi - 4], eax
mov eax, dword [esi + 0x4688]
cdq
idiv dword [ecx + 4]
xor edx, edx
mov ecx, eax
mov dword [ebp - 0x98], eax
sar ecx, 1
mov dword [edi], eax
mov eax, dword [ebp - 0xa0]
mov dword [edi + 8], ecx
dec eax
mov ecx, dword [esi]
mov ecx, dword [ecx]
add eax, ecx
div dword [ebp - 0xa0]
mov ecx, dword [ebp - 0x9c]
mov edx, dword [ebp - 0xa0]
mov dword [edi + 4], eax
mov eax, dword [ecx + 0x28]
mov dword [edi - 8], eax
mov dword [edi - 0xc], eax
mov eax, dword [ebp - 0x98]
cmp edx, 1
jne 0x4aa68b
cmp eax, edx
jne 0x4aa67d
mov dword [edi - 0x10], 0x4aad00
jmp 0x4aa6b5
cmp eax, 2
jne 0x4aa68b
mov dword [edi - 0x10], 0x4b4ea2
jmp 0x4aa6b5
cmp edx, 2
jne 0x4aa6ae
cmp eax, 1
jne 0x4aa69e
mov dword [edi - 0x10], 0x4b4b96
jmp 0x4aa6b5
cmp eax, 2
jne 0x4aa6ae
mov eax, dword [esi + 0x4814]
mov dword [edi - 0x10], eax
jmp 0x4aa6b5
mov dword [edi - 0x10], 0x4b4b61
mov eax, dword [ebp - 0xac]
add ecx, 0x48
inc eax
mov dword [ebp - 0x9c], ecx
mov ecx, dword [esi]
add edi, 0x20
mov dword [ebp - 0xac], eax
cmp eax, dword [ebp - 0xb4]
jl 0x4aa5ec
xor edi, edi
inc edi
mov eax, dword [esi]
push edi
push dword [eax + 4]
push dword [eax]
push ebx
call fcn.004b14b9
add esp, 0x10
mov dword [ebp - 0xc8], eax
test eax, eax
je 0x4aa764
mov eax, dword [esi]
xor edx, edx
mov dword [ebp - 0x9c], edx
cmp dword [eax + 4], edx
jbe 0x4aaca3
mov ecx, dword [ebp - 0x14]
mov edi, dword [eax]
and dword [ebp - 0x98], 0
imul edi, edx
imul edi, ebx
add edi, dword [ebp - 0xc8]
cmp dword [ebp - 0xb4], 0
mov dword [ebp - 0xa8], edi
jle 0x4aa7f2
mov edi, dword [ebp - 0xb4]
lea eax, [esi + 0x46bc]
mov dword [ebp - 0xa0], eax
lea ebx, [ebp - 0x7c]
mov esi, eax
mov eax, dword [ebx - 8]
xor ecx, ecx
sar eax, 1
cmp dword [ebx], eax
setge cl
test ecx, ecx
je 0x4aa776
mov edx, dword [ebx - 0x14]
jmp 0x4aa779
push esi
call fcn.004ac1d3
mov dword [esp], str.outofmem
jmp 0x4aace7
mov edx, dword [ebx - 0x10]
test ecx, ecx
je 0x4aa782
mov eax, dword [ebx - 0x10]
jmp 0x4aa785
mov eax, dword [ebx - 0x14]
push dword [ebx - 0xc]
push dword [ebx - 4]
push edx
push eax
push dword [esi + 0x18]
call dword [ebx - 0x18]
mov edx, dword [ebp - 0x98]
add esp, 0x14
mov dword [ebp + edx*4 - 0x14], eax
mov eax, dword [ebx]
inc eax
mov dword [ebx], eax
cmp eax, dword [ebx - 8]
jl 0x4aa7c5
and dword [ebx], 0
inc dword [ebx + 4]
mov eax, dword [ebx + 4]
mov ecx, dword [ebx - 0x10]
mov dword [ebx - 0x14], ecx
cmp eax, dword [esi]
jge 0x4aa7c5
mov eax, dword [esi + 4]
add eax, ecx
mov dword [ebx - 0x10], eax
inc edx
add ebx, 0x20
add esi, 0x48
mov dword [ebp - 0x98], edx
cmp edx, edi
jl 0x4aa74f
mov esi, dword [ebp - 0xc4]
mov edi, dword [ebp - 0xa8]
mov ebx, dword [ebp + 0x18]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x9c]
mov eax, dword [esi]
cmp ebx, 3
jl 0x4aaa16
cmp dword [eax + 8], 3
jne 0x4aa890
cmp dword [ebp - 0xbc], 0
je 0x4aa875
and dword [ebp - 0xa0], 0
cmp dword [eax], 0
jbe 0x4aac8e
mov eax, dword [ebp - 0xc]
add edi, 2
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0xa8], ecx
sub ecx, dword [ebp - 0x10]
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0xa8], eax
mov al, byte [ecx + edx]
mov byte [edi - 2], al
mov al, byte [edx]
mov byte [edi - 1], al
mov eax, dword [ebp - 0xa8]
mov al, byte [eax + edx]
mov byte [edi], al
mov byte [edi + 1], 0xff
add edi, ebx
mov eax, dword [esi]
inc dword [ebp - 0xa0]
inc edx
mov esi, dword [ebp - 0xa0]
cmp esi, dword [eax]
mov esi, dword [ebp - 0xc4]
jb 0x4aa83b
jmp 0x4aac85
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 0x4aac85
cmp dword [eax + 8], 4
jne 0x4aa9df
mov edx, dword [esi + 0x47e8]
test edx, edx
jne 0x4aa951
and dword [ebp - 0x98], edx
cmp dword [eax], edx
jbe 0x4aac88
mov edx, dword [ebp - 0x14]
add edi, 2
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
sub ecx, edx
mov dword [ebp - 0xa0], ecx
sub eax, edx
mov ecx, dword [ebp - 0xc]
sub ecx, edx
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0xb0], ecx
mov al, byte [eax + edx]
mov byte [ebp - 0xc0], al
push dword [ebp - 0xc0]
movzx eax, byte [edx]
push eax
call fcn.004ab06f
push dword [ebp - 0xc0]
mov byte [edi - 2], al
mov eax, dword [ebp - 0xa0]
movzx eax, byte [eax + edx]
push eax
call fcn.004ab06f
push dword [ebp - 0xc0]
mov byte [edi - 1], al
mov eax, dword [ebp - 0xb0]
movzx eax, byte [eax + edx]
push eax
call fcn.004ab06f
mov ecx, dword [ebp - 0x98]
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 - 0x98], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xa4]
jb 0x4aa8dd
jmp 0x4aac85
push ebx
push dword [eax]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push edi
cmp edx, 2
jne 0x4aa882
call dword [esi + 0x4810]
mov eax, dword [esi]
xor edx, edx
add esp, 0x18
cmp dword [eax], edx
jbe 0x4aac85
add edi, 2
mov eax, dword [ebp - 8]
mov al, byte [edx + eax]
mov byte [ebp - 0xb8], al
or al, 0xff
sub al, byte [edi - 2]
push dword [ebp - 0xb8]
movzx eax, al
push eax
call fcn.004ab06f
push dword [ebp - 0xb8]
mov byte [edi - 2], al
or al, 0xff
sub al, byte [edi - 1]
movzx eax, al
push eax
call fcn.004ab06f
push dword [ebp - 0xb8]
mov byte [edi - 1], al
or al, 0xff
sub al, byte [edi]
movzx eax, al
push eax
call fcn.004ab06f
mov byte [edi], al
add esp, 0x18
mov eax, dword [esi]
add edi, ebx
inc edx
cmp edx, dword [eax]
jb 0x4aa97f
jmp 0x4aac85
and dword [ebp - 0xa4], 0
cmp dword [eax], 0
jbe 0x4aac8e
mov edx, dword [ebp - 0x14]
inc edi
mov ecx, dword [ebp - 0xa4]
mov al, byte [ecx + edx]
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 0x4aa9f9
jmp 0x4aac85
cmp dword [ebp - 0xbc], 0
je 0x4aaaef
and dword [ebp - 0x98], 0
cmp ebx, 1
jne 0x4aaa96
cmp dword [eax], 0
jbe 0x4aac8e
mov edx, dword [ebp - 0x10]
mov ebx, edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
sub eax, edx
sub ecx, edx
mov dword [ebp - 0xa4], eax
mov dword [ebp - 0xb0], ecx
sub edi, edx
movzx eax, byte [ebx + eax]
push eax
movzx eax, byte [ebx]
push eax
movzx eax, byte [ebx + ecx]
push eax
call fcn.004ac56a
mov ecx, dword [ebp - 0x98]
add esp, 0xc
mov byte [edi + ebx], al
inc ecx
mov eax, dword [esi]
inc ebx
mov dword [ebp - 0x98], ecx
cmp ecx, dword [eax]
mov eax, dword [ebp - 0xa4]
mov ecx, dword [ebp - 0xb0]
jb 0x4aaa55
mov ebx, dword [ebp + 0x18]
jmp 0x4aac85
cmp dword [eax], 0
jbe 0x4aac8e
mov eax, dword [ebp - 0x10]
mov edx, eax
mov ebx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
sub ebx, eax
sub ecx, eax
mov dword [ebp - 0xa4], ecx
movzx eax, byte [edx + ebx]
push eax
movzx eax, byte [edx]
push eax
movzx eax, byte [edx + ecx]
push eax
call fcn.004ac56a
mov ecx, dword [ebp - 0x98]
add esp, 0xc
mov byte [edi], al
inc ecx
mov byte [edi + 1], 0xff
lea edi, [edi + 2]
mov eax, dword [esi]
inc edx
mov dword [ebp - 0x98], ecx
cmp ecx, dword [eax]
mov ecx, dword [ebp - 0xa4]
jb 0x4aaab4
jmp 0x4aaa8e
cmp dword [eax + 8], 4
jne 0x4aac3e
cmp dword [esi + 0x47e8], 0
jne 0x4aabd9
and dword [ebp - 0x98], 0
cmp dword [eax], 0
jbe 0x4aac8e
mov eax, dword [ebp - 0xc]
mov ecx, eax
mov edx, dword [ebp - 8]
mov dword [ebp - 0xa0], eax
sub edx, eax
mov eax, dword [ebp - 0x10]
sub eax, ecx
mov dword [ebp - 0xa4], eax
mov eax, dword [ebp - 0x14]
sub eax, ecx
mov dword [ebp - 0xb0], eax
mov al, byte [edx + ecx]
mov byte [ebp - 0xac], al
push dword [ebp - 0xac]
movzx eax, byte [ecx]
push eax
call fcn.004ab06f
pop ecx
pop ecx
mov ecx, dword [ebp - 0xa0]
movzx eax, al
push eax
mov eax, dword [ebp - 0xa4]
push dword [ebp - 0xac]
movzx eax, byte [eax + ecx]
push eax
call fcn.004ab06f
pop ecx
pop ecx
mov ecx, dword [ebp - 0xa0]
movzx eax, al
push eax
mov eax, dword [ebp - 0xb0]
push dword [ebp - 0xac]
movzx eax, byte [eax + ecx]
push eax
call fcn.004ab06f
pop ecx
pop ecx
movzx eax, al
push eax
call fcn.004ac56a
mov ecx, dword [ebp - 0xa0]
add esp, 0xc
mov byte [edi], al
mov byte [edi + 1], 0xff
add edi, ebx
inc dword [ebp - 0x98]
inc ecx
mov eax, dword [esi]
mov ebx, dword [ebp - 0x98]
mov dword [ebp - 0xa0], ecx
cmp ebx, dword [eax]
mov ebx, dword [ebp + 0x18]
jb 0x4aab3c
jmp 0x4aac85
cmp dword [eax + 8], 4
jne 0x4aac3e
cmp dword [esi + 0x47e8], 2
jne 0x4aac3e
and dword [ebp - 0x98], 0
cmp dword [eax], 0
jbe 0x4aac8e
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x14]
sub ecx, edx
mov dword [ebp - 0xa4], ecx
movzx eax, byte [edx + ecx]
push eax
or al, 0xff
sub al, byte [edx]
movzx eax, al
push eax
call fcn.004ab06f
pop ecx
mov byte [edi], al
mov byte [edi + 1], 0xff
add edi, ebx
mov eax, dword [esi]
pop ecx
mov ecx, dword [ebp - 0x98]
inc ecx
inc edx
cmp ecx, dword [eax]
mov dword [ebp - 0x98], ecx
mov ecx, dword [ebp - 0xa4]
jb 0x4aac06
jmp 0x4aac85
cmp ebx, 1
jne 0x4aac5d
xor edx, edx
cmp dword [eax], edx
jbe 0x4aac88
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 0x4aac4e
jmp 0x4aac85
and dword [ebp - 0xa4], 0
cmp dword [eax], 0
jbe 0x4aac8e
mov edx, dword [ebp - 0x14]
mov ecx, dword [ebp - 0xa4]
mov al, byte [ecx + edx]
inc ecx
mov byte [edi], al
lea edi, [edi + 2]
mov byte [edi - 1], 0xff
mov eax, dword [esi]
cmp ecx, dword [eax]
jb 0x4aac72
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x9c]
mov eax, dword [esi]
inc edx
mov dword [ebp - 0x9c], edx
cmp edx, dword [eax + 4]
jb 0x4aa710
xor edi, edi
inc edi
push esi
call fcn.004ac1d3
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 - 0xd0]
mov eax, dword [eax + 4]
mov dword [ecx], eax
mov ecx, dword [ebp - 0xcc]
test ecx, ecx
je 0x4aacda
mov eax, dword [esi]
push 3
pop edx
cmp dword [eax + 8], edx
cmovge edi, edx
mov dword [ecx], edi
mov eax, dword [ebp - 0xc8]
jmp 0x4aacef
push str.bad_req_comp
call fcn.004adcb3
xor eax, eax
pop ecx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00503ade
mov esp, ebp
pop ebp
ret