Function at 0x45e018
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x14
push ebx
mov ebx, dword [esp + 0x20]
push ebp
push esi
mov esi, edx
mov dword [esp + 0x14], ecx
mov eax, dword [ebx]
mov dword [esp + 0x10], esi
push edi
mov edi, ecx
test eax, eax
jne 0x45e18d
mov ecx, dword [ebx + 4]
cmp ecx, 8
jne 0x45e097
xor ecx, ecx
test esi, esi
je 0x45e062
mov edx, dword [esp + 0x28]
mov al, byte [ecx + edx]
inc ecx
mov byte [edi + 2], al
mov byte [edi + 1], al
mov byte [edi], al
mov byte [edi + 3], 0xff
add edi, 4
cmp ecx, esi
jne 0x45e04b
cmp dword [ebx + 0x10], 0
je 0x45e42f
mov eax, esi
neg eax
lea ecx, [edi + eax*4]
test esi, esi
je 0x45e42f
movzx eax, byte [ecx]
cmp eax, dword [ebx + 0x14]
jne 0x45e087
mov byte [ecx + 3], 0
add ecx, 4
sub esi, 1
jne 0x45e07b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
xor edx, edx
cmp ecx, 0x10
jne 0x45e0e8
test esi, esi
je 0x45e42f
mov ebp, dword [esp + 0x28]
inc edi
mov al, byte [ebp + edx*2]
mov byte [edi + 1], al
mov byte [edi], al
mov byte [edi - 1], al
cmp dword [ebx + 0x10], 0
je 0x45e0d3
movzx ecx, byte [ebp + edx*2 + 1]
movzx eax, al
shl eax, 8
add ecx, eax
cmp ecx, dword [ebx + 0x14]
jne 0x45e0d3
xor al, al
jmp 0x45e0d5
or al, 0xff
mov byte [edi + 2], al
inc edx
add edi, 4
cmp edx, esi
jne 0x45e0ab
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov eax, 1
mov dword [esp + 0x1c], edx
shl eax, cl
dec eax
mov dword [esp + 0x20], eax
test esi, esi
je 0x45e42f
lea ecx, [edi + 1]
mov dword [esp + 0x18], ecx
nop
mov ebp, dword [ebx + 4]
xor edi, edi
test ebp, ebp
je 0x45e149
mov esi, dword [esp + 0x28]
lea ecx, [ecx]
mov al, dl
mov cl, 7
and al, 7
add edi, edi
sub cl, al
mov eax, edx
shr eax, 3
inc edx
mov al, byte [eax + esi]
shr al, cl
and al, 1
movzx eax, al
or edi, eax
sub ebp, 1
jne 0x45e118
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x1c], edx
imul eax, edi, 0xff
xor edx, edx
div dword [esp + 0x20]
mov byte [ecx + 1], al
mov byte [ecx], al
mov byte [ecx - 1], al
cmp dword [ebx + 0x10], 0
je 0x45e16c
cmp edi, dword [ebx + 0x14]
jne 0x45e16c
xor al, al
jmp 0x45e16e
or al, 0xff
mov edx, dword [esp + 0x1c]
mov byte [ecx + 2], al
add ecx, 4
sub esi, 1
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], esi
jne 0x45e108
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
cmp eax, 2
jne 0x45e299
cmp dword [ebx + 4], 8
jne 0x45e216
test esi, esi
je 0x45e1c9
mov ebp, dword [esp + 0x28]
mov ebx, esi
mov edi, edi
push 3
mov edx, ebp
mov ecx, edi
call fcn.00462eea
mov byte [edi + 3], 0xff
add esp, 4
add ebp, 3
add edi, 4
sub ebx, 1
jne 0x45e1a8
mov ebx, dword [esp + 0x2c]
cmp dword [ebx + 0x10], 0
je 0x45e42f
mov eax, esi
neg eax
lea ecx, [edi + eax*4]
test esi, esi
je 0x45e42f
lea ebx, [ebx]
movzx eax, byte [ecx]
cmp eax, dword [ebx + 0x14]
jne 0x45e206
movzx eax, byte [ecx + 1]
cmp eax, dword [ebx + 0x18]
jne 0x45e206
movzx eax, byte [ecx + 2]
cmp eax, dword [ebx + 0x1c]
jne 0x45e206
mov byte [ecx + 3], 0
add ecx, 4
sub esi, 1
jne 0x45e1e8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
test esi, esi
je 0x45e42f
mov edx, dword [esp + 0x28]
add edi, 2
add edx, 4
mov cl, byte [edx - 2]
mov al, byte [edx - 4]
mov byte [edi - 1], cl
mov byte [esp + 0x2c], cl
mov cl, byte [edx]
mov byte [edi - 2], al
mov byte [edi], cl
cmp dword [ebx + 0x10], 0
mov byte [esp + 0x13], cl
je 0x45e281
movzx ecx, al
movzx eax, byte [edx - 3]
shl ecx, 8
add ecx, eax
cmp ecx, dword [ebx + 0x14]
jne 0x45e281
movzx ecx, byte [esp + 0x2c]
movzx eax, byte [edx - 1]
shl ecx, 8
add ecx, eax
cmp ecx, dword [ebx + 0x18]
jne 0x45e281
movzx ecx, byte [esp + 0x13]
movzx eax, byte [edx + 1]
shl ecx, 8
add ecx, eax
cmp ecx, dword [ebx + 0x1c]
jne 0x45e281
xor al, al
jmp 0x45e283
or al, 0xff
mov byte [edi + 1], al
add edx, 6
add edi, 4
sub esi, 1
jne 0x45e228
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
cmp eax, 3
jne 0x45e364
cmp dword [ebx + 4], 8
jne 0x45e2e2
xor ebp, ebp
test esi, esi
je 0x45e42f
lea ebx, [ebx]
mov eax, dword [esp + 0x28]
push 4
movzx ecx, byte [eax + ebp]
mov eax, dword [ebx + 8]
lea edx, [eax + ecx*4]
mov ecx, edi
call fcn.00462eea
inc ebp
add esp, 4
add edi, 4
cmp ebp, esi
jne 0x45e2b8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
mov dword [esp + 0x1c], 0
test esi, esi
je 0x45e42f
lea ebx, [ebx]
mov ebp, dword [ebx + 4]
xor edx, edx
test ebp, ebp
je 0x45e33a
mov ebx, dword [esp + 0x1c]
mov edi, dword [esp + 0x28]
mov al, bl
mov cl, 7
and al, 7
add edx, edx
sub cl, al
mov eax, ebx
shr eax, 3
inc ebx
mov al, byte [eax + edi]
shr al, cl
and al, 1
movzx eax, al
or edx, eax
sub ebp, 1
jne 0x45e309
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x18]
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0x2c]
mov eax, dword [ebx + 8]
mov ecx, edi
push 4
lea edx, [eax + edx*4]
call fcn.00462eea
add edi, 4
add esp, 4
sub esi, 1
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], esi
jne 0x45e2f8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
cmp eax, 4
jne 0x45e3d3
xor ecx, ecx
cmp dword [ebx + 4], 8
jne 0x45e3a2
test esi, esi
je 0x45e42f
mov edx, dword [esp + 0x28]
inc edi
mov al, byte [edx + ecx*2]
lea edi, [edi + 4]
mov byte [edi - 3], al
mov byte [edi - 4], al
mov byte [edi - 5], al
movzx eax, byte [edx + ecx*2 + 1]
inc ecx
mov byte [edi - 2], al
cmp ecx, esi
jne 0x45e37e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
test esi, esi
je 0x45e42f
mov edx, dword [esp + 0x28]
inc edi
mov al, byte [edx + ecx*4]
lea edi, [edi + 4]
mov byte [edi - 3], al
mov byte [edi - 4], al
mov byte [edi - 5], al
movzx eax, byte [edx + ecx*4 + 2]
inc ecx
mov byte [edi - 2], al
cmp ecx, esi
jne 0x45e3af
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
cmp eax, 6
jne 0x45e42f
cmp dword [ebx + 4], 8
jne 0x45e3f6
mov edx, dword [esp + 0x28]
shl esi, 2
push esi
call fcn.00462eea
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret
test esi, esi
je 0x45e42f
mov ecx, dword [esp + 0x28]
add edi, 2
add ecx, 4
lea esp, [esp]
movzx eax, byte [ecx - 4]
lea ecx, [ecx + 8]
mov byte [edi - 2], al
lea edi, [edi + 4]
movzx eax, byte [ecx - 0xa]
mov byte [edi - 5], al
movzx eax, byte [ecx - 8]
mov byte [edi - 4], al
movzx eax, byte [ecx - 6]
mov byte [edi - 3], al
sub esi, 1
jne 0x45e408
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret