Function at 0x57f230
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x3c
mov dword [esp + 0xc], edx
mov dword [esp], ecx
mov ebp, dword [esp + 0x5c]
mov ebx, dword [esp + 0x58]
mov eax, dword [esp + 0x68]
xor edi, edi
test eax, eax
cmovle eax, edi
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x6c]
mov al, 1
mov dword [esp + 4], eax
test dl, 0x40
jne 0x57f282
test ebp, ebp
js 0x57f28c
test dl, 2
jne 0x57f2a9
mov ecx, edx
and ecx, 4
sete al
mov dword [esp + 4], eax
shl ecx, 3
mov dword [esp + 8], ecx
jmp 0x57f2b9
mov dword [esp + 8], 0
jmp 0x57f2b9
mov dword [esp + 4], 0
neg ebx
mov eax, 0
sbb eax, ebp
mov dword [esp + 8], 0x2d
mov ebp, eax
jmp 0x57f2b9
mov dword [esp + 8], 0x2b
mov dword [esp + 4], 0
mov esi, dword [esp + 0x60]
cmp esi, 8
mov eax, 0x9c8070
mov ecx, 0x9c806f
cmove ecx, eax
cmp esi, 0x10
mov eax, 0x9c8072
cmovne eax, ecx
mov dword [esp + 0x10], eax
test dl, 0x20
mov eax, str.0123456789abcdef
mov ecx, 0x9c8075
cmove ecx, eax
mov dword [esp + 0x18], ecx
mov edx, ebp
nop word cs:[eax + eax]
mov dword [esp + 0x1c], edi
push 0
mov ebp, dword [esp + 0x64]
push ebp
push edx
push ebx
mov edi, edx
call fcn.00788230
add esp, 0x10
mov ecx, eax
imul ecx, ebp
mov esi, ebx
sub esi, ecx
cmp ebx, ebp
mov ebp, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
movzx ecx, byte [ecx + esi]
mov byte [esp + ebp + 0x22], cl
sbb edi, 0
lea ecx, [ebp + 1]
jb 0x57f343
mov ebx, eax
cmp ebp, 0x19
mov edi, ecx
jb 0x57f300
mov eax, dword [esp + 0x6c]
test al, 8
mov eax, 0x9c806f
mov edx, dword [esp + 0x10]
cmove edx, eax
lea ebp, [ecx - 1]
cmp ecx, 0x1a
cmovne ebp, ecx
mov byte [esp + ebp + 0x22], 0
mov edi, dword [esp + 0x14]
mov esi, edi
sub esi, ebp
cmovle edi, ebp
mov eax, dword [esp + 4]
mov ebx, eax
xor bl, 1
mov dword [esp + 0x10], edx
push edx
call sub.api_ms_win_crt_string_l1_1_0.dll_strlen
add esp, 4
movzx ecx, bl
mov edx, dword [esp + 0x64]
sub edx, ecx
add eax, edi
sub edx, eax
xor eax, eax
test esi, esi
cmovle esi, eax
test edx, edx
cmovle edx, eax
cmp esi, edx
mov edi, edx
cmova edi, esi
mov ecx, dword [esp + 0x6c]
test cl, 0x10
cmovne edx, eax
cmove edi, esi
mov esi, edx
neg esi
test cl, 1
cmove esi, edx
test esi, esi
jle 0x57f400
inc esi
mov ebx, dword [esp + 0xc]
nop word cs:[eax + eax]
mov ecx, dword [esp]
mov edx, ebx
push 0x20
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.0057f130
add esp, 0xc
test eax, eax
je 0x57f4fe
dec esi
cmp esi, 1
jg 0x57f3d0
xor esi, esi
cmp byte [esp + 4], 0
je 0x57f40b
jmp 0x57f42c
mov ebx, dword [esp + 0xc]
cmp byte [esp + 4], 0
jne 0x57f42c
mov ecx, dword [esp]
mov edx, ebx
push dword [esp + 8]
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.0057f130
add esp, 0xc
test eax, eax
je 0x57f4fe
mov ebx, dword [esp + 0x10]
movzx eax, byte [ebx]
test al, al
je 0x57f46b
inc ebx
nop dword [eax + eax]
movsx eax, al
mov ecx, dword [esp]
mov edx, dword [esp + 0xc]
push eax
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.0057f130
add esp, 0xc
test eax, eax
je 0x57f4fe
movzx eax, byte [ebx]
inc ebx
test al, al
jne 0x57f440
test edi, edi
mov ebx, dword [esp + 0xc]
je 0x57f4d0
inc edi
nop word cs:[eax + eax]
mov ecx, dword [esp]
mov edx, ebx
push 0x30
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.0057f130
add esp, 0xc
test eax, eax
je 0x57f4fe
dec edi
cmp edi, 1
jg 0x57f480
jmp 0x57f4d0
movsx eax, byte [esp + ebp + 0x21]
dec ebp
mov ecx, dword [esp]
mov edx, ebx
push eax
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.0057f130
add esp, 0xc
test eax, eax
je 0x57f4fe
test ebp, ebp
jg 0x57f4b0
mov eax, 1
test esi, esi
jns 0x57f500
jmp 0x57f4e3
inc esi
je 0x57f508
mov ecx, dword [esp]
mov edx, ebx
push 0x20
push dword [esp + 0x58]
push dword [esp + 0x58]
call fcn.0057f130
add esp, 0xc
test eax, eax
jne 0x57f4e0
xor eax, eax
add esp, 0x3c
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, 1
jmp 0x57f500