Function at 0x513c78
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff8c
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
mov edx, dword [ebp - 4]
movzx edx, word [edx + 0xe]
imul edx
call fcn.00513694
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
add eax, 0xd400
add eax, 0x4000
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x40]
call fcn.004df14c
mov dword [ebp - 0x50], eax
xor eax, eax
push ebp
push 0x51420a
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
mov edx, dword [ebp - 4]
imul dword [edx + 8]
add eax, eax
call fcn.004df14c
mov dword [ebp - 0x54], eax
xor eax, eax
push ebp
push 0x5141ed
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x60], eax
mov edx, 0xc000
mov eax, dword [ebp - 0x50]
call fcn.004df1c8
mov dword [ebp - 0x5c], eax
mov edx, 0xd400
mov eax, dword [ebp - 0x50]
call fcn.004df1c8
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x2c]
shr ecx, 8
mov byte [edx + eax*4], cl
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x2c]
shr ecx, 4
and cl, 0xf
mov byte [edx + eax*4 + 1], cl
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
mov cl, byte [ebp - 0x2c]
and cl, 0xf
mov byte [edx + eax*4 + 2], cl
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
xor ecx, ecx
mov dword [edx + eax*4 + 4], ecx
inc dword [ebp - 0x2c]
cmp dword [ebp - 0x2c], 0x1000
jne 0x513d16
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
dec eax
test eax, eax
jl 0x513e55
inc eax
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x2c], 0
mov edx, dword [ebp - 4]
mov edx, dword [edx + 8]
dec edx
sub edx, dword [ebp - 0x2c]
imul edx, dword [ebp - 0x20]
mov eax, dword [ebp - 8]
call fcn.004df1c8
mov edx, eax
mov ecx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x18]
call fcn.004df1e4
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
dec eax
test eax, eax
jl 0x513e49
inc eax
mov dword [ebp - 0x6c], eax
mov dword [ebp - 0x30], 0
mov eax, dword [ebp - 0x14]
mov al, byte [eax + 2]
and al, 0xf0
and eax, 0xff
shl eax, 4
mov edx, dword [ebp - 0x14]
mov dl, byte [edx + 1]
and dl, 0xf0
and edx, 0xff
add ax, dx
mov edx, dword [ebp - 0x14]
mov dl, byte [edx]
and dl, 0xf0
and edx, 0xff
shr edx, 4
add ax, dx
mov word [ebp - 0x32], ax
movzx eax, word [ebp - 0x32]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
inc dword [edx + eax*4 + 4]
mov edx, 3
mov eax, dword [ebp - 0x14]
call fcn.004df1c8
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x58]
mov dx, word [ebp - 0x32]
mov word [eax], dx
mov edx, 2
mov eax, dword [ebp - 0x58]
call fcn.004df1c8
mov dword [ebp - 0x58], eax
inc dword [ebp - 0x30]
dec dword [ebp - 0x6c]
jne 0x513dcf
inc dword [ebp - 0x2c]
dec dword [ebp - 0x68]
jne 0x513d8c
xor eax, eax
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 0x5c]
xor ecx, ecx
mov dword [edx + eax*4 + 0x10], ecx
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 0x5c]
xor ecx, ecx
mov dword [edx + eax*4 + 0xc], ecx
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 0x5c]
xor ecx, ecx
mov dword [edx + eax*4 + 8], ecx
xor eax, eax
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 0x5c]
lea eax, [edx + eax*4]
mov edx, dword [ebp - 0x30]
mov byte [eax + edx], 0
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 0x5c]
lea eax, [edx + eax*4]
mov edx, dword [ebp - 0x30]
mov byte [eax + edx + 3], 0xff
inc dword [ebp - 0x30]
cmp dword [ebp - 0x30], 3
jne 0x513e8c
inc dword [ebp - 0x2c]
cmp dword [ebp - 0x2c], 0x100
jne 0x513e5a
xor eax, eax
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0x1000
jge 0x513ef2
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
cmp dword [edx + eax*4 + 4], 0
jg 0x513ef2
inc dword [ebp - 0x2c]
cmp dword [ebp - 0x2c], 0x1000
jl 0x513ed6
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
lea eax, [edx + eax*4]
mov dword [ebp - 0x64], eax
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
lea eax, [edx + eax*4]
mov edx, dword [ebp - 0x5c]
mov dword [edx + 0x10], eax
mov dword [ebp - 0x3c], 1
inc dword [ebp - 0x2c]
cmp dword [ebp - 0x2c], 0x1000
jge 0x513f66
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
cmp dword [edx + eax*4 + 4], 0
jle 0x513f5a
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
lea eax, [edx + eax*4]
mov edx, dword [ebp - 0x64]
mov dword [edx + 8], eax
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
lea eax, [edx + eax*4]
mov dword [ebp - 0x64], eax
inc dword [ebp - 0x3c]
inc dword [ebp - 0x2c]
cmp dword [ebp - 0x2c], 0x1000
jl 0x513f26
mov eax, dword [ebp - 0x64]
xor edx, edx
mov dword [eax + 8], edx
mov eax, dword [ebp - 0x5c]
mov edx, dword [ebp - 0x3c]
mov dword [eax + 8], edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
mov edx, dword [ebp - 4]
imul dword [edx + 8]
mov edx, dword [ebp - 0x5c]
mov dword [edx + 0xc], eax
mov dword [ebp - 0x38], 1
mov edx, dword [ebp - 0x20]
add edx, 0xd400
mov eax, dword [ebp - 0x50]
call fcn.004df1c8
push eax
lea ecx, [ebp - 0x38]
mov edx, dword [ebp + 0xc]
mov edx, dword [edx]
mov eax, dword [ebp - 0x5c]
call fcn.005138ec
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
cmp eax, dword [ebp - 0x38]
jle 0x513fed
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp + 0xc]
mov edx, dword [edx]
dec edx
sub edx, eax
jl 0x513fed
inc edx
mov dword [ebp - 0x68], edx
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x2c]
lea eax, [eax + edx*4]
xor ecx, ecx
mov edx, 4
call fcn.00403ac4
inc dword [ebp - 0x2c]
dec dword [ebp - 0x68]
jne 0x513fd0
mov eax, dword [ebp - 0x38]
dec eax
test eax, eax
jl 0x5140fe
inc eax
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x2c], 0
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 0x5c]
mov eax, dword [edx + eax*4 + 8]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jle 0x5140f2
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax*4]
mov edx, dword [ebp - 0x5c]
mov eax, dword [edx + eax*4 + 0x10]
mov dword [ebp - 0x64], eax
xor eax, eax
mov dword [ebp - 0x44], eax
xor eax, eax
mov dword [ebp - 0x48], eax
xor eax, eax
mov dword [ebp - 0x4c], eax
cmp dword [ebp - 0x64], 0
je 0x514078
mov al, byte [ebp - 0x2c]
mov edx, dword [ebp - 0x64]
mov byte [edx + 3], al
mov eax, dword [ebp - 0x64]
movzx eax, byte [eax]
add dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x64]
movzx eax, byte [eax + 1]
add dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x64]
movzx eax, byte [eax + 2]
add dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x64]
mov eax, dword [eax + 8]
mov dword [ebp - 0x64], eax
cmp dword [ebp - 0x64], 0
jne 0x514043
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x2c]
lea eax, [eax + edx*4]
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x44]
shl eax, 4
or eax, 0xf
cdq
idiv dword [ebp - 0x30]
mov edx, dword [ebp - 0x70]
mov byte [edx + 2], al
mov eax, dword [ebp - 0x48]
shl eax, 4
or eax, 0xf
cdq
idiv dword [ebp - 0x30]
mov edx, dword [ebp - 0x70]
mov byte [edx + 1], al
mov eax, dword [ebp - 0x4c]
shl eax, 4
or eax, 0xf
cdq
idiv dword [ebp - 0x30]
mov edx, dword [ebp - 0x70]
mov byte [edx], al
mov eax, dword [ebp - 0x70]
mov byte [eax + 3], 0
mov eax, dword [ebp - 0x70]
cmp byte [eax + 2], 0x10
ja 0x5140f2
mov eax, dword [ebp - 0x70]
cmp byte [eax + 1], 0x10
ja 0x5140f2
mov eax, dword [ebp - 0x70]
cmp byte [eax], 0x10
ja 0x5140f2
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x2c]
lea eax, [eax + edx*4]
xor ecx, ecx
mov edx, 4
call fcn.00403ac4
inc dword [ebp - 0x2c]
dec dword [ebp - 0x68]
jne 0x514004
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
add eax, eax
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
shl eax, 3
call fcn.00513694
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
imul dword [ebp - 0x28]
mov dword [ebp - 0x74], eax
mov eax, dword [ebp - 0xc]
xor ecx, ecx
mov edx, dword [ebp - 0x74]
call fcn.00403ac4
mov eax, dword [ebp - 4]
mov eax, dword [eax + 8]
dec eax
test eax, eax
jl 0x5141d7
inc eax
mov dword [ebp - 0x68], eax
mov dword [ebp - 0x2c], 0
mov edx, dword [ebp - 4]
mov edx, dword [edx + 8]
dec edx
sub edx, dword [ebp - 0x2c]
imul edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x54]
call fcn.004df1c8
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x2c]
imul edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0xc]
call fcn.004df1c8
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
dec eax
test eax, eax
jl 0x5141cb
inc eax
mov dword [ebp - 0x6c], eax
mov dword [ebp - 0x30], 0
mov eax, dword [ebp - 0x18]
movzx eax, word [eax]
lea eax, [eax + eax*2]
mov edx, dword [ebp - 0x60]
mov al, byte [edx + eax*4 + 3]
mov edx, dword [ebp - 0x1c]
mov byte [edx], al
mov edx, 2
mov eax, dword [ebp - 0x18]
call fcn.004df1c8
mov dword [ebp - 0x18], eax
mov edx, 1
mov eax, dword [ebp - 0x1c]
call fcn.004df1c8
mov dword [ebp - 0x1c], eax
inc dword [ebp - 0x30]
dec dword [ebp - 0x6c]
jne 0x51418e
inc dword [ebp - 0x2c]
dec dword [ebp - 0x68]
jne 0x51414d
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5141f4
lea eax, [ebp - 0x54]
call fcn.004df184
ret