Function at 0x406120
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x406458
sub esp, 0x3c
mov eax, dword [esp + 0x40]
mov edx, dword [eax + 0x18]
lea ebx, [eax + 0x18]
mov dword [esp + 0x38], ebx
test edx, edx
je 0x406438
mov ebp, dword [edx + 8]
lea esi, [edx + 8]
test ebp, ebp
je 0x406438
mov dword [esp + 0x34], esi
mov dword [esp + 0x30], ebp
mov edi, dword [esp + 0x44]
mov ecx, ebx
movzx ebx, word [edi + 0x34]
mov esi, ebp
lea ebp, [ebx + esi - 4]
test byte [edi], al
mov edi, dword [ebp]
add ebx, esi
test edi, edi
je 0x406409
mov edx, dword [0x728500]
test edx, edx
jne 0x4063ec
mov dword [ebp], 0
mov edx, dword [eax + 0x18]
test byte [edx], al
mov ebx, dword [0x728500]
lea ebp, [edx + 8]
test ebx, ebx
jne 0x4063cf
mov dword [edx + 8], 0
mov edx, dword [esp + 0x30]
movzx ebx, byte [eax + 5]
cmp bl, 0x10
jae 0x406378
movzx ebx, word [eax + 6]
inc ebx
mov word [eax + 6], bx
mov dword [esp + 0x24], edx
mov ebx, dword [esp + 0x44]
mov ebp, dword [ebx + 0x28]
movzx ebp, byte [ebp + 0xf]
xchg ebp, eax
test al, 0x80
xchg ebp, eax
je 0x40622c
mov ebp, dword [eax + 0x18]
test ebp, ebp
je 0x406332
mov ecx, dword [eax + 0x18]
mov ecx, dword [ecx]
test ecx, ecx
je 0x4062ec
mov eax, dword [eax + 0x18]
mov ecx, dword [eax]
test byte [eax], al
mov eax, dword [ecx + 8]
mov ebp, dword [ecx]
mov esi, dword [ecx + 4]
lea edi, [esi + 1]
cmp edi, eax
jg 0x406276
lea eax, [esi + 1]
mov dword [ecx + 4], eax
mov eax, dword [0x728500]
lea ecx, [ebp + esi*4]
test eax, eax
jne 0x406260
mov dword [ebp + esi*4], edx
movzx eax, word [ebx + 0x34]
mov ecx, dword [esp + 0x48]
lea eax, [ecx + eax - 4]
test byte [eax], al
mov ecx, dword [0x728500]
test ecx, ecx
jne 0x40624e
mov dword [eax], edx
mov dword [esp + 0x4c], edx
add esp, 0x3c
ret
mov dword [esp], eax
mov dword [esp + 4], edx
call dbg.runtime.writebarrierptr
mov edx, dword [esp + 0x24]
jmp 0x406246
mov dword [esp], ecx
mov dword [esp + 4], edx
call dbg.runtime.writebarrierptr
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x44]
jmp 0x40622c
mov dword [esp + 0x2c], ecx
lea ecx, [0x5c9b40]
mov dword [esp], ecx
mov dword [esp + 4], ebp
mov dword [esp + 8], esi
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], edi
call dbg.runtime.growslice
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x2c]
mov dword [ebx + 8], edx
mov edx, dword [0x728500]
test edx, edx
jne 0x4062ca
mov dword [ebx], eax
mov edx, dword [esp + 0x24]
mov esi, ecx
mov ebp, eax
mov ecx, ebx
mov ebx, dword [esp + 0x44]
jmp 0x406214
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], ecx
mov dword [esp], ebx
mov dword [esp + 4], eax
call dbg.runtime.writebarrierptr
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
jmp 0x4062b7
lea eax, [0x5afb60]
mov dword [esp], eax
call dbg.runtime.newobject
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 0x18]
test byte [ecx], al
mov edx, dword [0x728500]
mov ebx, dword [esp + 4]
test edx, edx
jne 0x406320
mov dword [ecx], ebx
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x44]
jmp 0x4061fe
mov dword [esp], ecx
mov dword [esp + 4], ebx
call dbg.runtime.writebarrierptr
mov eax, dword [esp + 0x40]
jmp 0x406313
lea eax, [0x5cdc60]
mov dword [esp], eax
call dbg.runtime.newobject
mov eax, dword [0x728500]
mov ecx, dword [esp + 4]
test eax, eax
jne 0x406362
mov eax, dword [esp + 0x40]
mov dword [eax + 0x18], ecx
mov edx, dword [esp + 0x24]
mov ebx, dword [esp + 0x44]
jmp 0x4061f1
mov eax, dword [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], ecx
call dbg.runtime.writebarrierptr
mov eax, dword [esp + 0x40]
jmp 0x406355
mov ebp, dword fs:[0x14]
mov ebp, dword [ebp]
mov ebp, dword [ebp + 0x18]
mov esi, dword [ebp + 0x8c]
mov edi, esi
sar esi, 0x1f
and esi, 0xa8888eef
shl edi, 1
xor edi, esi
mov dword [ebp + 0x8c], edi
add ebx, 0xfffffff1
mov ebp, ecx
mov ecx, ebx
mov esi, 1
shl esi, cl
cmp cl, 0x20
sbb ebx, ebx
and esi, ebx
lea ebx, [esi - 1]
test ebx, edi
jne 0x4063c8
movzx ecx, word [eax + 6]
inc ecx
mov word [eax + 6], cx
mov ecx, ebp
jmp 0x4061d0
mov dword [esp], ebp
mov dword [esp + 4], 0
call dbg.runtime.writebarrierptr
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
jmp 0x4061b6
mov dword [esp], ebp
mov dword [esp + 4], 0
call dbg.runtime.writebarrierptr
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
jmp 0x406199
mov ebp, dword [0x728500]
test ebp, ebp
jne 0x40641b
mov dword [edx + 8], ebx
jmp 0x4061b6
mov eax, dword [esp + 0x34]
mov dword [esp], eax
mov dword [esp + 4], ebx
call dbg.runtime.writebarrierptr
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
jmp 0x4061b6
mov eax, dword [esp + 0x44]
mov ecx, dword [eax + 0x28]
mov dword [esp], ecx
call dbg.runtime.newobject
mov edx, dword [esp + 4]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
jmp 0x4061ba
call dbg.runtime.morestack_noctxt
jmp dbg.runtime.(*hmap).newoverflow