Function at 0x4121c0
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x20
push ebx
mov ebx, dword [esp + 0x28]
push ebp
push esi
mov eax, dword [ebx + 4]
push edi
test eax, eax
mov edi, ecx
je 0x4121e2
mov esi, dword [ebx + 8]
sub esi, eax
sar esi, 4
mov dword [esp + 0x14], esi
jne 0x4121f1
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x20
ret 4
lea ebp, [esi*8]
mov eax, 0x51eb851f
mul ebp
shr edx, 5
lea eax, [edx + ebp + 8]
mov dword [esp + 0x10], eax
mov eax, dword [edi + 0x494]
cmp eax, ebp
jae 0x412257
mov eax, dword [edi + 0x490]
test eax, eax
je 0x412231
push eax
call fcn.00449d1e
add esp, 4
mov dword [edi + 0x490], 0
lea ecx, [ebp + 1]
push ecx
call fcn.00449d10
add esp, 4
mov dword [edi + 0x490], eax
test eax, eax
jne 0x412251
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
mov dword [edi + 0x494], ebp
mov ecx, dword [ebx + 4]
mov eax, dword [ebx + 8]
mov ebp, dword [edi + 0x490]
cmp ecx, eax
je 0x41231e
mov ebx, dword [ecx]
mov edx, dword [edi + 4]
mov esi, dword [edi + 0x46c]
mov eax, ebx
sub eax, edx
xor edx, edx
div esi
add ecx, 0x10
add ebp, 8
mov edx, eax
shl edx, 8
shr eax, 8
xor al, dl
and eax, 0xff
xor eax, edx
mov edx, dword [edi + 8]
mov word [esp + 0x1c], ax
mov eax, dword [ecx - 0xc]
sub eax, edx
xor edx, edx
div esi
mov edx, eax
shl edx, 8
shr eax, 8
xor al, dl
and eax, 0xff
xor eax, edx
xor edx, edx
mov word [esp + 0x1e], ax
mov eax, dword [ecx - 8]
sub eax, ebx
div esi
mov edx, eax
shl edx, 8
shr eax, 8
xor al, dl
and eax, 0xff
xor eax, edx
mov edx, dword [ecx - 0xc]
mov word [esp + 0x20], ax
mov eax, dword [ecx - 4]
sub eax, edx
xor edx, edx
div esi
mov esi, eax
mov edx, esi
shl edx, 8
shr eax, 8
xor al, dl
and eax, 0xff
xor eax, edx
mov edx, dword [esp + 0x1c]
mov word [esp + 0x22], ax
mov eax, dword [esp + 0x20]
mov dword [ebp - 8], edx
mov edx, dword [esp + 0x34]
mov dword [ebp - 4], eax
cmp ecx, dword [edx + 8]
jne 0x41226b
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
mov ecx, dword [edi + 0x48c]
xor ebx, ebx
cmp ecx, eax
jae 0x412375
mov eax, dword [edi + 0x488]
cmp eax, ebx
je 0x412347
push eax
call fcn.00449d1e
add esp, 4
mov dword [edi + 0x488], ebx
mov ecx, dword [esp + 0x10]
inc ecx
push ecx
call fcn.00449d10
add esp, 4
cmp eax, ebx
mov dword [edi + 0x488], eax
jne 0x41236b
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret 4
mov edx, dword [esp + 0x10]
mov dword [edi + 0x48c], edx
mov edx, dword [edi + 0x488]
lea eax, [esi*8]
push eax
mov eax, dword [edi + 0x490]
lea ecx, [esp + 0x14]
push eax
push ecx
push edx
call fcn.0043b7a0
add esp, 0x10
test eax, eax
je 0x4123a8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x20
ret 4
mov ecx, dword [esp + 0x10]
lea eax, [esi*8]
sub eax, esi
add eax, eax
push eax
push ecx
push esi
push str.S:UltraVNCwinvncwinvnc_vncclient.cpp_:__Sending_CacheZip_Rects_d_Size_d___d__r_n
push 9
push 0x46f3bc
call fcn.00405970
mov eax, esi
mov edx, esi
shl eax, 8
sar edx, 8
xor dl, al
add esp, 0x18
and edx, 0xff
mov word [esp + 0x26], bx
xor edx, eax
mov eax, dword [esp + 0x10]
mov word [esp + 0x24], dx
mov ecx, eax
mov edx, eax
and ecx, 0xff0000
shr edx, 0x10
or ecx, edx
mov edx, eax
and edx, 0xff00
push 0xc
shl eax, 0x10
or edx, eax
lea eax, [esp + 0x28]
shr ecx, 8
shl edx, 8
or ecx, edx
push eax
mov dword [esp + 0x20], ecx
mov ecx, dword [edi + 0xe8]
mov word [esp + 0x30], bx
mov word [esp + 0x32], bx
mov dword [esp + 0x34], 0x700ffff
call fcn.00438d70
test eax, eax
jne 0x41244a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
lea ecx, [esp + 0x18]
push 4
push ecx
mov ecx, dword [edi + 0xe8]
call fcn.00438d70
test eax, eax
jne 0x41246a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x20
ret 4
mov edx, dword [esp + 0x10]
mov eax, dword [edi + 0x488]
mov ecx, dword [edi + 0xe8]
push edx
push eax
call fcn.00438d70
neg eax
pop edi
pop esi
sbb eax, eax
pop ebp
neg eax
pop ebx
add esp, 0x20
ret 4