I remember this from AGES ago from when I first came to the programming section. Nice that you're bringing it back. :3 Erm, sure I'll contribute something when I come up with an idea.
Okay guys, I think it's time we restarted the MPGH SDK. I'm going to be coding it over time anyway, but people are welcome to submit. This release will be Open Source, and an ongoing project so that it can continually be improved upon.
If there are any specific features you want added, post them in the following format:
If you are coding it yourself, submit the code in the thread.Code:Feature Name: What does it aim to do: Can you code it yourself:
NOTE: This isn't going to be a shitfest of coding with hundreds of different conventions so please apply the following rules to your code before submitting it:
Now, these snippets are going to be 100% opensource, so feel free to comment on anyone's work if you think there are improvements to be made on their code (reduce repetitive code, decrease iterations..etc) FLAMING WILL NOT BE TOLERATED.Code:MUST BE RE-USABLE -dont harcode your function to be applicable in just one case, consider adding extra parameters or overloads to make your code flexible in a variety of situations. MUST HAVE DOCUMENTATION -don't overcomment every line of code, but as this is an open source release it is designed for learning as well as just using, please take the time to explain what certain lines of code are doing. Also consider adding XML comments to each of your functions. MUST BE EASY TO INTEGRATE -this ties in with being re-usable. Make sure your code can be used from any context (consider making your functions Shared) ALL EXCEPTIONS MUST BE CHECKED -be realistic with this, don't just wrap your whole code in a Try-Catch block. There will be an error log for the SDK class, which can be appended to with the AppendError function (which returns false and appends the single string param to the ErrorLog) so please consider using that to provide detailed error support arising from your function. MUST HAVE AN EXAMPLE -provide at least one example of your function being used (don't just call the function with pseudo-values, use it in a PROPER context)
There will be another thread for the actual release of the SDK, which will be made as soon as a basic collection of functions can be compiled. In that thread, all contributors up to and including the latest safe release will be credited for their work.
This is your chance to be part of an MPGH project, so post your ideas below.
Here's a few of the basic classes I already have/am going to add
C#.NET is acceptable, as I can just export it as a dll and reference it to the SDK.Code:Keyboard Hook Mouse Hook External Access class (Call functions from remote processes) Injection String Library (basic string manipulation functions)
PLEASE MAKE SURE YOUR CODE IS NEAT, I DON'T WANT TO REFACTOR EVERYTHING.
Have at it, I'm hoping for a good response.
NB: If you are submitting an encryption algorithm or something that could be compromised by having it in the public domain, feel free to PM the source to me rather than posting in the thread. I still need to check it and add it to the project.
Last edited by Jason; 09-04-2011 at 10:41 PM.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
I remember this from AGES ago from when I first came to the programming section. Nice that you're bringing it back. :3 Erm, sure I'll contribute something when I come up with an idea.
Donate:
BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9
Handy Tools/Hacks:
Extreme Injector v3.7.3
A powerful and advanced injector in a simple GUI.
Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!
Minion Since: 13th January 2011
Moderator Since: 6th May 2011
Global Moderator Since: 29th April 2012
Super User/Unknown Since: 23rd July 2013
'Game Hacking' Team Since: 30th July 2013
--My Art--
[Roxas - Pixel Art, WIP]
[Natsu - Drawn]
[Natsu - Coloured]
All drawings are coloured using Photoshop.
--Gifts--
[Kyle]
OH YEAAAAAAAAAAA, finally some promise in the VB section.
THE EYE OF AN ADMINISTRATOR IS UPON YOU. ANY WRONG YOU DO IM GONNA SEE, WHEN YOU'RE ON MPGH, LOOK BEHIND YOU, 'CAUSE THATS WHERE IM GONNA BE
"First they ignore you. Then they laugh at you. Then they fight you. Then you lose.” - Dave84311
HAVING VIRTUAL DETOX
I might end up contributing, but not in VB ; D
Light travels faster than sound. That's why most people seem bright until you hear them speak.
I'll contribute but in C# ;]
Okay spent a few hours on this last night the following are complete (or close to)
I will be posting the base with what I have so far when I get home so that people can start familiarizing themselves with the source.Code:Generic Windows Hook. Keyboard Hook Mouse Hook API Class (just contains the definitions for a whole heap of API method, plus a few custom ones of my own) External Access class (create pointers in remote memory, execute threads, call remote functions...etc) Process Handle class (easy creation and management of external process access)
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
Feature name: Audio file playback (.wav)
What it aims to do: Enable playback of .wav files
Can you code it yourself: Yes, though it's not complex, just a function in .NET that people might not know about. I'm a bit of a noob, but I'm trying to help. :/
Example:
NOTE: You can, instead of calling Play(), use PlayLooping to loop a .wav file.Code:using System; using System.Media; public static void WavPlay(string FileName) { try //Code placed in try...catch block to catch exceptions. { //Note: Not all exceptions are handled by this code. Just a common one. SoundPlayer Player = new SoundPlayer(); //Instance of SoundPlayer class Player.SoundLocation = FileName; //Set Soundlocation to FileName. Player.Play(); //Call the Play() function on our SoundPlayer object. } catch (FileNotFoundException) { return; //If this exception is thrown, the function simply returns. } }
EDIT: There's no need to create a new thread for playing .wav in this manner, these functions, when called, automatically create a new thread for playing the file.
Feature name: Ping() function with overloads
What it aims to do: Ping an IP address/Remote host
Can you code it yourself: It's another simple function, with added simplification and overloads for easier use. Again, I'm a noob and I just wanna help, so please give constructive criticism and don't flame and emotionally scar me. -_-
NOTE: You can either use SendAsync() or start another thread and execute this function on it if you want your app to be multi-threaded.Code:using System; using System.Net.NetworkInformation; public static void Ping(string AddressOrHost) { try { System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping(); ping.Send(AddressOrHost, 1000); } catch (System.Net.NetworkInformation.PingException) { return; } }//Pings the specified IP Address or Host Name. One second timeout. public static void Ping(string AddressOrHost, int TimeOut) { try { System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping(); ping.Send(AddressOrHost, TimeOut); } catch (System.Net.NetworkInformation.PingException) { return; } }//Pings the specified IP Address or Host Name with the specified Timeout. public static void Ping(string AddressOrHost, int TimeOut, byte[] PingBuffer) { try { System.Net.NetworkInformation.Ping ping = new System.Net.NetworkInformation.Ping(); ping.Send(AddressOrHost, TimeOut, PingBuffer); } catch (System.Net.NetworkInformation.PingException) { return; } }
Edit: Forgot to mention in comments, not all possible exceptions are handled, just a common one. Also, it's 3:15 A.M. and I'm a nub so please don't flame too hard if everything I post fails utterly.
Feature: Get a list of all available drives and display info on them in the console output stream.
what it aims to do: stated above.
can you code it yourself: Yes, no, maybe, probably, here it is:
NOTE: All exceptions that the System.IO.DriveInfo.GetDrives() function can throw have been handled. Also note that this is obviously written for console programs, but the idea behind it is fairly universal and can be used in other types of apps. If this is of any use to anyone, I'm sure you'll know enough about C# to change it to suit your needs. Again, sorry for being a noob, if these noobish functions I'm posting are too nubby and shitty just tell me and I'll stop.Code:using System; using System.IO; public static void DriveScan() { DriveInfo[] DriveList = System.IO.DriveInfo.GetDrives(); try { foreach (DriveInfo n in DriveList) {///Returns info for every drive in the system. if (n.IsReady == true) { Console.WriteLine("Drive Name: "); Console.WriteLine(n.Name); Console.WriteLine("Root Directory: "); Console.WriteLine(n****otDirectory.FullName); Console.WriteLine("File System Type/Format: "); Console.WriteLine(n.DriveFormat); Console.WriteLine("Total Size: "); Console.WriteLine(n.TotalSize.ToString()); Console.WriteLine("Available Free Space: "); Console.WriteLine(n.AvailableFreeSpace.ToString()); Console.WriteLine("Total Free Space: "); Console.WriteLine(n.TotalFreeSpace.ToString()); Console.WriteLine("Type: "); Console.WriteLine(n.DriveType.ToString()); Console.WriteLine("~:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:~"); } } } catch (UnauthorizedAccessException e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); return; } catch (IOException e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); return; } }
Feature name: CS and VB compiler
what it aims to do: compiles .cs or .vb source file to an executable or dll.(exe/dll changed in source)
can you code it yourself: No, I found this using google, so I used it to further my knowledge of C# and .NET. I'm sure someone can use this function.
NOTE: change string exeName to .dll and GenerateExecutable to false to compile a class library to .dll; Also, I've found that there are methods to add references to .NET libraries, otherwise you can't use anything that needs assembly references. I'm sure someone will find a use, but still, let me know if I'm being a pest in this thread.Code:using System; using System.CodeDom.Compiler; using Microsoft.CSharp; using Microsoft.CSharp.RuntimeBinder; using Microsoft.VisualBasic; public static bool CompileExecutable(String sourceName) { FileInfo sourceFile = new FileInfo(sourceName); CodeDomProvider provider = null; bool compileOk = false; retry: // Select the code provider based on the input file extension. if (sourceFile.Extension.ToUpper(CultureInfo.InvariantCulture) == ".CS") { provider = CodeDomProvider.CreateProvider("CSharp"); } else if (sourceFile.Extension.ToUpper(CultureInfo.InvariantCulture) == ".VB") { provider = CodeDomProvider.CreateProvider("VisualBasic"); } else { Console.WriteLine("Source file must have a .cs or .vb extension"); Console.ReadLine(); goto retry; } if (provider != null) { // Format the executable file name. // Build the output assembly path using the current directory // and <source>_cs.exe or <source>_vb.exe. String exeName = String.Format(@"{0}\{1}.exe", //change .exe to .dll System.Environment.CurrentDirectory, sourceFile.Name.Replace(".", "_")); CompilerParameters cp = new CompilerParameters(); // Generate an executable instead of // a class library. cp.GenerateExecutable = true; //change this to false to compile .dll // Specify the assembly file name to generate. cp.OutputAssembly = exeName; // Save the assembly as a physical file. cp.GenerateInMemory = false; // Set whether to treat all warnings as errors. cp.TreatWarningsAsErrors = false; // Invoke compilation of the source file. CompilerResults cr = provider.CompileAssemblyFromFile(cp, sourceName); if (cr.Errors.Count > 0) { // Display compilation errors. Console.WriteLine("Errors building {0} into {1}", sourceName, cr.PathToAssembly); foreach (CompilerError ce in cr.Errors) { Console.WriteLine(" {0}", ce.ToString()); Console.WriteLine(); } } else { // Display a successful compilation message. Console.WriteLine("Source {0} built into {1} successfully.", sourceName, cr.PathToAssembly); } // Return the results of the compilation. if (cr.Errors.Count > 0) { compileOk = false; } else { compileOk = true; } } return compileOk; }
Last edited by t7ancients; 09-06-2011 at 01:34 AM.
Feature: Simple Xor encryption of a string.
what it does: basically just obfuscates data by performing a bitwise-or operation on every character in a string using a given integer key.
Not strong encryption. There are many problems with using XOR encryption, but it normally keeps data from the general user's eyes.
can you code it yourself: I looked this up to learn about it, but now I'm confident I could write fairly complex encryption schemes. NOTE: This is not my code, I found it using google. Lol.
Code:using System; using System.Text; public static string XOR_String(string TextToEncrypt, int Key) { StringBuilder InSb = new StringBuilder(TextToEncrypt); StringBuilder OutSb = new StringBuilder(TextToEncrypt.Length); char c; for (int i = 0; i < TextToEncrypt.Length; i++) { c = InSb[i]; c = (char)(c ^ Key); OutSb.Append(c); } return OutSb.ToString(); }
Last edited by t7ancients; 09-06-2011 at 02:00 AM.
Just so you know, this isn't a "Snippets Vault", I'm not asking people to throw in a bunch of 2 line snippets which just reduce the length of an existing .NET function, this is proper development of re-usable functions, organized into classes.
@freedompeace I wasn't really clear, I had something else in mind, but yeah.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
freedompeace (09-06-2011)
Sorry, I'm new to this. I'm not very smart. Lol. I normally don't contribute, actually, I never have. So I really don't know much about much.
@t7ancients, THIS is what I'm talking about. Here is one of the smaller classes I wrote today and last night.
[highlight=vb.net]
Partial Public Class SDK
''' <summary>Generic Windows Hook shell class, provides a skeleton to be built on by inheriting classes.</summary>
Public MustInherit Class WinHook : Implements IDisposable
''' <summary>Hook delegate method that is called by the system.</summary>
'''<param name="nCode">The hook code passed to the current hook procedure. The next hook procedure uses this code to determine how to process the hook information.</param>
'''<param name="wParam">The wParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain.</param>
'''<param name="lParam">The lParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain. Usually a pointer to data.</param>
''' <returns>Returns the value of CallNextHookEx</returns>
Public Delegate Function HookDelegate(ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
Public Enum HookType
WH_CALLWNDPROC = 4
WH_CALLWNDWNDPROCRET = 12
WH_CBT = 5
WH_DEBUG = 9
WH_FOREGROUNDIDLE = 11
WH_GETMESSAGE = 3
WH_JOURNALPLAYBACK = 1
WH_JOURNALRECORD = 0
WH_KEYBOARD = 2
WH_KEYBOARD_LL = 13
WH_MOUSE = 7
WH_MOUSE_LL = 14
WH_MSGFILTER = -1
WH_SHELL = 10
WH_SYSMSGFILTER = 6
End Enum
#Region "Properties"
''' <summary>The ID of the current hook. Private so that users cannot externally free this hook with UnhookWinowsHookEx and ruin this class instance.</summary>
Private Property HookId As Integer
Private _ishk As Boolean = False
''' <summary>The current state of the hook.</summary>
Public Property IsHooked As Boolean
Get
Return Me._ishk
End Get
Private Set(ByVal value As Boolean)
Me._ishk = value
End Set
End Property
#End Region
''' <summary>Inheritance-only constructor. Assumes that the Overridable "HookCallBack" method is overridden in the child class.</summary>
''' <param name="hookType">Type of hook to set</param>
''' <param name="hModule">Target module for the hook (optional, default: 0)</param>
''' <param name="threadID">Target thread for the hook (optional, default: 0</param>
''' <remarks>Although the hModule and threadID params are marked "Optional", some hook types require valid values.</remarks>
Protected Sub New(ByVal hookType As WinHook.HookType, Optional ByVal hModule As UInt32 = 0, Optional ByVal threadId As Integer = 0)
Me.HookId = WinAPI.SetWindowsHookEx(hookType, New WinHook.HookDelegate(AddressOf Me.HookCallback), hModule, threadId) 'attempt to set the hook with the specified values.
Me.IsHooked = Me.HookId > 0 'make sure we have a valid hook id before setting "IsHooked" to true.
End Sub
'''<summary>Overridable method that is invoked by the HookDelegate when the hook is processed by the system. Overriding methods should make a call back to this original method before ending to call the next hook in the chain.</summary>
'''<param name="nCode">The hook code passed to the current hook procedure. The next hook procedure uses this code to determine how to process the hook information.</param>
'''<param name="wParam">The wParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain.</param>
'''<param name="lParam">The lParam value passed to the current hook procedure. The meaning of this parameter depends on the type of hook associated with the current hook chain. Usually a pointer to data.</param>
''' <returns>The value of CallNextHookEx</returns>
''' <remarks>Inherited classes should override this method (although a call should still be made to the original).</remarks>
Protected Overridable Function HookCallback(ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
Return WinAPI.CallNextHookEx(Me.HookId, nCode, wParam, lParam) 'make sure to call the next hook.
End Function
#Region "IDisposable"
Private disposedValue As Boolean
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
If Me.HookId > 0 AndAlso Me.IsHooked Then
Me.IsHooked = WinAPI.UnhookWindowsHookEx(Me.HookId)
If Not Me.IsHooked Then Me.HookId = 0
End If
End If
End If
Me.disposedValue = True
End Sub
Public Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region
End Class
End Class
[/highlight]
As you can see, it's designed with complete re-usability in mind. The whole point of this SDK is not to re-implement existing .NET functions (unless they are absolutely shit), sure small re-implementation methods will occur here and there but they aren't the core of the SDK. The aim is to create classes with a very broad scope, with specific methods tailor made to fit.
Last edited by Jason; 09-07-2011 at 02:35 AM.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
So... make everything as modular, extensible, and object-oriented as possible?
Considering VB.NET is object-oriented, yes. The classes need to be user-friendly and classes such as the WinHook class above needs to be easy to tailor to any situation. As I said before, we're not looking for a jumble of snippets, though many small functions will inevitably be included as the SDK advances.
You can win the rat race,Originally Posted by Jeremy S. Anderson
But you're still nothing but a fucking RAT.
++Latest Projects++
[Open Source] Injection Library
Simple PE Cipher
FilthyHooker - Simple Hooking Class
CLR Injector - Inject .NET dlls with ease
Simple Injection - An in-depth look
MPGH's .NET SDK
eJect - Simple Injector
Basic PE Explorer (BETA)
Nice but i dont understand anything :P
My New Sig