Solved C# Error; Define Global Processes?

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Remy

Newbie
Full Member
Jun 25, 2014
3
312
0
So i have this code:
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;

namespace DunDef_hack
{
    class Program
    {
        public void Main(string[] args)
        {
            Console.Title = "Dungeon Defenders Mana Hack";
            SetUp();
        }

        public void SetUp()
        {
            Process[] processes;
            processes = Process.GetProcessesByName("DunDefGame");
            if (processes.Length > 0)
            {
                Write();
              
            }
        }

        public void Write()
        {
            using (CheatEngine.Memory memory = new CheatEngine.Memory(processes[0]))
            {
                IntPtr address = memory.GetAddress("\"DunDefGame.exe\"+00E06FE4+0+20+FC+368+0");
                memory.WriteUInt32(address, 999999999);
                Console.WriteLine("Mana Edited!");
                Console.WriteLine("Press any key to close.");
                Console.Read();
            }
        }
    }
}
My error is when i define "processes" in setup i recall it again in another function and i get this:
"The name 'processes' does not exist in the current context"
How do i fix this or globalize processes?
 

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
processes only 'lives' in the function Setup and not anymore in Write(), so you could set it global or give it to Write() as parameter like "public void Write(Process Proc){...}"

We have three important tutorials that cover the basics of all C# hacking:
https://guidedhacking.com/threads/c-game-hacking-guide-start-here.12701/
https://guidedhacking.com/threads/c-multilevel-pointer-function-c-version-of-finddmaaddy.11874/
https://guidedhacking.com/threads/c-get-module-base-address-c-getmodulebaseaddress-function.11887/
 
Last edited by a moderator:

Remy

Newbie
Full Member
Jun 25, 2014
3
312
0
processes only 'lives' in the function Setup and not anymore in Write(), so you could set it global or give it to Write() as parameter like "public void Write(Process Proc){...}"
Thanks Very Much! :D
 
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