Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.IO.Pipes;
- using System.Runtime.InteropServices;
- using System.Windows.Forms;
- namespace GR3NY_V4
- {
- // Token: 0x02000007 RID: 7
- internal class NamedPipes
- {
- // Token: 0x0600001C RID: 28
- [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- private static extern bool WaitNamedPipe(string name, int timeout);
- // Token: 0x0600001D RID: 29 RVA: 0x00002D28 File Offset: 0x00000F28
- public static bool NamedPipeExist(string pipeName)
- {
- bool result;
- try
- {
- int timeout = 0;
- if (!NamedPipes.WaitNamedPipe(Path.GetFullPath(string.Format("\\\\\\\\.\\\\pipe\\\\{0}", pipeName)), timeout))
- {
- int lastWin32Error = Marshal.GetLastWin32Error();
- if (lastWin32Error == 0)
- {
- result = false;
- return result;
- }
- if (lastWin32Error == 2)
- {
- result = false;
- return result;
- }
- }
- result = true;
- }
- catch (Exception)
- {
- result = false;
- }
- return result;
- }
- // Token: 0x0600001E RID: 30 RVA: 0x00002D84 File Offset: 0x00000F84
- public static void LuaPipe(string script)
- {
- if (NamedPipes.NamedPipeExist(NamedPipes.luapipe))
- {
- try
- {
- using (NamedPipeClientStream namedPipeClientStream = new NamedPipeClientStream(".", NamedPipes.luapipe, PipeDirection.Out))
- {
- namedPipeClientStream.Connect();
- using (StreamWriter streamWriter = new StreamWriter(namedPipeClientStream))
- {
- streamWriter.Write(script);
- streamWriter.Dispose();
- }
- namedPipeClientStream.Dispose();
- }
- return;
- }
- catch (IOException)
- {
- MessageBox.Show("Connection to pipe", "Connection Error!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
- return;
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message.ToString());
- return;
- }
- }
- MessageBox.Show("Please inject" + Functions.exploitdll + "!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
- }
- // Token: 0x04000019 RID: 25
- public static string luapipe = "GR3NY";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement