Function at 0x100056e0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push esi
mov esi, dword [ebp + 8]
mov eax, ecx
mov dword [ebp - 4], eax
push edi
mov edi, dword [ebp + 0x10]
cmp esi, 4
je 0x10005ad1
push ebx
test esi, esi
js 0x10005aaa
mov ebx, dword [ebp + 0xc]
test ebx, ebx
js 0x10005aaa
mov ecx, ebx
jne 0x1000571c
imul ecx, esi
mov dword [ebp - 0xc], ecx
jmp 0x10005733
xor edx, edx
imul ecx, esi
mov eax, 0x7fffffff
div ebx
mov dword [ebp - 0xc], ecx
cmp esi, eax
jg 0x10005aaa
test ecx, ecx
js 0x10005aaa
test edi, edi
js 0x10005aaa
je 0x10005756
xor edx, edx
mov eax, 0x7fffffff
div edi
cmp ecx, eax
jg 0x10005aaa
mov eax, ecx
imul eax, edi
push eax
call fcn.100407a7
add esp, 4
mov dword [ebp - 0x14], eax
test eax, eax
je 0x10005aaa
mov dword [ebp + 8], 0
test edi, edi
jle 0x10005a60
lea ecx, [ebx*4]
mov dword [ebp - 0x10], eax
add esi, 0x16
mov dword [ebp - 0x40], ecx
mov ecx, dword [ebp - 4]
lea edi, [ebx - 1]
mov dword [ebp - 0x18], esi
mov dword [ebp - 8], ecx
nop word [eax + eax]
mov esi, ecx
mov dword [ebp - 0x3c], edi
mov ecx, dword [ebp - 0x18]
mov edx, edi
mov dword [ebp - 0x38], edi
mov ebx, edi
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], edi
cmp ecx, 0x19
ja case.0x100057d4.3
movzx ecx, byte [ecx + 0x10005b0c]
jmp dword [ecx*4 + 0x10005ad8]
test edi, edi
js 0x100057f3
nop
sub edi, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 1]
mov byte [eax + 1], 0xff
lea eax, [eax + 2]
jns 0x100057e0
mov edi, dword [ebp + 0xc]
dec edi
jmp 0x10005a3e
mov edi, ebx
test ebx, ebx
js 0x10005a3e
sub ebx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 1]
mov byte [eax + 1], cl
lea eax, [eax + 3]
mov byte [eax - 3], cl
jns 0x10005806
jmp 0x10005a3e
mov edx, dword [ebp - 0x1c]
mov edi, edx
test edx, edx
js 0x10005a3e
nop
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 1]
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
mov byte [eax - 1], 0xff
jns 0x10005830
jmp 0x10005a3e
mov edi, edx
test edx, edx
js 0x10005a3e
nop dword [eax]
sub edx, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 2]
lea eax, [eax + 1]
jns 0x10005860
jmp 0x10005a3e
mov edx, dword [ebp - 0x20]
mov edi, edx
test edx, edx
js 0x10005a3e
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 2]
mov byte [eax + 1], cl
lea eax, [eax + 3]
mov byte [eax - 3], cl
jns 0x10005881
jmp 0x10005a3e
mov edx, dword [ebp - 0x24]
mov edi, edx
test edx, edx
js 0x10005a3e
nop dword [eax]
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 2]
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
movzx ecx, byte [esi - 1]
mov byte [eax - 1], cl
jns 0x100058b0
jmp 0x10005a3e
mov edx, dword [ebp - 0x28]
mov edi, edx
test edx, edx
js 0x10005a3e
nop
sub edx, 1
movzx ecx, byte [esi]
mov byte [eax], cl
lea esi, [esi + 3]
movzx ecx, byte [esi - 2]
lea eax, [eax + 4]
mov byte [eax - 3], cl
movzx ecx, byte [esi - 1]
mov byte [eax - 2], cl
mov byte [eax - 1], 0xff
jns 0x100058e0
jmp 0x10005a3e
mov ebx, dword [ebp - 0x2c]
mov edi, ebx
test ebx, ebx
js 0x10005a3e
nop dword [eax]
nop dword [eax + eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 3]
imul edx, ecx, 0x96
lea eax, [eax + 1]
movzx ecx, byte [esi - 1]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 3]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub ebx, 1
mov byte [eax - 1], dl
jns 0x10005920
jmp 0x10005a3e
mov ebx, dword [ebp - 0x30]
mov edi, ebx
test ebx, ebx
js 0x10005a3e
nop
movzx ecx, byte [esi + 1]
lea esi, [esi + 3]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, byte [esi - 1]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 3]
imul ecx, ecx, 0x4d
mov byte [eax - 1], 0xff
add edx, ecx
shr edx, 8
sub ebx, 1
mov byte [eax - 2], dl
jns 0x10005960
jmp 0x10005a3e
mov ebx, dword [ebp - 0x34]
mov edi, ebx
test ebx, ebx
js 0x10005a3e
movzx ecx, byte [esi + 1]
lea esi, [esi + 4]
imul edx, ecx, 0x96
lea eax, [eax + 1]
movzx ecx, byte [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 4]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub ebx, 1
mov byte [eax - 1], dl
jns 0x100059a3
jmp 0x10005a3e
mov ebx, dword [ebp - 0x38]
mov edi, ebx
test ebx, ebx
js 0x10005a3e
nop dword [eax + eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 4]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, byte [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 4]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub ebx, 1
mov byte [eax - 2], dl
mov cl, byte [esi - 1]
mov byte [eax - 1], cl
jns 0x100059e0
jmp 0x10005a3e
mov edx, dword [ebp - 0x3c]
mov edi, edx
test edx, edx
js 0x10005a3e
nop
sub edx, 1
movzx ecx, byte [esi]
mov byte [eax], cl
lea esi, [esi + 4]
movzx ecx, byte [esi - 3]
lea eax, [eax + 3]
mov byte [eax - 2], cl
movzx ecx, byte [esi - 2]
mov byte [eax - 1], cl
jns 0x10005a20
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 8]
inc edx
mov eax, dword [ebp - 0x10]
add ecx, dword [ebp - 0x40]
add eax, dword [ebp - 0xc]
mov dword [ebp + 8], edx
mov dword [ebp - 8], ecx
mov dword [ebp - 0x10], eax
cmp edx, dword [ebp + 0x10]
jl 0x100057a0
push dword [ebp - 4]
call fcn.1003fee1
mov eax, dword [ebp - 0x14]
add esp, 4
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push dword [ebp - 4]
call fcn.1003fee1
push dword [ebp - 0x14]
call fcn.1003fee1
mov ecx, dword [0x100a5f54]
add esp, 8
mov eax, dword fs:[0x2c]
pop ebx
mov eax, dword [eax + ecx*4]
pop edi
pop esi
mov dword [eax + 0xc], str.unsupported
xor eax, eax
mov esp, ebp
pop ebp
ret
push dword [ebp - 4]
call fcn.1003fee1
mov ecx, dword [0x100a5f54]
add esp, 4
mov eax, dword fs:[0x2c]
pop ebx
mov eax, dword [eax + ecx*4]
mov dword [eax + 0xc], str.outofmem
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret