Skip to content

Commit

Permalink
Extended
Browse files Browse the repository at this point in the history
1.3 - Added network functions
1.4 - Anti AntiIdling
  • Loading branch information
Ch4rg3r committed Jul 28, 2018
1 parent 170c661 commit cc27ddb
Show file tree
Hide file tree
Showing 40 changed files with 592 additions and 50 deletions.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
Binary file added .vs/SessionSweeper/v15/.suo
Binary file not shown.
Binary file added .vs/VSWorkspaceState.json
Binary file not shown.
Binary file added .vs/slnx.sqlite
Binary file not shown.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
**GTA V Online - SessionSweeper 1.2**<br>
Press *Pause/Break* to disconnect from everyone in your current session and be alone.<br>
Press *Scroll Lock* to toggle lock your current session and stop people from joining.<br>
<br>
**Links:**<br>
**[Download (Dropbox)](https://www.dropbox.com/s/hysn2p2qli54uvy/SessionSweeper.exe?dl=1)<br>
[Download (ZippyShare)](http://www35.zippyshare.com/d/mboO3P7U/12602/SessionSweeper.exe)<br>
[VirusTotal](https://virustotal.com/nl/file/3eb8636c8ceb6acdd9ef1961364f242e162977f82dc0be69fa83dee1c27d3b23/analysis/) | [Reverse.it](https://www.reverse.it/sample/3eb8636c8ceb6acdd9ef1961364f242e162977f82dc0be69fa83dee1c27d3b23?environmentId=100)**<br>
<br>
Press *Print Screen* to disconnect and reconnect internet.<br>
Press *End* to Enable/Disable anti idle.<br>
[![Donate](http://i.imgur.com/FtaJpum.gif)](https://paypal.me/groupload "Donate")<br>
<br>
**Official Threads:<br>
Expand Down
Binary file not shown.
Binary file modified SessionSweeper/.vs/SessionSweeper/v15/.suo
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions SessionSweeper/SessionSweeper/DataStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ class DataStorage
{
public static Process pGTAV;
public static bool LobbyLocked = false;
public static bool AntiIdlingActive = false;

public static WinFirewall.FWCtrl FirewallControl = new WinFirewall.FWCtrl();
public static MouseEventControl MouseEventControl = new MouseEventControl();

public static System.Media.SoundPlayer pSweeped = new System.Media.SoundPlayer(Properties.Resources.sweeped);
public static System.Media.SoundPlayer pPending = new System.Media.SoundPlayer(Properties.Resources.pending);
Expand Down
303 changes: 303 additions & 0 deletions SessionSweeper/SessionSweeper/MouseEventControl.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SessionSweeper
{
//https://alala666888.wordpress.com/2010/09/17/simulate-mouse-event-using-sendinput-and-setcursorpos/
public class MouseEventControl : IDisposable
{
private Timer _timer = new Timer();
private int _mouseMove = _screenWidth / 4 * (65535 / _screenWidth);
private bool _isMouseMove = false;
private static int _screenWidth = GetSystemMetrics(SM_CXSCREEN) - 1;
private static int _screenHeight = GetSystemMetrics(SM_CYSCREEN) - 1;
private static int _halfScreenX = _screenWidth / 2 * (65535 / _screenWidth);
private static int _halfScreenY = _screenHeight / 2 * (65535 / _screenHeight);

public MouseEventControl()
{
_timer.Interval = 1000;
_timer.Tick += OnTimerTick;
}

private void OnTimerTick(object sender, EventArgs e)
{
if (!_isMouseMove)
{
INPUT input = new INPUT();
input.type = SendInputEventType.InputMouse;
input.mkhi.mi.dwFlags = MouseEventFlags.ABSOLUTE | MouseEventFlags.MOVE;
input.mkhi.mi.dx = _halfScreenX + _mouseMove;
input.mkhi.mi.dy = _halfScreenY;
uint i = SendInput(1, ref input, Marshal.SizeOf(new INPUT()));

_isMouseMove = !_isMouseMove;
}
else
{
INPUT input = new INPUT();
input.type = SendInputEventType.InputMouse;
input.mkhi.mi.dwFlags = MouseEventFlags.ABSOLUTE | MouseEventFlags.MOVE;
input.mkhi.mi.dx = _halfScreenX - _mouseMove;
input.mkhi.mi.dy = _halfScreenY;
uint i = SendInput(1, ref input, Marshal.SizeOf(new INPUT()));

_isMouseMove = !_isMouseMove;
}
}

public void Start()
{
_timer.Start();
}

public void Stop()
{
_timer.Stop();
}

public void Dispose()
{
if (_timer.Enabled)
{
_timer.Stop();
}
_timer.Tick -= OnTimerTick;
}


[DllImport("user32.dll")]
static extern IntPtr GetMessageExtraInfo();

[DllImport("user32.dll", SetLastError = true)]
static extern uint SendInput(uint nInputs, ref INPUT pInputs, int cbSize);

[DllImport("user32.dll")]
static extern bool SetCursorPos(int X, int Y);

[DllImport("user32.dll")]
static extern int GetSystemMetrics(int nIndex);

static int SM_CXSCREEN = 0;
static int SM_CYSCREEN = 1;

[Flags]
public enum MouseEventFlags
{
LEFTDOWN = 0x00000002,
LEFTUP = 0x00000004,
MIDDLEDOWN = 0x00000020,
MIDDLEUP = 0x00000040,
MOVE = 0x00000001,
ABSOLUTE = 0x00008000,
RIGHTDOWN = 0x00000008,
RIGHTUP = 0x00000010
}

/// <summary>
/// The event type contained in the union field
/// </summary>
enum SendInputEventType : int
{
/// <summary>
/// Contains Mouse event data
/// </summary>
InputMouse,
/// <summary>
/// Contains Keyboard event data
/// </summary>
InputKeyboard,
/// <summary>
/// Contains Hardware event data
/// </summary>
InputHardware
}


/// <summary>
/// The mouse data structure
/// </summary>
[StructLayout(LayoutKind.Sequential)]
struct MouseInputData
{
/// <summary>
/// The x value, if ABSOLUTE is passed in the flag then this is an actual X and Y value
/// otherwise it is a delta from the last position
/// </summary>
public int dx;
/// <summary>
/// The y value, if ABSOLUTE is passed in the flag then this is an actual X and Y value
/// otherwise it is a delta from the last position
/// </summary>
public int dy;
/// <summary>
/// Wheel event data, X buttons
/// </summary>
public uint mouseData;
/// <summary>
/// ORable field with the various flags about buttons and nature of event
/// </summary>
public MouseEventFlags dwFlags;
/// <summary>
/// The timestamp for the event, if zero then the system will provide
/// </summary>
public uint time;
/// <summary>
/// Additional data obtained by calling app via GetMessageExtraInfo
/// </summary>
public IntPtr dwExtraInfo;
}

[StructLayout(LayoutKind.Sequential)]
struct KEYBDINPUT
{
public ushort wVk;
public ushort wScan;
public uint dwFlags;
public uint time;
public IntPtr dwExtraInfo;
}

[StructLayout(LayoutKind.Sequential)]
struct HARDWAREINPUT
{
public int uMsg;
public short wParamL;
public short wParamH;
}

/// <summary>
/// Captures the union of the three three structures.
/// </summary>
[StructLayout(LayoutKind.Explicit)]
struct MouseKeybdhardwareInputUnion
{
/// <summary>
/// The Mouse Input Data
/// </summary>
[FieldOffset(0)]
public MouseInputData mi;

/// <summary>
/// The Keyboard input data
/// </summary>
[FieldOffset(0)]
public KEYBDINPUT ki;

/// <summary>
/// The hardware input data
/// </summary>
[FieldOffset(0)]
public HARDWAREINPUT hi;
}

/// <summary>
/// The Data passed to SendInput in an array.
/// </summary>
/// <remarks>Contains a union field type specifies what it contains </remarks>
[StructLayout(LayoutKind.Sequential)]
struct INPUT
{
/// <summary>
/// The actual data type contained in the union Field
/// </summary>
public SendInputEventType type;
public MouseKeybdhardwareInputUnion mkhi;
}
}

/*public class MouseEventControl : IDisposable
{
private Timer _timer = new Timer();
private int _mouseMax = 1000;
private int _mouseMin = 0;
private int _lastVal = 0;
public MouseEventControl()
{
_timer.Interval = 1000;
_timer.Tick += OnTimerTick;
}
private void OnTimerTick(object sender, EventArgs e)
{
if(_lastVal==_mouseMin)
{
MousePoint mp = new MousePoint(_mouseMax, 0);
MouseEvent(MouseEventFlags.Move, mp);
_lastVal = _mouseMax;
}
else if (_lastVal == _mouseMin)
{
MousePoint mp = new MousePoint(_mouseMin, 0);
MouseEvent(MouseEventFlags.Move, mp);
_lastVal = _mouseMin;
}
}
public void Start()
{
_timer.Start();
}
public void Stop()
{
_timer.Stop();
}
[Flags]
public enum MouseEventFlags
{
LeftDown = 0x00000002,
LeftUp = 0x00000004,
MiddleDown = 0x00000020,
MiddleUp = 0x00000040,
Move = 0x00000001,
Absolute = 0x00008000,
RightDown = 0x00000008,
RightUp = 0x00000010
}
[DllImport("user32.dll")]
private static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo);
public static void MouseEvent(MouseEventFlags value, MousePoint position)
{
mouse_event
((int)value,
position.X,
position.Y,
0,
0)
;
}
public void Dispose()
{
if (_timer.Enabled)
{
_timer.Stop();
}
_timer.Tick -= OnTimerTick;
}
[StructLayout(LayoutKind.Sequential)]
public struct MousePoint
{
public int X;
public int Y;
public MousePoint(int x, int y)
{
X = x;
Y = y;
}
}
}*/
}
31 changes: 31 additions & 0 deletions SessionSweeper/SessionSweeper/NetworkConnectionControl.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;

namespace SessionSweeper
{
class NetworkConnectionControl
{
public static void Disconnect()
{
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "ipconfig";
info.Arguments = "/release";
info.WindowStyle = ProcessWindowStyle.Hidden;
Process p = Process.Start(info);
p.WaitForExit();
}
public static void Connect()
{
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = "ipconfig";
info.Arguments = "/renew";
info.WindowStyle = ProcessWindowStyle.Hidden;
Process p = Process.Start(info);
p.WaitForExit();
}
}
}
Loading

0 comments on commit cc27ddb

Please sign in to comment.