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 2010 and CheatEngine Memory Writing
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
seMtec™
Newbie cheater
Reputation: 0

Joined: 07 Jul 2011
Posts: 22

PostPosted: Sun Jul 10, 2011 5:31 pm    Post subject: Visual Basic 2010 and CheatEngine Memory Writing Reply with quote

Hey,

i got a Question. I want to write a Program in Visual Basic 2010 using cheatengine adresses of memory. I know how to rewrite the memory and changing bytes. I got a .vb project ReadandWriteMemory, so i paste it in and i can every process hack with this program.

So my problem is, i want to make the programm to change "Text Values", i build this program for a Game and want it to change my name in-game. But even if i make the command:

Dim ammount As String = TextBox1.Text
Try
WriteInteger("processname", &Hadress, ammount)

The text can only be changed with numbers, how i can change a text value with text ? Not with numbers lol. Hope u know what i mean.

So i scan my Nickname ingame in cheatengine with "Text Mode" then checking Unicode and yeah then i lookup my adress, but like i said can only changed with numbers then. Not with text, if i add text into my textbox of program it take no effect. any ideas????
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Sun Jul 10, 2011 7:53 pm    Post subject: Reply with quote

Try this Write String.zip

Read/write ascii and unicode
Code:
Write
Mem.WriteUnicode("game.dll+10101", "Text to write")
Mem.WriteUnicode("00400000", "Text to write")
Same for Ascii

Read
Mem.ReadUnicode("game.dll+10101", 16)
Mem.ReadUnicode("00400000",  16)
The 16 is just the text length. Can be any size.
Same for ascii

_________________
Back to top
View user's profile Send private message
seMtec™
Newbie cheater
Reputation: 0

Joined: 07 Jul 2011
Posts: 22

PostPosted: Mon Jul 11, 2011 6:57 am    Post subject: Reply with quote

Cool, thanks for the help and the link. I will try it out and hope that i get it Smile

EDIT: Won't work, the code is wrong. I dont really understand it, can u please help me ? This is my current code:

Public Class Form1

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Write()
Mem.WriteUnicode("haloce.exe+2AFF2A", "Text to Write")
Mem.WriteUnicode("006AFF2A", "Text to Write")


Please help me Sad
Kind Regards
Back to top
View user's profile Send private message
Krähne
Expert Cheater
Reputation: 0

Joined: 06 Jun 2010
Posts: 108
Location: Inside of my Kernel

PostPosted: Mon Jul 11, 2011 11:06 pm    Post subject: Reply with quote

seMtec™ wrote:
Cool, thanks for the help and the link. I will try it out and hope that i get it Smile

EDIT: Won't work, the code is wrong. I dont really understand it, can u please help me ? This is my current code:

Public Class Form1

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Write()
Mem.WriteUnicode("haloce.exe+2AFF2A", "Text to Write")
Mem.WriteUnicode("006AFF2A", "Text to Write")


Please help me Sad
Kind Regards


What is the error?... Have you clicked the button and did not change the memory value?

_________________
Excuse me if you don't understand what I just said, but "english" isn't my native language.
Back to top
View user's profile Send private message MSN Messenger
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Tue Jul 12, 2011 5:04 am    Post subject: Reply with quote

Try again!
Code:
TextBox1_TextChanged

Really, Textbox 2 is write string. Why would you use Textbox 1?
Shouldnt it be
Code:
    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        If (Process_List.SelectedIndex <> -1) Then
            Mem.WriteUnicode("haloce.exe+2AFF2A", TextBox2.Text)
        End If
    End Sub


Works fine for me on haloce.

_________________
Back to top
View user's profile Send private message
seMtec™
Newbie cheater
Reputation: 0

Joined: 07 Jul 2011
Posts: 22

PostPosted: Tue Jul 12, 2011 1:18 pm    Post subject: Reply with quote

>Huh ? is this now the finished code which i have to write or have i to change something ? I dont understand sorry im at the moment dumb lol.

It dont works still, it cant even debug the program cuz it says Erorr, that the "Process_LIst wasn't declared on Object" and "Mem wasn't declared on Object" so i couldn't even test it if it works cuz i cant even debug it.

I need to know which OF THE .vb files i have to insert of the "Write String.ZIP" I ever put, StringTest.vb in it. But which is the right?

My code is now the same like urs, and my second prob is. What u mean with the textboxes ? isn't it whatever which textbox i use ?? So how many textboxes and how many buttons i have to put in the Form ? Cuz i dont udnerstand that right now, or do i need a button, cuz i dont see a button code now. Please help me im confused so hard Sad

Kind Regards
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Tue Jul 12, 2011 1:30 pm    Post subject: Reply with quote

PM me your source.
So is my source not working or the one you're trying to make?

_________________
Back to top
View user's profile Send private message
seMtec™
Newbie cheater
Reputation: 0

Joined: 07 Jul 2011
Posts: 22

PostPosted: Tue Jul 12, 2011 2:50 pm    Post subject: Reply with quote

Sorry can't PM at the moment, im not worthy or something.

Well here is it:

This is my code which i have at the moment, the same like u i guess.

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
If (Process_List.SelectedIndex <> -1) Then
Mem.WriteUnicode("haloce.exe+2AFF2A", TextBox2.Text)
End If
End Sub
End Class

Then i added 2 TextBoxes, in the 2nd i added this code in the 1st i added nothing. And a button i dont have, dunno if i need one cuz i havnt any code for button in this.

And i neeed to know from u, which .VB file i need to insert into the project. I mean the files that are in the "Write String.ZIP"
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Tue Jul 12, 2011 3:13 pm    Post subject: Reply with quote

Did you add
Dim Mem As StringTest = New StringTest

Upload the source here. You wont beable to post the link so add spaces between some of the letters.
Or try adding it as an attachment.

_________________
Back to top
View user's profile Send private message
seMtec™
Newbie cheater
Reputation: 0

Joined: 07 Jul 2011
Posts: 22

PostPosted: Tue Jul 12, 2011 3:55 pm    Post subject: Well that helped me alot :D now only one error it says! Reply with quote

OKay, no that Dim Mem i didn't added, but now i did and it helped alot.

The code is going to be right soon. But one Error it says still if i debug it.

It says something with the: (Process_List.SelectedIndex <> -1), and says "Process_List isn't declared on the Object blabla"

And this is my code now

Code:
Public Class Form1

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        Dim Mem As StringTest = New StringTest
        Try
            If (Process_List.SelectedIndex <> -1) Then
                Mem.WriteUnicode("haloce.exe+2AFF2A", TextBox2.Text)

            End If
        Catch ex As Exception

        End Try
    End Sub
End Class


Hope u can help me out with that, but so i also dont need a button into this app ?? It all changes text when i write into textbox2 ??

Kind Regards
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Tue Jul 12, 2011 4:18 pm    Post subject: Reply with quote

Did you add
Protected Proc As Process

That will be at the top of the StringTest class
TextBox2_TextChanged looks good, i personally wouldnt use try/catch but whatever.

There were only 2 things you needed to declare.
Protected Proc As Process (in the StringTest class)
Dim Mem As StringTest = New StringTest (in Form1)

You dont need a button if you're using the textbox textchanged.
Remember, this was just example code. Do whatever works best for you.

_________________
Back to top
View user's profile Send private message
seMtec™
Newbie cheater
Reputation: 0

Joined: 07 Jul 2011
Posts: 22

PostPosted: Wed Jul 13, 2011 7:14 am    Post subject: Reply with quote

It still dont work, i dont get now a error anymore, but it dont changes text in haloce, but in stringtest.vb i added now haloce in the process list i dont know if i should but i did, cuz i thought u meant that with declare that in stringtest.vb files.

i will not post full code now of StringTest.vb, its too long. I post the code where i added haloce in the process list thingy:

Code:
Public Function GetCurrentProc() As List(Of String)
        Dim list As New List(Of String)
        Dim iProc As Process() = Process.GetProcesses
        list.Add("haloce")
        Dim i As Integer
        For i = 0 To iProc.Length - 1
            list.Add(iProc(i).Id.ToString("X") + "-" + iProc(i).ProcessName)
        Next i
        Return list
    End Function
#End Region
End Class


Then in the Form1 I added this:
Code:
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim Mem As StringTest = New StringTest
    End Sub


And in the textbox i added this:
Code:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        Dim Mem As StringTest = New StringTest
        Mem.WriteUnicode("haloce.exe+2AFF2A", TextBox1.Text)

    End Sub
End Class


Please help meee, im not a pro programmer lmao im in learning stuff, i need really help, please test it and explain me exactly where i have to declare something. Iam german so i dont know perfect english, maybe i dont understand u rigth often maybe its that i make something wrong or so. Please....
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Wed Jul 13, 2011 9:42 am    Post subject: Reply with quote

Quote:
I post the code where i added haloce in the process list thingy:

You never added anything.
Dim Mem As StringTest = New StringTest only declares
GetCurrentProc() only brings up the list of processes.
iProccess gets the process by ID
If you cant understand a simple class like that with a few lines of code, you need to start reading some tutorials dude.
I cant keep spoon feeding like this.

Im kindof glad you never posted your source when i asked you too.
Fixing your source wouldnt of helped you, i see that now.

Go read up on
WriteProcessMemory
ReadProcessMemory
System.Text.Encoding

_________________
Back to top
View user's profile Send private message
seMtec™
Newbie cheater
Reputation: 0

Joined: 07 Jul 2011
Posts: 22

PostPosted: Wed Jul 13, 2011 1:23 pm    Post subject: Reply with quote

Bro, i know it, and i dont want it, that u must keep spoon feeding me like this. BUT i dont cant find tutorials on this stuff man, and im a beginner in things with programming in memory stuff. I did this before 1/2 years ago but not much too and now i began again.

But what the hell u mean with the source man ???? I thought the Scoure, is the full code/s i wrote into my form???? LOL!

And yeah, its hard for me to understand all this stuff cuz i never readed any program books or something. And i dont understand WHAT I HAVE NOW to add, that it changes my name/text in halo. I dont get it, i dont know im confused so damn hard. I can this only with Value changing but string write is completly new to me. And i still dont know if i have only put in the StringTest.vb or more of these files ????

I would please you that u could test the code on u and then say it, me then i write it and i see more how its build, but i dont force u, just would be cool. I could learn it better out of that. I have no one other who can help me, the forum/s are my only source i have.

EDIT: OMG :/ embarissing, sorry i translated "source". Sorry now i know what u mean, yeah well, my source was u. I never had that codes before i only knew this commands now from u. And for sure VB was my source, cuz i worked often with value changing from cheatengine addresses etc, so i searched and searched for that, till i found out that it's need other codes "String Write Commands" and then i asked here.

Kind Regards
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Wed Jul 13, 2011 3:46 pm    Post subject: Reply with quote

This is a very very simple example. Mind you it'l only work for that one address but atleast you'll see how it works.
You dont need to declare anything. Just copy/paste that code.
Code:
    <System.Runtime.InteropServices.DllImport("kernel32.dll")> _
    Public Shared Function WriteProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As Integer, ByVal buffer As Byte(), ByVal size As Integer, ByVal lpNumberOfBytesWritten As Integer) As Boolean
    End Function

    Public Sub WriteUnicode(ByVal Text_To_Write As String)
        Dim Proc As Process() = Process.GetProcessesByName("haloce")
        If (Proc.Length <> 0) Then
            Dim pBytes As Byte() = System.Text.Encoding.Unicode.GetBytes(Text_To_Write)
            WriteProcessMemory(Proc(0).Handle, &H6AFF2A, pBytes, pBytes.Length, 0)
        End If
    End Sub


Put this in your TextBox2_TextChanged so it looks like this
Code:
    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
        WriteUnicode(TextBox2.Text)
    End Sub

_________________
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 programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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