Function at 0x1036d210
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 8]
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x1c], esi
mov ecx, dword [esi + 0x20]
cmp eax, ecx
jne 0x1036d2bb
cmp eax, 3
jle 0x1036d2bb
mov dword [ebp - 4], 3
mov dword [ebp - 0x18], 0
xor edi, edi
push ebx
mov dword [ebp - 0x14], edi
lea ebx, [esi + 0x110]
nop
mov al, byte [ebx]
mov edx, dword [esi + 0xc]
mov ecx, dword [esi + 0x14]
shr edx, cl
mov byte [ebp + 0xb], al
movzx eax, al
mov dword [ebp - 0xc], eax
mov eax, edx
mov ecx, dword [ebp - 0xc]
and eax, 0xc0
movzx eax, byte [eax + ecx + 0x10b3ceb0]
mov ecx, dword [esi + 0x14]
sub edx, eax
mov dword [ebp - 8], edx
shl dword [ebp - 8], cl
mov ecx, dword [esi + 0x10]
mov dword [ebp - 0x10], ecx
mov ecx, dword [ebp - 8]
cmp dword [ebp - 0x10], ecx
jb 0x1036d2f8
mov edx, dword [ebp - 0x10]
sub edx, ecx
mov ecx, dword [esi + 0x14]
mov dword [esi + 0x10], edx
mov edx, eax
shl eax, cl
mov dword [esi + 0xc], eax
movzx ecx, byte [ebx + 1]
mov eax, dword [ebp - 0xc]
xor ecx, 1
mov dword [ebp - 8], ecx
test eax, eax
je 0x1036d2ee
mov al, byte [eax + 0x10b3ce30]
mov byte [ebx], al
jmp 0x1036d319
mov dword [ebp - 4], 2
cmp eax, ecx
jle 0x1036d23b
cmp dword [esi + 0x28], 0
mov dword [ebp - 4], 2
je 0x1036d23b
mov dword [ebp - 0x18], 1
mov dword [ebp - 4], 2
jmp 0x1036d242
mov al, byte [ebp + 0xb]
mov byte [ebx + 1], cl
mov byte [ebx], al
jmp 0x1036d319
mov dword [esi + 0xc], ecx
movzx eax, byte [ebx + 1]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0xc]
mov al, byte [eax + 0x10b3ce70]
mov byte [ebx], al
cmp edx, 0xff
jg 0x1036d3f2
mov eax, dword [esi + 0x14]
bsr ecx, edx
add eax, 0xfffffff8
add eax, ecx
mov dword [esi + 0x14], eax
jns 0x1036d3f2
mov edx, dword [esi + 4]
add eax, 0x10
shl dword [esi + 0xc], 0x10
mov ecx, dword [esi]
mov edi, dword [esi + 0x10]
mov dword [esi + 0x14], eax
mov eax, dword [esi + 8]
shl eax, 8
mov dword [ebp - 0x10], eax
lea eax, [edx + 2]
cmp eax, ecx
ja 0x1036d3b7
movzx ecx, byte [edx]
movzx edx, byte [edx + 1]
mov dword [ebp + 8], ecx
add ecx, dword [ebp - 0x10]
shl ecx, 8
mov dword [esi + 4], eax
mov esi, dword [ebp - 0x1c]
cmp ecx, 0x300
jne 0x1036d38d
mov ecx, edx
mov dword [ebp + 8], ecx
cmp eax, dword [esi]
jae 0x1036d384
movzx edx, byte [eax]
inc eax
shl ecx, 8
mov dword [esi + 4], eax
add ecx, edx
jmp 0x1036d3db
xor edx, edx
shl ecx, 8
add ecx, edx
jmp 0x1036d3db
and ecx, 0xffffff
add ecx, edx
cmp ecx, 3
jne 0x1036d3db
cmp eax, dword [esi]
jae 0x1036d3ad
movzx edx, byte [eax]
inc eax
mov dword [esi + 4], eax
lea ecx, [edx + 0x300]
jmp 0x1036d3db
xor edx, edx
lea ecx, [edx + 0x300]
jmp 0x1036d3db
cmp edx, ecx
jae 0x1036d3c0
movzx eax, byte [edx]
jmp 0x1036d3c2
xor eax, eax
mov dword [ebp - 0xc], eax
xor edx, edx
add eax, dword [ebp - 0x10]
mov dword [esi + 4], ecx
xor ecx, ecx
cmp eax, 3
mov eax, ecx
cmovne eax, dword [ebp - 0xc]
mov dword [ebp + 8], eax
shl edi, 8
add edi, dword [ebp + 8]
shl edi, 8
add edi, edx
movzx eax, cx
mov dword [esi + 0x10], edi
mov edi, dword [ebp - 0x14]
mov dword [esi + 8], eax
cmp dword [ebp - 8], 0
jne 0x1036d408
inc edi
add ebx, 2
mov dword [ebp - 0x14], edi
cmp edi, dword [ebp - 4]
jl 0x1036d250
cmp dword [ebp - 0x18], 0
pop ebx
je 0x1036d435
test edi, edi
je 0x1036d435
push 0xf
mov ecx, esi
call fcn.1036bf30
test eax, eax
jne 0x1036d435
mov ecx, esi
call fcn.1036c010
lea eax, [eax + edi*2]
pop edi
add eax, 2
pop esi
mov esp, ebp
pop ebp
ret 4
mov eax, edi
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4