Finding memory values? menu

User Tag List

Page 2 of 7 FirstFirst 123456 ... LastLast
Results 16 to 30 of 92
  1. #16
    BlackFootJones's Avatar Member
    Reputation
    1
    Join Date
    Jan 2011
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    duh of course that was it, thanks!

    Finding memory values?
  2. #17
    BlackFootJones's Avatar Member
    Reputation
    1
    Join Date
    Jan 2011
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So how do you go about actually interacting with your running dll? I was thinking of making it watch a file for new commands and interact with it that way

  3. #18
    Maddin1803's Avatar Member
    Reputation
    25
    Join Date
    Mar 2012
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i create a new thread, and let it run an own mainloop, where it reacts to the state of heartstone.

    Ofcourse, you could use any way you can imagine for IPC, you should be able to get a ton of solutions within minutes through the power of google

    Example for use with a simple FSM

    Code:
    public static DateTime timestep = DateTime.Now.AddSeconds(1);
    
     while (true)
    {
                        if (timestep > DateTime.Now)
                        {
                            timestep = DateTime.Now.AddSeconds(1);
                            pulse();
                        }
                        else
                        {
                            Thread.Sleep(250);
                        }
    
    }
    Last edited by Maddin1803; 01-03-2014 at 02:35 PM.

  4. #19
    phyte's Avatar Member
    Reputation
    7
    Join Date
    Aug 2008
    Posts
    136
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm having trouble generating a new Assembly-CSharp.dll with the code Maddin1803 posted earlier. I'm running this:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Mono.Cecil;
    using Mono.Cecil.Cil;
    
    namespace CecilTest
    {
        class Program
        {
            static void Main(string[] args)
            {
                hook.injection();
            }
        }
    
        public class hook
        {
            static string assemblypath = @"D:\HS_dlls\Assembly-CSharp.dll";
            static string injectpath = @"D:\HS_dlls\loaderdll.dll";
            static string assemblypathfinal = @"D:\hstest\hstest\ass\finalAssembly-CSharp.dll";
            static string saveas = @"D:\hstest\ass\mod-csharp.dll";
    
            public static void injection()
            {
                var typeName = "Hub";
                var methodName = "Start";
                var assembly = AssemblyDefinition.ReadAssembly(assemblypath);
                var injassembly = AssemblyDefinition.ReadAssembly(injectpath);
                var typedefinj = injassembly.MainModule.Types.Single(t => t.Name == "loader");
                var injmethDefinition = typedefinj.Methods.Single(t => t.Name == "init");
    
                var typeDefinition = assembly.MainModule.Types.Single(t => t.Name == typeName);
                var methDefinition = typeDefinition.Methods.Single(t => t.Name == methodName);
                var setMethodWriter = methDefinition.Body.GetILProcessor();
    
                var firstExistingInstruction = setMethodWriter.Body.Instructions[0];
                setMethodWriter.InsertBefore(firstExistingInstruction, setMethodWriter.Create(OpCodes.Call, assembly.MainModule.Import(injmethDefinition.Resolve())));
                assembly.Write(@"D:\HS_dlls\HS_dllstest.dll");
            }
        }
    }
    With the same dll code that BlackFootJones had, named as loaderdll.dll:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;
    
    namespace HSLoader
    {
        public class loader
        {
    
            public static void init()
            {
                File.WriteAllText(@"D:\HS_dlls\tesths.txt", "test");
            }
        }
    }
    but the resulting dll is just missing around 17 kb and running the game with it causes the menu buttons to just do nothing.

    Anyone know what I'm doing wrong? Thanks.
    Last edited by phyte; 01-03-2014 at 05:56 PM.

  5. #20
    BlackFootJones's Avatar Member
    Reputation
    1
    Join Date
    Jan 2011
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what version of .net are you using? i ended up with 3.5 across the board but my dl that was made was within a few kb of the original dll

  6. #21
    phyte's Avatar Member
    Reputation
    7
    Join Date
    Aug 2008
    Posts
    136
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's .net 4.5, I'm on 8.1. Is your dll smaller or larger than the original?

    Also, what version of Visual Studio are you using?
    Last edited by phyte; 01-04-2014 at 03:07 AM.

  7. #22
    Maddin1803's Avatar Member
    Reputation
    25
    Join Date
    Mar 2012
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    4.0 or lower as targetframework should work, dunno about 4.5

    Did you checke the Bytecode of the new DLL ?

  8. #23
    phyte's Avatar Member
    Reputation
    7
    Join Date
    Aug 2008
    Posts
    136
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I've got the Assembly-CSharp.dll to have proper references to my dll now, but trying to run it causes a crash. I'm just supposed to put the new dll along with my HSInjectDLL.dll in the managed folder, correct? Everything is being compiled against .net 4.0 now btw.

    Inspecting my new Assembly-CSharp.dll with dotPeek, it looks like this:
    Code:
    using HSInjectDLL;
    using System;
    using System.Collections;
    using System.Diagnostics;
    using UnityEngine;
    
    public class Hub : Scene
    {
      private void Start()
      {
        loader.init();
        if (CollectionManager.Get().GetPreconDeck(TAG_CLASS.MAGE) == null)
        ...
    Am I perhaps supposed to add a reference to my HSInjectDLL.dll in there as well somehow? I think that I'm missing the instruction to load HSInjectDLL.dll because it doesn't appear to be loaded in the platform assembly based on the output_log.txt.

    Edit: Disregard this for now it looks like hs is crashing for some unrelated reason.

    Edit 2: Everything works now! I'll list my setup in case someone runs into a similar problem in the future:
    Both projects use .net 4.0. The dotPeek code I posted above appears to be correct. Additionally, the resulting modified dll is indeed smaller than the original. No idea why.

    My slightly modified version of Maddin's code:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Mono.Cecil;
    using Mono.Cecil.Cil;
    
    namespace HSInjector
    {
        class Program
        {
            static void Main(string[] args)
            {
                hook.injection();
            }
        }
    
        public class hook
        {
            static string assemblypath = @"D:\HS_dlls\Assembly-CSharp.old.dll";
            static string injectpath = @"D:\HS_dlls\HSInjectDLL.dll";
    
            public static void injection()
            {
                var typeName = "Hub";
                var methodName = "Start";
                var assembly = AssemblyDefinition.ReadAssembly(assemblypath);
                var injassembly = AssemblyDefinition.ReadAssembly(injectpath);
                var typedefinj = injassembly.MainModule.Types.Single(t => t.Name == "loader");
                var injmethDefinition = typedefinj.Methods.Single(t => t.Name == "init");
    
                var typeDefinition = assembly.MainModule.Types.Single(t => t.Name == typeName);
                var methDefinition = typeDefinition.Methods.Single(t => t.Name == methodName);
                var setMethodWriter = methDefinition.Body.GetILProcessor();
    
                var firstExistingInstruction = setMethodWriter.Body.Instructions[0];
                setMethodWriter.InsertBefore(firstExistingInstruction, setMethodWriter.Create(OpCodes.Call, assembly.MainModule.Import(injmethDefinition.Resolve())));
                assembly.Write(@"D:\HS_dlls\Assembly-CSharp.dll");
            }
        }
    }
    References:
    UnityEngine.dll
    UnityScriptLang.dll
    Mono.Cecil.dll


    Full code of the dll I inject:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace HSInjectDLL
    {
        public class loader
        {
            public static void init()
            {
                System.IO.Directory.CreateDirectory(@"D:\HelloWorld");
            }
        }
    }
    No references necessary.
    Last edited by phyte; 01-04-2014 at 07:16 PM.

  9. #24
    phyte's Avatar Member
    Reputation
    7
    Join Date
    Aug 2008
    Posts
    136
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems like the best way to create a frontend is with named pipes.
    Creating a file that just stores commands is an idea but it seems pretty hacky. Thoughts?

  10. #25
    Maddin1803's Avatar Member
    Reputation
    25
    Join Date
    Mar 2012
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pipes would be the better solution for sure.
    You could use the normal UI Functions of Heartstone to draw your stuff too ofcourse.

  11. #26
    Movali's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Command System / Cheat Console

    If you want user input inside Hearthstone, you can open something what they call "Cheat"Input. (look into CheatMgr)
    It's just a normal console. You open it inside Hearthstone by pressing CTRL + Enter. (You don't really see it unless you type something).
    You can listen for commands like that:
    Code:
    CheatMgr.Get().RegisterCheatHandler("test", new CheatMgr.ProcessCheatCallback(this.TestCommand));
    
    private bool TestCommand(string func, string[] args, string rawArgs)
    {
        UIStatus.Get().AddInfo("Command received");
        return true;
    }
    Now if you type in "test" you should see a big flashing yellow "Command received" message.

    The cheat console also has some predefined commands, most interesting I found:
    • get/set <Option> <value> ("set idlekicker False" didn't really work, though there is actually the Option idlekicker and idlekicktime). For a list of options look into the enum Option.
    • warning <string> (opens a message box with that text)
    • In GamePlay.Awake() is something called "save me". Looked interesting, but it just finishes ServerBlockingSpells, which I haven't really looked into.
    • "suicide" crashes the game

  12. #27
    phyte's Avatar Member
    Reputation
    7
    Join Date
    Aug 2008
    Posts
    136
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Has anyone tried using named pipes in game? It appears that running code that uses named pipes inside HS not only does not work, but also causes all the code in the dll not to be run at all. Can anyone verify/explain this?

    As a simple example, this code will create a text file:
    Code:
    public static void init() {
    	System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\HSout" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt");
    }
    This code will not create anything:
    Code:
    public static void init() {
    	System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\HSout" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".txt");
    	var server = new NamedPipeServerStream("test");
    }
    Cheat console could be interesting too but I would like the ability for HS to listen for commands without having to be restarted every time you want to change something.
    Last edited by phyte; 01-07-2014 at 12:36 PM.

  13. #28
    Maddin1803's Avatar Member
    Reputation
    25
    Join Date
    Mar 2012
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The cause could be that the Code runs within the VM of Unity. Never tested it, but seems a good guess.

  14. #29
    veronikas's Avatar Private
    Reputation
    1
    Join Date
    Jan 2014
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Coming from a Java background, I'm having trouble understanding a bit of the code:

    Code:
    var typedefinj = injassembly.MainModule.Types.Single(t => t.Name == "loader");
    var injmethDefinition = typedefinj.Methods.Single(t => t.Name == "init");
    var typeDefinition = assembly.MainModule.Types.Single(t => t.Name == typeName);
    var methDefinition = typeDefinition.Methods.Single(t => t.Name == methodName)
    What exactly does this portion do?

    On the same note, my compiler is throwing an error on those lines, giving me the exception:

    Mono.Collections.Generic.Collection<Mono.Cecil.TypeDefinition> does not contain a definition for 'Single' and no extension method 'Single'...
    Not sure what causes this. I've got the Mono.Cecil dll as a reference, the loader.dll built, and I'm using Xamarin Studio.

  15. #30
    Maddin1803's Avatar Member
    Reputation
    25
    Join Date
    Mar 2012
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try adding a using statement for System.Linq, never worked with Xamarin Studio so i can only guess sorry. But this should be most likley the solution for your problem. Also check if you referenced and added using statements for Mono.Cecil.

    Slighty ot:
    Coming from a Java background, I'm having trouble understanding a bit of the code:

    Code:
    var typedefinj = injassembly.MainModule.Types.Single(t => t.Name == "loader");
    var injmethDefinition = typedefinj.Methods.Single(t => t.Name == "init");
    var typeDefinition = assembly.MainModule.Types.Single(t => t.Name == typeName);
    var methDefinition = typeDefinition.Methods.Single(t => t.Name == methodName)
    What exactly does this portion do?
    Sorry, lazy me was making this look more complicated then it is, the bad naming doesent make it easier

    var typedefinj could also be namend Mono.Cecil.TypeDefinition typdefin
    var injmethDefinition could also be Mono.Cecil.MethodDefinition.

    Guess this should clear it up a bit.

    The Code is for getting a Reference to the needed Functions.

    var typedefinj = injassembly.MainModule.Types.Single(t => t.Name == "loader");

    injassembly.MainModule.Types gives us a List of TypeDefinition.
    After that we use LINQ to get the only Type named loader. (Single would throw an Exception if there is more then one).


    var injmethDefinition = typedefinj.Methods.Single(t => t.Name == "init");

    More or less the same as before, we get a List of MethodDefintions from the TypeDefinition and fetch the only Methode named init.

    The other two lines of Code do exactly the same, just for a function called early in heartstone.

    With references to both Functions we are able to use MonoCecil to patch the bytecode of this function, with a call to our code.

    If you want to read about this more indepth look here

    Reflection (C# and Visual Basic)

    Or google for reflection
    Last edited by Maddin1803; 01-09-2014 at 07:45 AM.

Page 2 of 7 FirstFirst 123456 ... LastLast

Similar Threads

  1. [Tool] Is the use of Ovale memory values with button spamming against the eula?
    By cassrgs in forum World of Warcraft Bots and Programs
    Replies: 4
    Last Post: 01-31-2014, 01:12 AM
  2. [Question] How to find K Value
    By adapa in forum WoW Memory Editing
    Replies: 8
    Last Post: 08-04-2011, 05:02 PM
  3. need some help on finding memory stuff and check my current offsets
    By freitag in forum Age of Conan Exploits|Hacks
    Replies: 70
    Last Post: 11-21-2009, 02:56 PM
  4. CE Teleport Value Finding
    By Ednasil in forum World of Warcraft Bots and Programs
    Replies: 23
    Last Post: 01-08-2007, 12:05 PM
  5. How do you find memory offsets in the game?
    By koalaz2004 in forum World of Warcraft General
    Replies: 0
    Last Post: 08-18-2006, 09:40 PM
All times are GMT -5. The time now is 08:38 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search