Function at 0x54c680
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc8
push ebx
push esi
push edi
mov ebx, ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov edi, dword [ebp + 8]
mov eax, dword [ebp - 8]
call fcn.00404778
xor eax, eax
push ebp
push 0x54cec8
push dword fs:[eax]
mov dword fs:[eax], esp
xor edx, edx
mov eax, dword [ebp - 8]
call fcn.00409274
mov esi, eax
mov eax, dword [ebp - 4]
mov dword [eax + 0x3a0], esi
mov edx, dword [ebx + 0x2c]
mov eax, esi
xor ecx, ecx
call fcn.00409350
mov dword [ebx + 0x1c], 0x3b9ac9ff
xor eax, eax
mov dword [ebx + 0x18], eax
mov eax, dword [ebp - 4]
cmp byte [eax + 0xd28], 1
jne 0x54c930
cmp byte [ebx + 0x11], 8
jbe 0x54c74e
cmp byte [ebx + 0x10], 0x10
jne 0x54c74e
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
mov ecx, eax
add ecx, ecx
mov edx, dword [edi]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3a0]
call fcn.004092f8
mov eax, dword [ebp - 4]
cmp byte [eax + 0x10c1], 0
jne 0x54c74e
mov eax, dword [ebx + 8]
imul dword [ebx + 4]
mov edx, dword [ebp - 4]
movzx edx, byte [edx + 0xd28]
imul edx
dec eax
test eax, eax
jl 0x54c74e
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov eax, dword [edi]
mov edx, esi
add edx, edx
add eax, edx
mov dx, word [eax]
xchg dl, dh
push edx
pop edx
mov word [eax], dx
inc esi
dec dword [ebp - 0x2c]
jne 0x54c736
cmp byte [ebx + 0x11], 0xa
je 0x54c75e
cmp byte [ebx + 0x11], 0xc
jne 0x54c858
cmp byte [ebx + 0x10], 0xc
jne 0x54c858
xor eax, eax
mov dword [ebp - 0x20], eax
xor eax, eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebx + 4]
lea eax, [eax + eax*2]
mov dword [ebp - 0x34], eax
fild dword [ebp - 0x34]
fdiv dword [0x54ced8]
call fcn.00402c24
imul dword [ebx + 8]
add eax, eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
call fcn.004027b8
mov dword [ebp - 0x28], eax
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3a0]
mov ecx, dword [ebp - 0x18]
call fcn.004092f8
mov eax, dword [ebp - 0x18]
dec eax
mov ecx, 3
cdq
idiv ecx
test eax, eax
jl 0x54c850
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
lea eax, [esi + esi*2]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0xc]
mov al, byte [eax + edx]
mov byte [ebp - 0x21], al
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0xc]
mov al, byte [eax + edx + 1]
mov byte [ebp - 0x22], al
mov al, byte [ebp - 0x22]
and al, 0xf0
and eax, 0xff
shr eax, 4
xor edx, edx
mov dl, byte [ebp - 0x21]
shl edx, 4
and eax, 0xff
add edx, eax
mov eax, edx
mov edx, dword [edi]
mov ecx, dword [ebp - 0x14]
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc dword [ebp - 0x14]
mov al, byte [ebp - 0x22]
and al, 0xf
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0xc]
mov dl, byte [edx + ecx + 2]
mov byte [ebp - 0x23], dl
and eax, 0xff
shl eax, 8
xor edx, edx
mov dl, byte [ebp - 0x23]
add eax, edx
mov edx, dword [edi]
mov ecx, dword [ebp - 0x14]
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc dword [ebp - 0x14]
inc esi
dec dword [ebp - 0x2c]
jne 0x54c7ca
mov eax, dword [ebp - 0x28]
call fcn.004027d8
cmp byte [ebx + 0x11], 0xa
jne 0x54c865
mov dword [ebx + 0x14], 0x3ff
cmp byte [ebx + 0x11], 0xc
jne 0x54c872
mov dword [ebx + 0x14], 0xfff
cmp byte [ebx + 0x11], 0xe
jne 0x54c87f
mov dword [ebx + 0x14], 0x3fff
cmp byte [ebx + 0x11], 0x10
jne 0x54c88c
mov dword [ebx + 0x14], 0xffff
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
dec eax
test eax, eax
jl 0x54c8db
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov edx, dword [edi]
mov eax, esi
add eax, eax
add edx, eax
movzx edx, word [edx]
cmp edx, dword [ebx + 0x18]
jle 0x54c8bb
mov edx, dword [edi]
mov ecx, esi
add ecx, ecx
add edx, ecx
movzx edx, word [edx]
mov dword [ebx + 0x18], edx
mov edx, dword [edi]
add edx, eax
movzx eax, word [edx]
cmp eax, dword [ebx + 0x1c]
jge 0x54c8d5
mov eax, dword [edi]
mov edx, esi
add edx, edx
add eax, edx
movzx eax, word [eax]
mov dword [ebx + 0x1c], eax
inc esi
dec dword [ebp - 0x2c]
jne 0x54c89d
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
dec eax
test eax, eax
jl 0x54cd0e
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov eax, dword [edi]
mov edx, esi
add edx, edx
add eax, edx
movzx eax, word [eax]
sub eax, dword [ebx + 0x1c]
mov dword [ebp - 0x34], eax
fild dword [ebp - 0x34]
mov eax, dword [ebx + 0x18]
sub eax, dword [ebx + 0x1c]
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
fdivp st(1)
fmul dword [0x54cedc]
call fcn.00402c24
mov edx, dword [ebp + 0xc]
mov edx, dword [edx]
mov byte [edx + esi], al
inc esi
dec dword [ebp - 0x2c]
jne 0x54c8f0
jmp 0x54cd0e
cmp byte [ebx + 0x11], 0xa
je 0x54c940
cmp byte [ebx + 0x11], 0xc
jne 0x54cb4b
cmp byte [ebx + 0x10], 0xc
jne 0x54cb4b
mov eax, 0x54cee8
call fcn.00439834
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
add eax, eax
lea eax, [eax + eax*2]
mov dword [ebp - 0x34], eax
fild dword [ebp - 0x34]
fdiv dword [0x54cf0c]
fmul dword [0x54cf10]
call fcn.00402c24
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
call fcn.004027b8
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3a0]
call fcn.004092f8
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
dec eax
mov ecx, 9
cdq
idiv ecx
test eax, eax
jl 0x54cb29
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
lea eax, [esi + esi*8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0xc]
mov al, byte [eax + edx]
mov byte [ebp - 0x21], al
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0xc]
mov al, byte [eax + edx + 1]
mov byte [ebp - 0x22], al
mov al, byte [ebp - 0x22]
and al, 0xf0
and eax, 0xff
shr eax, 4
xor edx, edx
mov dl, byte [ebp - 0x21]
shl edx, 4
and eax, 0xff
add edx, eax
mov eax, edx
mov edx, dword [edi]
mov ecx, dword [ebp - 0x14]
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc dword [ebp - 0x14]
mov al, byte [ebp - 0x22]
and al, 0xf
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0xc]
mov dl, byte [edx + ecx + 2]
mov byte [ebp - 0x23], dl
and eax, 0xff
shl eax, 8
xor edx, edx
mov dl, byte [ebp - 0x23]
add eax, edx
mov edx, dword [edi]
mov ecx, dword [ebp - 0x14]
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0xc]
mov al, byte [eax + edx + 3]
mov byte [ebp - 0x21], al
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0xc]
mov al, byte [eax + edx + 4]
mov byte [ebp - 0x22], al
mov al, byte [ebp - 0x22]
and al, 0xf0
and eax, 0xff
shr eax, 4
xor edx, edx
mov dl, byte [ebp - 0x21]
shl edx, 4
and eax, 0xff
add edx, eax
mov eax, edx
mov edx, dword [edi]
mov ecx, dword [ebp - 0x14]
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc dword [ebp - 0x14]
mov al, byte [ebp - 0x22]
and al, 0xf
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0xc]
mov dl, byte [edx + ecx + 5]
mov byte [ebp - 0x23], dl
and eax, 0xff
shl eax, 8
xor edx, edx
mov dl, byte [ebp - 0x23]
add eax, edx
mov edx, dword [edi]
mov ecx, dword [ebp - 0x14]
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0xc]
mov al, byte [eax + edx + 6]
mov byte [ebp - 0x21], al
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp - 0xc]
mov al, byte [eax + edx + 7]
mov byte [ebp - 0x22], al
mov al, byte [ebp - 0x22]
and al, 0xf0
and eax, 0xff
shr eax, 4
xor edx, edx
mov dl, byte [ebp - 0x21]
shl edx, 4
and eax, 0xff
add edx, eax
mov eax, edx
mov edx, dword [edi]
mov ecx, dword [ebp - 0x14]
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc dword [ebp - 0x14]
mov al, byte [ebp - 0x22]
and al, 0xf
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0xc]
mov dl, byte [edx + ecx + 8]
mov byte [ebp - 0x23], dl
and eax, 0xff
shl eax, 8
xor edx, edx
mov dl, byte [ebp - 0x23]
add eax, edx
mov edx, dword [edi]
mov ecx, dword [ebp - 0x14]
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc dword [ebp - 0x14]
inc esi
dec dword [ebp - 0x2c]
jne 0x54c9b5
mov eax, dword [ebp - 0x28]
call fcn.004027d8
cmp byte [ebx + 0x11], 0xa
jne 0x54cb3e
mov dword [ebx + 0x14], 0x400
cmp byte [ebx + 0x11], 0xc
jne 0x54cb4b
mov dword [ebx + 0x14], 0x1000
cmp byte [ebx + 0x11], 8
jbe 0x54cc5b
cmp byte [ebx + 0x10], 0x10
jne 0x54cc5b
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
mov ecx, eax
add ecx, ecx
mov eax, dword [ebp - 4]
movzx eax, byte [eax + 0xd28]
imul ecx, eax
mov edx, dword [edi]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3a0]
call fcn.004092f8
mov eax, dword [ebp - 4]
cmp byte [eax + 0x10c1], 0
jne 0x54cbcd
mov eax, dword [ebx + 8]
imul dword [ebx + 4]
mov edx, dword [ebp - 4]
movzx edx, byte [edx + 0xd28]
imul edx
dec eax
test eax, eax
jl 0x54cbcd
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov eax, dword [edi]
mov edx, esi
add edx, edx
add eax, edx
mov ax, word [eax]
xchg al, ah
mov edx, dword [edi]
mov ecx, esi
add ecx, ecx
add edx, ecx
mov word [edx], ax
inc esi
dec dword [ebp - 0x2c]
jne 0x54cbaf
mov eax, dword [ebx + 8]
dec eax
test eax, eax
jl 0x54cc54
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov eax, dword [ebx + 4]
dec eax
test eax, eax
jl 0x54cc4e
inc eax
mov dword [ebp - 0x30], eax
xor eax, eax
mov edx, dword [edi]
mov ecx, dword [ebx + 4]
imul ecx, esi
add ecx, eax
lea ecx, [ecx + ecx*2]
add ecx, 2
add ecx, ecx
add edx, ecx
movzx edx, word [edx]
mov dword [ebp - 0x10], edx
mov edx, dword [edi]
mov ecx, dword [ebx + 4]
imul ecx, esi
add ecx, eax
lea ecx, [ecx + ecx*2]
add ecx, ecx
add edx, ecx
mov dx, word [edx]
push edx
mov edx, dword [edi]
mov ecx, dword [ebx + 4]
imul ecx, esi
add ecx, eax
lea ecx, [ecx + ecx*2]
add ecx, 2
add ecx, ecx
add edx, ecx
pop ecx
mov word [edx], cx
mov edx, dword [edi]
mov ecx, dword [ebx + 4]
imul ecx, esi
add ecx, eax
lea ecx, [ecx + ecx*2]
add ecx, ecx
add edx, ecx
mov cx, word [ebp - 0x10]
mov word [edx], cx
inc eax
dec dword [ebp - 0x30]
jne 0x54cbe9
inc esi
dec dword [ebp - 0x2c]
jne 0x54cbdb
mov dword [ebx + 0x14], 0x1000
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
mov edx, dword [ebp - 4]
movzx edx, byte [edx + 0xd28]
imul edx
dec eax
test eax, eax
jl 0x54ccb6
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov edx, dword [edi]
mov eax, esi
add eax, eax
add edx, eax
movzx edx, word [edx]
cmp edx, dword [ebx + 0x18]
jle 0x54cc96
mov edx, dword [edi]
mov ecx, esi
add ecx, ecx
add edx, ecx
movzx edx, word [edx]
mov dword [ebx + 0x18], edx
mov edx, dword [edi]
add edx, eax
movzx eax, word [edx]
cmp eax, dword [ebx + 0x1c]
jge 0x54ccb0
mov eax, dword [edi]
mov edx, esi
add edx, edx
add eax, edx
movzx eax, word [eax]
mov dword [ebx + 0x1c], eax
inc esi
dec dword [ebp - 0x2c]
jne 0x54cc78
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
mov edx, dword [ebp - 4]
movzx edx, byte [edx + 0xd28]
imul edx
dec eax
test eax, eax
jl 0x54cd0e
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov eax, dword [edi]
mov edx, esi
add edx, edx
add eax, edx
movzx eax, word [eax]
sub eax, dword [ebx + 0x1c]
mov dword [ebp - 0x34], eax
fild dword [ebp - 0x34]
mov eax, dword [ebx + 0x18]
sub eax, dword [ebx + 0x1c]
mov dword [ebp - 0x38], eax
fild dword [ebp - 0x38]
fdivp st(1)
fmul dword [0x54cedc]
call fcn.00402c24
mov edx, dword [ebp + 0xc]
mov edx, dword [edx]
mov byte [edx + esi], al
inc esi
dec dword [ebp - 0x2c]
jne 0x54ccd3
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3a0]
call fcn.00409394
mov eax, dword [ebp - 4]
cmp byte [eax + 0x3bfc9a], 0
je 0x54cdd2
mov eax, dword [ebx + 8]
imul dword [ebx + 4]
dec eax
test eax, eax
jl 0x54cdd2
inc eax
mov dword [ebp - 0x2c], eax
xor eax, eax
mov edx, dword [ebp - 4]
movzx edx, byte [edx + 0xd28]
imul edx, eax
mov ecx, dword [ebp + 0xc]
mov ecx, dword [ecx]
movzx ecx, byte [ecx + edx + 2]
mov esi, dword [ebp - 4]
mov cl, byte [esi + ecx + 0x3bfc9b]
push ecx
mov ecx, dword [ebp + 0xc]
mov ecx, dword [ecx]
lea ecx, [ecx + edx + 2]
pop edx
mov byte [ecx], dl
mov edx, dword [ebp - 4]
movzx edx, byte [edx + 0xd28]
imul edx, eax
mov ecx, dword [ebp + 0xc]
mov ecx, dword [ecx]
movzx ecx, byte [ecx + edx + 1]
mov esi, dword [ebp - 4]
mov cl, byte [esi + ecx + 0x3bfd9b]
push ecx
mov ecx, dword [ebp + 0xc]
mov ecx, dword [ecx]
lea ecx, [ecx + edx + 1]
pop edx
mov byte [ecx], dl
mov edx, dword [ebp - 4]
movzx edx, byte [edx + 0xd28]
imul edx, eax
mov ecx, dword [ebp + 0xc]
mov ecx, dword [ecx]
movzx ecx, byte [ecx + edx]
mov esi, dword [ebp - 4]
mov cl, byte [esi + ecx + 0x3bfe9b]
push ecx
mov ecx, dword [ebp + 0xc]
mov ecx, dword [ecx]
add ecx, edx
pop edx
mov byte [ecx], dl
inc eax
dec dword [ebp - 0x2c]
jne 0x54cd41
cmp byte [ebx + 0x11], 0xa
jne 0x54cddf
mov dword [ebx + 0x14], 0x3ff
cmp byte [ebx + 0x11], 0xc
jne 0x54cdec
mov dword [ebx + 0x14], 0xfff
cmp byte [ebx + 0x11], 0xe
jne 0x54cdf9
mov dword [ebx + 0x14], 0x3fff
cmp byte [ebx + 0x11], 0x10
jne 0x54ce06
mov dword [ebx + 0x14], 0xffff
mov eax, dword [ebx + 0x14]
inc eax
shl eax, 2
call fcn.004027b8
mov esi, eax
mov eax, dword [ebp - 4]
mov dword [eax + 0x192c], esi
mov edx, dword [ebx + 0x14]
inc edx
mov eax, esi
call fcn.00407644
mov eax, dword [ebp - 4]
cmp byte [eax + 0xd28], 1
jne 0x54ce6e
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
dec eax
test eax, eax
jl 0x54ceb2
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov eax, dword [edi]
mov edx, esi
add edx, edx
add eax, edx
movzx eax, word [eax]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x192c]
mov edx, dword [ebp - 0x10]
shl edx, 2
add eax, edx
inc dword [eax]
inc esi
dec dword [ebp - 0x2c]
jne 0x54ce45
jmp 0x54ceb2
mov eax, dword [ebx + 4]
imul dword [ebx + 8]
mov edx, dword [ebp - 4]
movzx edx, byte [edx + 0xd28]
imul edx
dec eax
test eax, eax
jl 0x54ceb2
inc eax
mov dword [ebp - 0x2c], eax
xor esi, esi
mov eax, dword [edi]
mov edx, esi
add edx, edx
add eax, edx
movzx eax, word [eax]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x192c]
mov edx, dword [ebp - 0x10]
shl edx, 2
add eax, edx
inc dword [eax]
inc esi
dec dword [ebp - 0x2c]
jne 0x54ce8b
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x54cecf
lea eax, [ebp - 8]
call fcn.004042c8
ret