Function at 0x10002070
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x68
mov edi, dword [esp + 0x80]
mov esi, dword [esp + 0x7c]
mov bl, 1
cmp edx, 0x101
mov eax, edx
jb 0x100020b1
mov ebx, 0xff
lea eax, [ebx + 1]
cmp eax, edx
jae 0x100020a1
cmp byte [ecx + ebx + 1], 0xbf
jg 0x100020af
mov eax, ebx
sub eax, 1
jb 0x100020ae
cmp edx, ebx
mov ebx, eax
jne 0x10002093
inc eax
xor ebx, ebx
mov dword [esp + 0x54], ecx
mov dword [esp + 0x58], eax
mov eax, str.formatter_errorfailed_to_write_whole_buffer
mov ebp, 0x102ccd56
test bl, bl
cmovne ebp, eax
xor bl, 1
cmp esi, edx
movzx eax, bl
mov dword [esp + 0x5c], ebp
lea eax, [eax + eax*4]
mov dword [esp + 0x60], eax
ja 0x10002156
cmp edi, edx
ja 0x10002156
cmp esi, edi
jbe 0x100021c9
lea eax, [esp + 0x7c]
lea edx, [esp + 0x80]
lea ecx, [esp + 0x54]
mov dword [esp + 0x14], 0x102ccd74
mov dword [esp + 0x18], 4
mov dword [esp + 0x1c], 0
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], fcn.10001730
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], fcn.10001730
mov dword [esp + 0x3c], ecx
lea ecx, [esp + 0x2c]
lea edx, [esp + 0x5c]
mov dword [esp + 0x40], 0x10002390
mov dword [esp + 0x44], edx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x48], 0x10002390
mov dword [esp + 0x28], 4
jmp 0x100021b7
cmp esi, edx
lea eax, [esp + 0xc]
lea ecx, [esp + 0x54]
lea edx, [esp + 0x5c]
mov dword [esp + 0x14], 0x102ccd5c
mov dword [esp + 0x18], 3
mov dword [esp + 0x1c], 0
cmova edi, esi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], fcn.10001730
mov dword [esp + 0x34], ecx
lea ecx, [esp + 0x2c]
mov dword [esp + 0x38], 0x10002390
mov dword [esp + 0x3c], edx
mov dword [esp + 0x40], 0x10002390
mov dword [esp + 0x24], ecx
mov dword [esp + 0xc], edi
mov dword [esp + 0x28], 3
mov edx, dword [esp + 0x84]
lea ecx, [esp + 0x14]
call fcn.10001830
ud2
test esi, esi
je 0x100021d9
cmp edx, esi
je 0x100021d9
jbe 0x100021db
cmp byte [ecx + esi], 0xc0
jl 0x100021db
mov esi, edi
test esi, esi
mov dword [esp + 0x64], esi
je 0x10002204
cmp esi, edx
je 0x10002204
lea eax, [edx + 1]
cmp esi, edx
jae 0x100021f4
cmp byte [ecx + esi], 0xc0
jge 0x10002229
lea edi, [esi - 1]
cmp esi, 1
je 0x10002206
cmp eax, esi
mov esi, edi
jne 0x100021ea
jmp 0x10002206
mov edi, esi
mov ebp, esp
mov esi, edi
cmp esi, edx
jne 0x1000222f
mov ecx, 0x102cf0e4
mov edx, 0x2b
push dword [esp + 0x84]
call fcn.10001670
add esp, 4
ud2
mov ebp, esp
cmp esi, edx
je 0x1000220e
lea edi, [ecx + esi]
mov al, byte [edi]
movzx ebx, al
test al, al
js 0x1000224c
mov dword [esp], ebx
lea eax, [esp + 0xc]
mov ecx, 1
jmp 0x100022fd
mov dword [esp + 8], ebp
add ecx, edx
lea ebp, [edi + 1]
xor edx, edx
cmp ebp, ecx
mov ebp, ecx
je 0x10002269
movzx edx, byte [edi + 1]
add edi, 2
mov ebp, edi
and edx, 0x3f
and ebx, 0x1f
cmp al, 0xdf
jbe 0x100022c0
xor edi, edi
cmp ebp, ecx
mov dword [esp + 4], ecx
je 0x10002286
movzx edi, byte [ebp]
inc ebp
mov dword [esp + 4], ebp
and edi, 0x3f
mov ebp, dword [esp + 8]
shl edx, 6
or edx, edi
cmp al, 0xf0
jb 0x100022c9
mov edi, dword [esp + 4]
xor eax, eax
cmp edi, ecx
je 0x100022a5
movzx eax, byte [edi]
mov ecx, edi
and eax, 0x3f
and ebx, 7
shl edx, 6
shl ebx, 0x12
or edx, ebx
or edx, eax
cmp edx, 0x110000
je 0x1000220e
jmp 0x100022ce
mov ebp, dword [esp + 8]
shl ebx, 6
jmp 0x100022cc
shl ebx, 0xc
or edx, ebx
lea eax, [esp + 0xc]
mov ecx, 1
cmp edx, 0x80
mov dword [esp], edx
jb 0x100022fd
mov ecx, 2
cmp edx, 0x800
jb 0x100022fd
cmp edx, 0x10000
mov ecx, 4
sbb ecx, 0
add ecx, esi
mov dword [esp + 0xc], esi
mov edx, dword [esp + 0x84]
mov dword [esp + 0x14], 0x102ccd94
mov dword [esp + 0x18], 5
lea esi, [esp + 0x5c]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x10], ecx
lea ecx, [esp + 0x64]
mov dword [esp + 0x2c], ecx
lea ecx, [esp + 0x54]
mov dword [esp + 0x30], fcn.10001730
mov dword [esp + 0x34], ebp
mov dword [esp + 0x38], 0x100023b0
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], 0x100026a0
mov dword [esp + 0x44], ecx
lea ecx, [esp + 0x2c]
mov dword [esp + 0x48], 0x10002390
mov dword [esp + 0x4c], esi
mov dword [esp + 0x50], 0x10002390
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x14]
mov dword [esp + 0x28], 5
call fcn.10001830
ud2