pryorda / G_MODE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Author: Philipp Reuter
Version: 1.0.0
Generated: Nov 18, 2022
Last Update: Nov 24, 2022
Idea based on: YouTube
Tested OS: Windows 11
G Mode: DELL Game Shift

Prerequisites

  • Alienware Command Center (AWCC)
  • Administrator rights

Introduction

I had found the GMode.exe from the video and liked the program, but I don't like to use EXE files from untrusted sources, so I wrote a Powershell script that can be run with the run.vbs (Visual Basic Script) with one click.

With both Powershell and Visual Basic Script you can easily read the source code with a text editor, but I still explain each line of code here.

Installation (Video)

  1. Download ZIP from the green Code Button in the top right.
  2. Extract the ZIP to any location.

Usage

You have two Options, run.vbs to just simulate the key presses and run_manager.vbs to also automaticly manage AWCC, if its not running or crashed.

  1. Run the "run.vbs" File.

    Presses the Keys to Toggles the G Mode.

  2. Run the "run_manager.vbs" File.

         Checks if AWCC is running.
         Checks if AWCC is installed, if not open a Massage Box to go to the installation webpage.
         If AWCC is installed, starts it if its not running.
         If AWCC is running, but the process is inactive, terminates the process to trigger a restart of it.
         When AWCC is started or restarted, the script waits for special DLLs to be loaded by AWCC.
             Before that the key combination is not processed by AWCC and nothing happens!

    Presses the Keys to Toggles the G Mode.

Code

run.vbs & run_manager.vbs (Visual Basic Script)

current_directory = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")

     Get the current directory.

ps1_script_path = current_directory & "\g_mode.ps1"

     Concatenate current directory with file name to get the path to the script.

cmd = "powershell.exe " & ps1_script_path

     Define the command to run the script.

CreateObject("Wscript.Shell").Run cmd, 0, True

     Run the Script and hide the console.


g_mode.ps1 (Powershell)

Add-Type -MemberDefinition '[DllImport("user32.dll")] public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,UIntPtr dwExtraInfo);' -name t -namespace w32

     Import the "user32.dll" so we can use the keybd_event function.

[w32.t]::keybd_event(0x80,0,0,[UIntPtr]::Zero)

     Use the keybd_event function to press Key Code 0x80 (128).

[w32.t]::keybd_event(0x80,0,0x2,[UIntPtr]::Zero)

     Use the keybd_event function to release Key Code 0x80 (128).

About


Languages

Language:PowerShell 86.3%Language:VBScript 13.7%