Function at 0x4142d0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x28
push ebx
mov ebx, ecx
push ebp
push esi
mov al, byte [ebx + 0x4422]
mov cx, word [ebx + 0x441c]
mov dl, byte [ebx + 0x4423]
mov byte [esp + 0x20], al
mov ax, word [ebx + 0x441e]
push edi
mov di, word [ebx + 0x4420]
mov word [esp + 0x20], ax
mov al, byte [esp + 0x4c]
mov word [esp + 0x28], cx
mov cl, byte [ebx + 0x4424]
mov byte [esp + 0x1c], dl
test al, 2
mov byte [esp + 0x18], cl
mov dword [esp + 0x2c], edi
je 0x4143c9
lea edx, [esp + 0x30]
push 2
push edx
mov ecx, ebx
call fcn.0040b880
mov ebp, dword [esp + 0x30]
mov cl, byte [esp + 0x18]
mov eax, dword [esp + 0x28]
and ebp, 0xffff
mov edx, ebp
mov esi, edi
shr edx, cl
and esi, 0xffff
and eax, 0xffff
mov dword [esp + 0x14], eax
mov cl, byte [esp + 0x1c]
mov edi, dword [esp + 0x20]
and edx, esi
and edi, 0xffff
mov eax, edx
shl eax, 8
sub eax, edx
cdq
idiv esi
mov edx, ebp
shr edx, cl
mov cl, byte [esp + 0x24]
shr ebp, cl
mov ecx, dword [esp + 0x14]
and edx, edi
and ebp, ecx
mov esi, eax
mov eax, edx
shl eax, 8
sub eax, edx
and esi, 0xff
cdq
idiv edi
or esi, 0x200
mov edi, dword [esp + 0x2c]
shl esi, 8
and eax, 0xff
or esi, eax
mov eax, ebp
shl eax, 8
sub eax, ebp
cdq
idiv ecx
shl esi, 8
and eax, 0xff
or esi, eax
mov dword [0x44a1e0], esi
jmp 0x4143cf
mov esi, dword [0x44a1e0]
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x40]
push esi
push eax
mov eax, dword [esp + 0x44]
push ecx
push edx
push eax
mov ecx, ebx
call fcn.0040c900
test byte [esp + 0x4c], 4
je 0x414497
lea ecx, [esp + 0x34]
push 2
push ecx
mov ecx, ebx
call fcn.0040b880
mov esi, dword [esp + 0x34]
mov cl, byte [esp + 0x18]
mov eax, dword [esp + 0x28]
and esi, 0xffff
mov edx, esi
mov ebp, edi
shr edx, cl
and ebp, 0xffff
and eax, 0xffff
mov dword [esp + 0x14], eax
mov cl, byte [esp + 0x1c]
mov edi, dword [esp + 0x20]
and edx, ebp
and edi, 0xffff
mov eax, edx
shl eax, 8
sub eax, edx
cdq
idiv ebp
mov edx, esi
shr edx, cl
mov cl, byte [esp + 0x24]
shr esi, cl
mov ecx, dword [esp + 0x14]
and edx, edi
and esi, ecx
mov ebp, eax
mov eax, edx
shl eax, 8
sub eax, edx
and ebp, 0xff
cdq
idiv edi
or ebp, 0x200
mov edi, dword [esp + 0x2c]
shl ebp, 8
and eax, 0xff
or ebp, eax
mov eax, esi
shl eax, 8
sub eax, esi
cdq
idiv ecx
shl ebp, 8
and eax, 0xff
or ebp, eax
mov dword [0x44a1e4], ebp
test byte [esp + 0x4c], 8
je 0x414680
lea edx, [esp + 0x10]
push 1
push edx
mov ecx, ebx
call fcn.0040b880
mov al, byte [esp + 0x4c]
mov ebp, dword [ebx + 0x1c4]
test al, 0x10
je 0x41460d
mov eax, dword [esp + 0x10]
mov ecx, ebx
and eax, 0xff
shl eax, 2
push eax
push ebp
call fcn.0040b880
mov al, byte [esp + 0x10]
mov dword [esp + 0x4c], 0
test al, al
jbe 0x414680
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
and eax, 0xff
and ecx, 0xff
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x20]
and eax, 0xffff
and edi, 0xffff
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x24]
and eax, 0xff
mov dword [esp + 0x48], ecx
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x28]
and eax, 0xffff
mov dword [esp + 0x44], edi
mov dword [esp + 0x14], eax
jmp 0x414541
mov ecx, dword [esp + 0x48]
mov edi, dword [esp + 0x44]
xor esi, esi
mov si, word [ebp]
add ebp, 2
mov edx, esi
shr edx, cl
mov ecx, dword [esp + 0x2c]
and edx, edi
mov eax, edx
shl eax, 8
sub eax, edx
cdq
idiv edi
mov edx, esi
shr edx, cl
mov ecx, dword [esp + 0x20]
and edx, ecx
mov edi, eax
mov eax, edx
shl eax, 8
sub eax, edx
and edi, 0xff
cdq
idiv ecx
mov ecx, dword [esp + 0x24]
or edi, 0x200
shr esi, cl
mov ecx, dword [esp + 0x14]
shl edi, 8
and esi, ecx
and eax, 0xff
or edi, eax
mov eax, esi
shl eax, 8
sub eax, esi
cdq
idiv ecx
shl edi, 8
and eax, 0xff
or edi, eax
xor eax, eax
mov dword [0x44a1e4], edi
mov al, byte [ebp]
mov edx, eax
and eax, 0xf
shr edx, 4
mov esi, eax
inc ebp
xor eax, eax
push edi
mov al, byte [ebp]
mov ecx, eax
and eax, 0xf
shr ecx, 4
inc ecx
inc eax
push eax
mov eax, dword [esp + 0x44]
push ecx
mov ecx, dword [esp + 0x4c]
add esi, ecx
add edx, eax
push esi
push edx
mov ecx, ebx
inc ebp
call fcn.0040c900
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x10]
inc eax
and ecx, 0xff
cmp eax, ecx
mov dword [esp + 0x4c], eax
jl 0x414539
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret 0x14
mov edx, dword [esp + 0x10]
mov ecx, ebx
and edx, 0xff
shl edx, 1
push edx
push ebp
call fcn.0040b880
mov al, byte [esp + 0x10]
xor esi, esi
test al, al
jbe 0x414680
xor eax, eax
mov al, byte [ebp]
mov edx, eax
and eax, 0xf
shr edx, 4
mov edi, eax
inc ebp
xor eax, eax
mov al, byte [ebp]
mov ecx, eax
and eax, 0xf
shr ecx, 4
inc ecx
inc eax
mov dword [esp + 0x4c], eax
mov eax, dword [0x44a1e4]
push eax
mov eax, dword [esp + 0x50]
push eax
mov eax, dword [esp + 0x44]
push ecx
mov ecx, dword [esp + 0x4c]
add edi, ecx
add edx, eax
push edi
push edx
mov ecx, ebx
inc ebp
call fcn.0040c900
mov ecx, dword [esp + 0x10]
inc esi
and ecx, 0xff
cmp esi, ecx
jl 0x41462c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret 0x14