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 


[HELP] C# - Trainer

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

Joined: 19 Sep 2013
Posts: 27

PostPosted: Sat Aug 15, 2015 9:16 am    Post subject: [HELP] C# - Trainer Reply with quote

Hi i have this code:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using FarCry3Trainer.CheatEngine;


namespace SaperTrainerV43._0
{
    class Program
    {
        static void Main(string[] args)
        {
            Process[] processes = Process.GetProcessesByName("minesweeper");
            if (processes.Length > 0)
                using (CheatEngine.Memory memory = new CheatEngine.Memory(processes[0]))
                {
                    CheatEngine.ProcessAddress address =
                        memory.GetAdress("minesweeper.exe@AAA38@120");
                    Console.WriteLine("Current cash: {0}", memory.ReadUInt32(address));
                    Console.WriteLine("Enter new cash: ");
                    uint newCash = uint.Parse(Console.ReadLine());
                    memory.WriteUInt32(address, newCash);
                }
        }
    }
}


Its my library: Address memory win32

And i have 3 errors:

Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Aug 15, 2015 9:50 am    Post subject: Reply with quote

Put "FarCry3Trainer." in front of CheatEngine
or "using FarCry3Trainer;" at the top
or better yet, remove "FarCry3Trainer." from the namespace in the other files
Back to top
View user's profile Send private message
dadajszen
Cheater
Reputation: 0

Joined: 19 Sep 2013
Posts: 27

PostPosted: Sat Aug 15, 2015 10:06 am    Post subject: Reply with quote

Now i have 2 errors:




Did you have maybe address.cs ?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Aug 15, 2015 10:25 am    Post subject: Reply with quote

I think "CheatEngine.ProcessAddress" should be "IntPtr"
And "GetAdress" should be "GetAddress" (type better!) Smile
Back to top
View user's profile Send private message
dadajszen
Cheater
Reputation: 0

Joined: 19 Sep 2013
Posts: 27

PostPosted: Sat Aug 15, 2015 10:48 am    Post subject: Reply with quote

Ok its my code:




And my bug:

Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Aug 15, 2015 11:14 am    Post subject: Reply with quote

I'm not sure if your GetAddress string is correct or not.
Try something simple, like just "minesweeper.exe".
Judging by your functions, nothing recognizes '@' as anything.
Did you mean for those to be '+'?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Aug 15, 2015 6:15 pm    Post subject: Reply with quote

All of these errors are things you would understand if you didn't just copy paste a trainer library and call it your own code.

Rather then just copy/pasting things together, take the time to learn the language first before you jump into game hacking.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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