Function at 0x507dc0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [esp + 0x58]
test ebx, ebx
je 0x507fd3
cmp dword [esp + 0x58], 1
je 0x507f50
mov eax, dword [esp + 0x54]
mov ecx, dword [eax]
movzx eax, byte [ecx]
test al, al
je 0x507e15
cmp al, 0xff
mov esi, dword [esp + 0x58]
jne 0x507f55
xor ebx, ebx
mov edx, 1
mov edi, esi
movzx esi, byte [ecx + edx]
add edx, 1
or ebx, esi
cmp edi, edx
ja 0x507e00
test ebx, ebx
je 0x5080c2
movzx edx, byte [ecx + 1]
and eax, 0xffffff80
and edx, 0xffffff80
cmp al, dl
je 0x5080e0
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x58]
test ecx, ecx
lea esi, [eax - 1]
jne 0x507f61
lea esi, [esi]
call sym._ASN1_INTEGER_new
test eax, eax
mov ebx, eax
je 0x507fc7
mov dword [eax + 4], 2
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._ASN1_STRING_set
test eax, eax
je 0x508085
mov eax, dword [esp + 0x54]
mov ebp, dword [ebx + 8]
mov edi, dword [eax]
movzx eax, byte [edi]
mov byte [esp + 0x2b], al
and eax, 0xffffff80
cmp dword [esp + 0x58], 1
mov esi, eax
je 0x508064
movzx eax, byte [esp + 0x2b]
test al, al
jne 0x508010
movzx eax, byte [edi + 1]
mov ecx, esi
and eax, 0xffffff80
cmp cl, al
je 0x508113
mov eax, dword [esp + 0x58]
lea ecx, [eax - 1]
test ebp, ebp
je 0x507f16
movsx eax, byte [esp + 0x2b]
add edi, dword [esp + 0x58]
lea esi, [ebp + ecx]
mov edx, eax
shr eax, 0x1f
sar dl, 7
mov byte [esp + 0x2c], dl
lea edx, [ecx - 1]
neg ecx
add edi, ecx
mov ebp, ecx
movzx ecx, byte [esp + 0x2c]
mov dword [esp + 0x2c], ebx
lea esi, [esi]
lea edi, [edi]
movzx ebx, byte [edi + edx]
xor ebx, ecx
movzx ebx, bl
add eax, ebx
lea ebx, [esi + ebp]
mov byte [ebx + edx], al
sub edx, 1
shr eax, 8
cmp edx, 0xffffffff
jne 0x507ef0
mov eax, dword [esp + 0x54]
mov ebx, dword [esp + 0x2c]
mov edi, dword [eax]
cmp byte [esp + 0x2b], 0
jns 0x507f24
or dword [ebx + 4], 0x100
add edi, dword [esp + 0x58]
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x54]
test edx, edx
mov dword [eax], edi
je 0x507fc9
mov eax, dword [esp + 0x50]
mov dword [eax], ebx
add esp, 0x3c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, 1
mov ecx, dword [esp + 0x50]
test ecx, ecx
je 0x507e40
mov eax, dword [esp + 0x50]
mov ebx, dword [eax]
test ebx, ebx
je 0x507e40
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], ebx
call sym._ASN1_STRING_set
test eax, eax
jne 0x507e72
mov dword [esp + 0x10], 0x139
mov dword [esp + 0xc], str.crypto_asn1_a_int.c
mov dword [esp + 8], 0x41
mov dword [esp + 4], 0xc2
mov dword [esp], 0xd
call sym._ERR_put_error
mov eax, dword [esp + 0x50]
cmp dword [eax], ebx
je 0x507fc7
mov dword [esp], ebx
call sym._ASN1_INTEGER_free
xor ebx, ebx
add esp, 0x3c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x10], 0x9a
mov dword [esp + 0xc], str.crypto_asn1_a_int.c
xor ebx, ebx
mov dword [esp + 8], 0xde
mov dword [esp + 4], 0xe2
mov dword [esp], 0xd
call sym._ERR_put_error
add esp, 0x3c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
cmp al, 0xff
mov ecx, dword [esp + 0x58]
jne 0x507eb7
xor ecx, ecx
mov eax, 1
movzx edx, byte [edi + eax]
add eax, 1
or ecx, edx
cmp dword [esp + 0x58], eax
ja 0x508023
test ecx, ecx
jne 0x507e9f
test ebp, ebp
je 0x507f1d
mov eax, dword [esp + 0x58]
mov esi, dword [esp + 0x58]
add edi, dword [esp + 0x58]
mov byte [esp + 0x2c], 0xff
lea edx, [eax - 1]
mov ecx, eax
add esi, ebp
mov eax, 1
jmp 0x507ed7
test ebp, ebp
je 0x507f16
movzx eax, byte [esp + 0x2b]
test al, al
jns 0x5080d0
neg eax
mov byte [ebp], al
mov eax, dword [esp + 0x54]
mov edi, dword [eax]
jmp 0x507f1d
mov dword [esp + 0x10], 0x139
mov dword [esp + 0xc], str.crypto_asn1_a_int.c
mov dword [esp + 8], 0x41
mov dword [esp + 4], 0xc2
mov dword [esp], 0xd
call sym._ERR_put_error
mov eax, dword [esp + 0x50]
test eax, eax
je 0x507fbf
jmp 0x507fb7
mov esi, dword [esp + 0x58]
jmp 0x507f55
mov byte [ebp], al
mov eax, dword [esp + 0x54]
mov edi, dword [eax]
jmp 0x507f24
mov dword [esp + 0x10], 0xbb
mov dword [esp + 0xc], str.crypto_asn1_a_int.c
xor ebx, ebx
mov dword [esp + 8], 0xdd
mov dword [esp + 4], 0xe2
mov dword [esp], 0xd
call sym._ERR_put_error
jmp 0x507fc9
mov dword [esp + 0x10], 0xbb
mov dword [esp + 0xc], str.crypto_asn1_a_int.c
mov dword [esp + 8], 0xdd
mov dword [esp + 4], 0xe2
mov dword [esp], 0xd
call sym._ERR_put_error
mov eax, dword [esp + 0x54]
mov edi, dword [eax]
jmp 0x507f16