Function at 0x414640
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x28
push ebx
mov ebx, ecx
push ebp
push esi
mov al, byte [ebx + 0x473a]
mov cx, word [ebx + 0x4734]
mov dl, byte [ebx + 0x473b]
mov byte [esp + 0x20], al
mov ax, word [ebx + 0x4736]
push edi
mov di, word [ebx + 0x4738]
mov word [esp + 0x20], ax
mov al, byte [esp + 0x4c]
mov word [esp + 0x28], cx
mov cl, byte [ebx + 0x473c]
mov byte [esp + 0x1c], dl
test al, 2
mov byte [esp + 0x18], cl
mov dword [esp + 0x2c], edi
je 0x414739
lea edx, [esp + 0x30]
push 2
push edx
mov ecx, ebx
call fcn.0040bbc0
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 [0x44a2b0], esi
jmp 0x41473f
mov esi, dword [0x44a2b0]
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.0040cc40
test byte [esp + 0x4c], 4
je 0x414807
lea ecx, [esp + 0x34]
push 2
push ecx
mov ecx, ebx
call fcn.0040bbc0
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 [0x44a2b4], ebp
test byte [esp + 0x4c], 8
je 0x4149f0
lea edx, [esp + 0x10]
push 1
push edx
mov ecx, ebx
call fcn.0040bbc0
mov al, byte [esp + 0x4c]
mov ebp, dword [ebx + 0x4dc]
test al, 0x10
je 0x41497d
mov eax, dword [esp + 0x10]
mov ecx, ebx
and eax, 0xff
shl eax, 2
push eax
push ebp
call fcn.0040bbc0
mov al, byte [esp + 0x10]
mov dword [esp + 0x4c], 0
test al, al
jbe 0x4149f0
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 0x4148b1
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 [0x44a2b4], 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.0040cc40
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x10]
inc eax
and ecx, 0xff
cmp eax, ecx
mov dword [esp + 0x4c], eax
jl 0x4148a9
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.0040bbc0
mov al, byte [esp + 0x10]
xor esi, esi
test al, al
jbe 0x4149f0
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 [0x44a2b4]
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.0040cc40
mov ecx, dword [esp + 0x10]
inc esi
and ecx, 0xff
cmp esi, ecx
jl 0x41499c
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret 0x14