Source Code C# Trainner Class with Generic Methods

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

WiinnerMLG

Full Member
May 19, 2019
10
213
2
How long you been coding/hacking?
Programming (2 years) / Hacking (5 months)
Hello, Guided Hacking comunity! I'm here for share my C# trainner class I did while cheating CS:GO.

The features of my class is:

- Imports:
- - WriteProcessMemory Function
- - ReadProcessMemory Function
- - GetKeyState Function (Used for get a KeyEvent)
- - SetCursorPos Function (Used for Aimbot without write in memory)
- - mouse_event Function (Used for TriggerBot without write in memory)
- - FindWindow Function (Used for get a window handle)
- - GetWindowRect Function (Used for get a Rect from a window)
- - GetWindowLong Function (Used for hide a form to make ESP)
- - SetWindowLong Function (Used for hide a form to make ESP)

- Methods:
- - WriteMem<T> (WriteProcessMemory Function Generic)
- - ReadMem<T> (ReadProcessMemory Function Generic)
- - ReadMatrix<T> (Function to read a Matrix Generic)
- - ConvertToFloatArray (Function to convert byte array in float array)
- - GetModule (Function to get a module of a process by name)

- Structs:
- - Rect
- - Vec2
- - Vec3

All things I did in my CS:GO was using this class :).
 

Attachments

Akaion

Wizard
Meme Tier VIP
Trump Tier Donator
Oct 13, 2018
234
7,968
14
Hello, Guided Hacking comunity! I'm here for share my C# trainner class I did while cheating CS:GO.

The features of my class is:

- Imports:
- - WriteProcessMemory Function
- - ReadProcessMemory Function
- - GetKeyState Function (Used for get a KeyEvent)
- - SetCursorPos Function (Used for Aimbot without write in memory)
- - mouse_event Function (Used for TriggerBot without write in memory)
- - FindWindow Function (Used for get a window handle)
- - GetWindowRect Function (Used for get a Rect from a window)
- - GetWindowLong Function (Used for hide a form to make ESP)
- - SetWindowLong Function (Used for hide a form to make ESP)

- Methods:
- - WriteMem<T> (WriteProcessMemory Function Generic)
- - ReadMem<T> (ReadProcessMemory Function Generic)
- - ReadMatrix<T> (Function to read a Matrix Generic)
- - ConvertToFloatArray (Function to convert byte array in float array)
- - GetModule (Function to get a module of a process by name)

- Structs:
- - Rect
- - Vec2
- - Vec3

All things I did in my CS:GO was using this class :).
Some improvements that you could do

- Use SafeHandles instead of IntPtr's for handles

- Replace your marshalling (where possible) with the new Unsafe namespace i.e. instead of Marshal.Copy use Unsafe.WriteUnaligned

- Check the return values of your functions

Other than that, definitely some of the better C# code I've seen lately :))
 
  • Like
Reactions: WiinnerMLG

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,349
78,998
2,412
Thank you for sharing with us, if Akaion says the code is good, then it must be pretty nice!
 
  • Like
Reactions: WiinnerMLG

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,349
78,998
2,412
- Replace your marshalling (where possible) with the new Unsafe namespace i.e. instead of Marshal.Copy use Unsafe.WriteUnaligned
I just tried this for the first time, wtf C# is lit

C++:
private static unsafe void Main(string[] args)
{
    int xxx = 5;
    int* p = &xxx;
    float* pp = (float*)p;
}
 
  • Haha
Reactions: obdr and Petko123

Boboo99

Scrub
Dank Tier VIP
Fleep Tier Donator
Feb 20, 2016
477
12,178
44
I just tried this for the first time, wtf C# is lit

C++:
private static unsafe void Main(string[] args)
{
    int xxx = 5;
    int* p = &xxx;
    float* pp = (float*)p;
}
My man discovered the unholy lands of unsafe.
 
  • Haha
Reactions: Petko123

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,349
78,998
2,412
My man discovered the unholy lands of unsafe.
I've got a huge boner for C# right because of this, it seriously changes everything. When I have time I'm gonna learn more C# because I have lots of useful app ideas but GUI in C++ is too annoying
 

Akaion

Wizard
Meme Tier VIP
Trump Tier Donator
Oct 13, 2018
234
7,968
14
I've got a huge boner for C# right because of this, it seriously changes everything. When I have time I'm gonna learn more C# because I have lots of useful app ideas but GUI in C++ is too annoying
If you want to use managed code and still have the performance / flexibility of unmanaged without using the unsafe keyword take a look at Span<T> + MemoryMarshal (for working with local mem) and System.Runtime.CompilerServices.Unsafe (for things like reinterpretting)
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,349
78,998
2,412
If you want to use managed code and still have the performance / flexibility of unmanaged without using the unsafe keyword take a look at Span<T> + MemoryMarshal (for working with local mem) and System.Runtime.CompilerServices.Unsafe (for things like reinterpretting)
I like the absolute beauty of using regular C casts in C# tho :p
 

Akaion

Wizard
Meme Tier VIP
Trump Tier Donator
Oct 13, 2018
234
7,968
14
I like the absolute beauty of using regular C casts in C# tho :p
All those years the .Net team spent making safety barriers thrown away :((

For real though if you're gonna be working with raw pointer casts just remember char* is a 2 byte unicode character in C# and has been the source of many many headaches
 
  • Like
Reactions: Rake
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods