unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > Programming > Visual Basic

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2006, 07:23 AM
zero_tolerance zero_tolerance is offline
Senior Member
 
Join Date: Dec 2006
Posts: 289
Default Visual Basic Trainer Example (How to write a visual basic trainer)

By Snake

I found this file i guess its pretty helpful to people who would like to learn how to make trainers in Visual Basic 6..

http://snakeuc.no-ip.com/vbfiles/vbTrainerTemplate.zip

Im guessing since you guys are trying to learn how to write a visual basic trainer you need some help with this.. I will help you guys along.. So I wrote this SEMI-Documentation for this trainer template.

If you notice in the .bas file there is a couple of great premade functions

Before I start out with explaining the functions I will give you some definitions which will help you out.

Definitions

Null: Amounting to nothing; absent or nonexistent: a null result.
Byte: sequence of adjacent bits, usually eight, operated on as a unit by a computer.

When you see &H or 0x in front of a number such as &H505050 or 0x505050 it means the number is hexidecimal (hex). Usualy when you use addresses they are in hex if you need them in decimal just take out the &H or 0x but make sure you convert the number to decimal before you change it. For example 0x505050 (hex) equals 5263440 in decimal.. So REMEMBER to make sure the numbers are right..

Now I will start expalining the most important functions located in the .bas file mdMemory.bas. If anything is wrong on this feel free to correct me Ok lets get started.


Functions Documentation

-
GameCheck(ByVal GameTxt As String) As Boolean
What this does is checks if there is a program running with the window title GameTxt. If there is a window with that title GameCheck() returns true.. If there is no window with that title it returns false..
-

-
ReadBytes(GameTxt As String, Address As Long, vBuffer As Long, vLength As Long)
What this does is read bytes from memory.
GameTxt is the window title ( see GameCheck() ).
Address is the address to read bytes from
vBuffer is where to store the bytes read from memory
vLength is the length to read in byttes

For example if i wanted to read the address 4bytes from the game minesweeper at the address 0x1005194 in memory i would do..

Dim vBuffer As Long
ReadBytes("Minesweeper", &H1005194, vBuffer, 4)

Then you could do stuff with vBuffer.
-

-
ReadFloat(GameTxt As String, Address As Long, vBuffer As Single, vLength As Long)
SEE ReadBytes()
-

-
WriteBytes(ByVal GameTxt As String, ByVal Address As Long, ByRef Buffer() As Byte)
Now this is probably what your reading this for.. How to write bytes.. This is equivelent to the TMK code Poke. What this does is write bytes to a specific address in memory.
GameTxt is the game's window title
Address is the address you want to write to
Buffer() is the bytes you want to write

For example if you wanted to nop 4 bytes at the address 0x1005194 in Minesweeper you would do..

Dim Buffer(3) As Byte
Buffer(0) = &H90
Buffer(1) = &H90
Buffer(2) = &H90
Buffer(3) = &H90

WriteBytes("Minesweeper", &H1005194, Buffer())

If you are confused with why it says (3) in Dim Buffer(3) As Byte when we are supposed to be writing 4 bytes. It is becuase arrays start at (0) so if we start at (1) it will mess up becuase (0) would be a null value.
-

These are the most important functions the other ones as self explanatory if you need help with these or other functions in the trainer template feel free to ask your questions we will help you

Hopefully this helped,
-Snake

Visit my site for more tutorials, and other helpful visual basic files. Tutorials added daily.
http://snakeuc.no-ip.com
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
basic, trainer, visual, write

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 08:38 PM.