Function at 0x49073a
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0xc
push ebx
mov ebx, dword [esp + 0x18]
push ebp
mov ebp, dword [esp + 0x18]
push esi
mov eax, dword [ebx]
mov esi, edx
mov dword [esp + 0xc], esi
push edi
mov edi, ecx
test eax, eax
jne 0x4908a3
mov ecx, dword [ebx + 4]
cmp ecx, 8
jne 0x4907b6
xor ecx, ecx
test esi, esi
je 0x490781
nop
mov al, byte [ecx + ebp]
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 0x49076a
cmp dword [ebx + 0x10], 0
je 0x490b21
mov eax, esi
neg eax
lea ecx, [edi + eax*4]
test esi, esi
je 0x490b21
movzx eax, byte [ecx]
cmp eax, dword [ebx + 0x14]
jne 0x4907a6
mov byte [ecx + 3], 0
add ecx, 4
sub esi, 1
jne 0x49079a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
cmp ecx, 0x10
jne 0x490807
xor edx, edx
test esi, esi
je 0x490b21
inc edi
lea esp, [esp]
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 0x4907f2
movzx ecx, byte [ebp + edx*2 + 1]
movzx eax, al
shl eax, 8
add ecx, eax
cmp ecx, dword [ebx + 0x14]
jne 0x4907f2
xor al, al
jmp 0x4907f4
or al, 0xff
mov byte [edi + 2], al
inc edx
add edi, 4
cmp edx, esi
jne 0x4907ca
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov eax, 1
mov dword [esp + 0x10], 0
shl eax, cl
dec eax
mov dword [esp + 0x18], eax
test esi, esi
je 0x490b21
lea ecx, [edi + 1]
mov dword [esp + 0x14], ecx
mov edx, dword [ebx + 4]
xor edi, edi
test edx, edx
je 0x490867
mov ebx, dword [esp + 0x10]
lea ecx, [ecx]
mov al, bl
mov cl, 7
and al, 7
add edi, edi
sub cl, al
mov eax, ebx
shr eax, 3
inc ebx
mov al, byte [eax + ebp]
shr al, cl
and al, 1
movzx eax, al
or edi, eax
sub edx, 1
jne 0x49083a
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x10], ebx
mov ebx, dword [esp + 0x24]
imul eax, edi, 0xff
xor edx, edx
div dword [esp + 0x18]
mov byte [ecx + 1], al
mov byte [ecx], al
mov byte [ecx - 1], al
cmp dword [ebx + 0x10], 0
je 0x49088a
cmp edi, dword [ebx + 0x14]
jne 0x49088a
xor al, al
jmp 0x49088c
or al, 0xff
mov byte [ecx + 2], al
add ecx, 4
mov dword [esp + 0x14], ecx
sub esi, 1
jne 0x49082a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
cmp eax, 2
jne 0x4909a0
cmp dword [ebx + 4], 8
jne 0x490928
test esi, esi
je 0x4908db
mov ebx, esi
mov edi, edi
push 3
mov edx, ebp
mov ecx, edi
call fcn.004955f4
mov byte [edi + 3], 0xff
add esp, 4
add ebp, 3
add edi, 4
sub ebx, 1
jne 0x4908ba
mov ebx, dword [esp + 0x24]
cmp dword [ebx + 0x10], 0
je 0x490b21
mov eax, esi
neg eax
lea ecx, [edi + eax*4]
test esi, esi
je 0x490b21
lea ebx, [ebx]
movzx eax, byte [ecx]
cmp eax, dword [ebx + 0x14]
jne 0x490918
movzx eax, byte [ecx + 1]
cmp eax, dword [ebx + 0x18]
jne 0x490918
movzx eax, byte [ecx + 2]
cmp eax, dword [ebx + 0x1c]
jne 0x490918
mov byte [ecx + 3], 0
add ecx, 4
sub esi, 1
jne 0x4908fa
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
test esi, esi
je 0x490b21
add edi, 2
add ebp, 4
lea esp, [esp]
mov al, byte [ebp - 4]
mov dl, byte [ebp - 2]
mov dh, byte [ebp]
mov byte [edi - 2], al
mov byte [edi - 1], dl
mov byte [edi], dh
cmp dword [ebx + 0x10], 0
je 0x490988
movzx ecx, al
movzx eax, byte [ebp - 3]
shl ecx, 8
add ecx, eax
cmp ecx, dword [ebx + 0x14]
jne 0x490988
movzx eax, byte [ebp - 1]
movzx ecx, dl
shl ecx, 8
add ecx, eax
cmp ecx, dword [ebx + 0x18]
jne 0x490988
movzx eax, byte [ebp + 1]
movzx ecx, dh
shl ecx, 8
add ecx, eax
cmp ecx, dword [ebx + 0x1c]
jne 0x490988
xor al, al
jmp 0x49098a
or al, 0xff
mov byte [edi + 1], al
add ebp, 6
add edi, 4
sub esi, 1
jne 0x49093a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
cmp eax, 3
jne 0x490a61
cmp dword [ebx + 4], 8
jne 0x4909eb
xor eax, eax
mov dword [esp + 0x24], eax
test esi, esi
je 0x490b21
movzx ecx, byte [eax + ebp]
mov eax, dword [ebx + 8]
push 4
lea edx, [eax + ecx*4]
mov ecx, edi
call fcn.004955f4
mov eax, dword [esp + 0x28]
add esp, 4
inc eax
add edi, 4
mov dword [esp + 0x24], eax
cmp eax, esi
jne 0x4909bd
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov dword [esp + 0x14], 0
test esi, esi
je 0x490b21
mov eax, dword [ebx + 4]
xor edx, edx
mov dword [esp + 0x18], eax
test eax, eax
je 0x490a3b
mov ebx, dword [esp + 0x14]
mov esi, eax
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 + ebp]
shr al, cl
and al, 1
movzx eax, al
or edx, eax
sub esi, 1
jne 0x490a0e
mov esi, dword [esp + 0x10]
mov dword [esp + 0x14], ebx
mov ebx, dword [esp + 0x24]
mov eax, dword [ebx + 8]
mov ecx, edi
push 4
lea edx, [eax + edx*4]
call fcn.004955f4
add esp, 4
add edi, 4
sub esi, 1
mov dword [esp + 0x10], esi
jne 0x4909fb
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
cmp eax, 4
jne 0x490acf
xor ecx, ecx
cmp dword [ebx + 4], 8
jne 0x490a9f
test esi, esi
je 0x490b21
inc edi
lea ecx, [ecx]
mov al, byte [ebp + ecx*2]
lea edi, [edi + 4]
mov byte [edi - 3], al
mov byte [edi - 4], al
mov byte [edi - 5], al
movzx eax, byte [ebp + ecx*2 + 1]
inc ecx
mov byte [edi - 2], al
cmp ecx, esi
jne 0x490a7a
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
test esi, esi
je 0x490b21
inc edi
mov edi, edi
mov al, byte [ebp + ecx*4]
lea edi, [edi + 4]
mov byte [edi - 3], al
mov byte [edi - 4], al
mov byte [edi - 5], al
movzx eax, byte [ebp + ecx*4 + 2]
inc ecx
mov byte [edi - 2], al
cmp ecx, esi
jne 0x490aaa
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
cmp eax, 6
jne 0x490b21
cmp dword [ebx + 4], 8
jne 0x490af0
shl esi, 2
mov edx, ebp
push esi
call fcn.004955f4
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
test esi, esi
je 0x490b21
add edi, 2
add ebp, 4
movzx eax, byte [ebp - 4]
lea ebp, [ebp + 8]
mov byte [edi - 2], al
lea edi, [edi + 4]
movzx eax, byte [ebp - 0xa]
mov byte [edi - 5], al
movzx eax, byte [ebp - 8]
mov byte [edi - 4], al
movzx eax, byte [ebp - 6]
mov byte [edi - 3], al
sub esi, 1
jne 0x490afa
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret