Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Visual basic trainers?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Tom331
Cheater
Reputation: 0

Joined: 14 Jul 2007
Posts: 25

PostPosted: Mon Mar 24, 2008 1:02 pm    Post subject: Visual basic trainers? Reply with quote

Well, I always used to just use TMK for my trainers, but decided that i would start using VB instead (i know a bit about it and how to make simple apps)
After some googling i found this module
Code:
'Add the below to a module.
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Declare Function Hotkey Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
'Make your Function below Example "LAB"
Public Function LAB(address As Long, value As Long)
Dim handle As Long, processID As Long, ProcessHandle As Long, gamewindowtext As String, bytes As Byte
handle = FindWindow(vbNullString, "Windows Live Messenger") 'Here is your games window name MUST BE CORRECT NAME
GetWindowThreadProcessId handle, processID
ProcessHandle = OpenProcess(&H1F0FFF, True, processID)
WriteProcessMemory ProcessHandle, address, value, 1, 0
CloseHandle ProcessHandle
End Function

and you use this in your button code
Code:
Call LAB(&H"address", &H"value")

So to test it i made a simple minesweeper trainer and it worked, but ive decided to make a Windows Live Messenger infinate nudge thing.
I searched for the values ect and found these address's
Code:
621530
58BE67

When i freeze them in the autohack window of TSearch it gives me infinate nudges, however when i put this in the code of a button it just crashes windows live messenger
Code:
'Call LAB(&H621530, &H9090)
'Call LAB(&H58BE67, &H9090)

Could anyone help me please Smile

Thanks
(i also tried useing just "&H90" and it still crashes)
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Mar 24, 2008 1:42 pm    Post subject: Reply with quote

The opcodes at 621530 and 58BE67 are probably longer than 2 bytes. (and "freezing" is nothing but constantly writing a value, nop'ing an address is something else)
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Mon Mar 24, 2008 2:05 pm    Post subject: Reply with quote

Thats the old jackson module.
And the code you got there is from a post by me Smile. *Notice my name in the code.
On what source, I dont remember. Maybe Leap Frog or something

You need to write the nop to the next address as well mate.
Like this:
Code:

Call LAB(&H621530, &H90)
Call LAB(&H621531, &H90)
Call LAB(&H58BE67, &H90)
Call LAB(&H58BE68, &H90)


*But if your nopping the nudge.
It is not 2 address's you should fine "just one".
Your writing bytes to the wrong address and causing a crash to the program as well.

Also, at extalia you can get a even better source then this old one to use.
Posted by Wiccaan.
Back to top
View user's profile Send private message
Tom331
Cheater
Reputation: 0

Joined: 14 Jul 2007
Posts: 25

PostPosted: Mon Mar 24, 2008 5:04 pm    Post subject: Reply with quote

Ill have a looky for the new module after testing it out and how can I get just one address? because when I nudge 3 different things appear in the autohack window: The first which cause's the nudge (i think?) and makes the address that i found though searching have a value of 2
The second changed the value to 0 after the nudge has finished
The Third sets the value to one, allowing me to nudge again

the only way you can freeze (or nop?) if to put the lil smiley next to the first 2 address's

Btw, as you can probably tell I am a total newb at vb trainers, how can you write values in code?


EDIT: ShockedShocked IT WORKED!! Why have you got to nop the next addy aswell?? And is this the same with any program that you make a trainer for? Thanks you soo much Very Happy
How do i give rep? Or cant I do it because of my noobish post count Confused

Is the one at exalia the one that has "delta force" as the window name in the tut? because if it is I couldn't get that one to work
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Mon Mar 24, 2008 5:36 pm    Post subject: Reply with quote

The address you need is the one doing 1 or 0.
And yes your bytes at the address you find, has other address's for each set.

Example:
Code:
004156BE - 03 00 - add eax,[eax]
004156C0 - 00 00 - add [eax],al


4156BE has 2 bytes 03 00
So the second byte has it's own address of 4156BF
Then the next address is 4156C0 and it has 2 bytes 00 00 so the second byte has it's own address 4156C1

So the address's dealing with these 2 instructions are:
4156BE
4156BF <-- and after F is 0 so it carries 1 to B and that changes to C like doing math.
4156C0
4156C1

No matter what application you look at, this is how it works.
4156BE 03
4156BF 00
4156C0 00
4156C1 00

Thats why you see order in address's skip.
004156BE to 004156C0 for the following code.
004156BE - 03 00 - add eax,[eax]
004156C0 - 00 00 - add [eax],al
Back to top
View user's profile Send private message
Tom331
Cheater
Reputation: 0

Joined: 14 Jul 2007
Posts: 25

PostPosted: Tue Mar 25, 2008 1:02 pm    Post subject: Reply with quote

Thank you very much for the replys Smile

OK I now have everything working Very HappyVery Happy

BUT I have one more annoying little question:

How can you get the user to choose the value? like having a textbox then setting the value to whatever they've typed in?
I can get it to work with a value under 100
This is the code I'm trying to use for setting the timer in minesweeper
Code:

If Len(Text1.Text) > 2 Then
    Call LAB(&H100579D, &H0 + mid (text1.text, 1, 2) 'these just freeze the game
    Call LAB(&H100579C, &H0 + mid (text1.text, 3, 2)
Else
    Call LAB(&H100579C, &H0 + Text1.Text)  'This works, it will set the timer in minesweeper to whatever is in text1.text
End If

maybe its just a stupid mistake or I'm doing it completely wrong.

Thanks


Last edited by Tom331 on Wed Mar 26, 2008 10:36 am; edited 1 time in total
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Tue Mar 25, 2008 6:27 pm    Post subject: Reply with quote

The text from the box needs to be converted and passed to the call in bytes.
Back to top
View user's profile Send private message
Tom331
Cheater
Reputation: 0

Joined: 14 Jul 2007
Posts: 25

PostPosted: Wed Mar 26, 2008 12:08 pm    Post subject: Reply with quote

SmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmile
Smile ZOMG I GOTS IT WOKIN SmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmile
SmileI now know how to make a trainer in visual basic Smile
SmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmileSmile

Thanks for all your help! Smile


For anyone else who is wants to know what I did:
Add this function
Code:
      Function HexToLong(ByVal sHex As String) As Long
        HexToLong = Val("&H" & sHex & "&")
      End Function

Then this:
Code:
Private Sub Command1_Click()
Dim gay As Long, supergay as long, blah as string

blah = Hex(Text1.Text) 'gets the hex value of text1, then puts it into a string

gay = &H0 + HexToLong(Mid(blah, 2, 2)) 'converts the second 2 numbers numbers of blah to long
supergay = &H0 + HexToLong(Mid(blah, 1, 1)) 'converts the first number of blah to long

If Val(Text1.Text) > 255 Then
    Call LAB(&H100579D, &H0 + supergay)
    Call LAB(&H100579C, &H0 + gay)
Else
    Call LAB(&H100579C, &H0 + Text1.Text)
    Call LAB(&H100579D, &H0)
End If
end sub


sorry if it doesn't make sense/is structured badly
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites