Warcraft III's useful offsets - Always Updated

This is a discussion on Warcraft III's useful offsets - Always Updated within the Warcraft 3 Hacks, bots and tools board part of the Warcraft 3 forum category; I am trying to make a tool in C# to read the current player count in the game, and notify ...

Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 44
  1. #11
    koyfo is offline Member
    Array
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    9
    Reputation
    1
    I am trying to make a tool in C# to read the current player count in the game, and notify the host if it is full.

    I am using

    Code:
    [DllImport("kernel32.dll")]
    
    public static extern Int32 ReadProcessMemory(
    IntPtr hProcess,
    IntPtr lpBaseAddress,
    [In, Out] byte[] buffer,
    UInt32 size,
    out IntPtr lpNumberOfBytesRead
    );

    and i am trying to figure out how to use the "Game.dll+ACF660" method. If i have the game.dll base address what is the lpBaseAddress i must give. Any conversion needed?


    PS: I can use another way, check the chat for text "...has joined the game" and make a list, but it's more complex :X


  2. #12
    ZeD's Avatar
    ZeD
    ZeD is offline RoR 0x266E


    Array
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    1,440
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    14
    Reputation
    698
    Quote Originally Posted by koyfo View Post
    I am trying to make a tool in C# to read the current player count in the game, and notify the host if it is full.

    I am using

    Code:
    [DllImport("kernel32.dll")]
    
    public static extern Int32 ReadProcessMemory(
    IntPtr hProcess,
    IntPtr lpBaseAddress,
    [In, Out] byte[] buffer,
    UInt32 size,
    out IntPtr lpNumberOfBytesRead
    );

    and i am trying to figure out how to use the "Game.dll+ACF660" method. If i have the game.dll base address what is the lpBaseAddress i must give. Any conversion needed?


    PS: I can use another way, check the chat for text "...has joined the game" and make a list, but it's more complex :X
    I'm not known to C# very well, but if you understand C++ code I could help you.

    Hook warcrafts GameState, when you are in gamelobby check every slot's state,
    if every slot is filled give out the notification.
    Last edited by ZeD; 11-05-2011 at 09:58 AM.

  3. #13
    Desu_Is_A_Lie's Avatar
    Desu_Is_A_Lie is offline Hacker
    Array
    Join Date
    Nov 2009
    Location
    Tver', Russian Federation
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    170
    Quote Originally Posted by Dennis View Post
    check every slot's state
    Just don't forget that going out of slots' bounds will give you fatal error.

  4. #14
    ZeD's Avatar
    ZeD
    ZeD is offline RoR 0x266E


    Array
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    1,440
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    14
    Reputation
    698
    Quote Originally Posted by Desu_Is_A_Lie View Post
    Just don't forget that going out of slots' bounds will give you fatal error.
    So you need to retrieve the count of joinable slots from the Host index

  5. #15
    koyfo is offline Member
    Array
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    9
    Reputation
    1
    Quote Originally Posted by Dennis View Post
    I'm not known to C# very well, but if you understand C++ code I could help you.

    Hook warcrafts GameState, when you are in gamelobby check every slot's state,
    if every slot is filled give out the notification.
    I know C++ very well but i am close to the solution with C#. All i need to know is how to read the specified dynamic address of "Game.dll+ACF660". I can read data from addresses such as (IntPtr)0x018F404, i have the game.dll base address, entry point address but i don't know how to obtain the specific address of game.dll plus another offset...

  6. #16
    Desu_Is_A_Lie's Avatar
    Desu_Is_A_Lie is offline Hacker
    Array
    Join Date
    Nov 2009
    Location
    Tver', Russian Federation
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    170
    (IntPtr)(hGameP+0xACF660)?

  7. #17
    koyfo is offline Member
    Array
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    9
    Reputation
    1
    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; using Sojaner.MemoryScanner; namespace GemiseToGame //Game.dll+ACF660 { public partial class mainForm : Form { public mainForm() { InitializeComponent(); Process war3 = new Process(); Process[] processes = Process.GetProcesses(); foreach (var process in processes) { if (process.ProcessName == "war3") { war3 = process; } } ProcessModule gameDll = war3.Modules[0]; foreach (ProcessModule module in war3.Modules) { if (module.ModuleName == "game.dll") { gameDll = module; } } ProcessMemoryReader memoryReader = new ProcessMemoryReader(); int bytesReaded; byte[] memory; memoryReader.ReadProcess = war3; memoryReader.OpenProcess(); memory = memoryReader.ReadProcessMemory((IntPtr)(gameDll.Ba seAddress + 0xACF660), 4, out bytesReaded); foreach (var item in memory) { print(((Byte)item).ToString()); //Encoding.ASCII.geGetString } memoryReader.CloseHandle(); } public void print(string input) { output_textBox.Text += input + ""; } } }


    Here is my source code. I get as result 0000

    ---------- Post added at 053 PM ---------- Previous post was at 04:46 PM ----------

    For debugging, if i read only from game.dll base address (without adding 0xACF660), i get normal data. For example, these are the first bytes of what i get.

    In byte mode

    77 90 144 0 3 0 0 0 4 0 0 0 255 255 0 0 184 0 0 0 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 1 0 0 14 31 186 14 0 180 9 205 33 184 1 76 205 33 84 104 105 115 32 112 114 111 103 114 97 109 32 99 97 110 110 111 116 32 98 101 32 114 117 110 32 105 110 32 68 79 83 32 109 111 100 101 46 13 13 10 36 0 0 0 0 0 0 0 193 38 113 224 133 71 31 179 133 71 31 179 133 71 31 179 18 131 97 179 132 71 31 179 162 129 98 179 131 71 31 179 162 129 114 179 144 71 31 179 162 129 100 179 129 71 31 179 122 103 27 179 245 71 31 179 209 100 47 179 132 71 31 179 70 72 66 179 146 71 31 179 133 71 30 179 5 70 31 179 162 129 113 179 190 71 31 179 162 129 101 179 132 71 31 179 162 129 99 179 132 71 31 179 162 129 103 179 132 71 31 179 82 105 99 104 133 71 31 179 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 80 69 0 0 76 1 4 0 169 186 131 77 0 0 0 0 0 0 0 0 224 0 3 1 11 1 8 0 0 80 5 0 0 208 1 0 0 0 0 0 6 54 0 0 0 16 0 0


    In char mode

    M Z   @      !  L ! T h i s p r o g r a m c a n n o t b e r u n i n D O S m o d e .


    $ & q G  G  G   a G  b G  r G  d G  z g  G  d / G  F H B G  G   F  q G  e G  c G  g G  R i c h G  P E L   M     P    6  `  @       n U            $  ,    @ k   `   . t e x t J   P   ` . r d a t a `  `  @ @ . d a t a 0  @ 0  @ . r s r c @   p  @ @ D $  t  j j h k E P #  D $  j j h ( k E P
     % b E d 0 F 3 D $ ` V W L $    D $ p P W L $


    If i add the 0xACF660 offset, get 000000000000 ...

  8. #18
    Farid.Agl's Avatar
    Farid.Agl is offline Advanced Hacker

    Array
    Join Date
    Sep 2011
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    322
    I will write this tool on AutoIt script as soon as i had some free times. If you like to learn how to ReadProcessMemory in AutoIt take a look at this thread:
    http://www.d3scene.com/forum/warcraf...urce-code.html

  9. #19
    koyfo is offline Member
    Array
    Join Date
    Aug 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    9
    Reputation
    1
    Quote Originally Posted by GoDLiKe.ON3 View Post
    I will write this tool on AutoIt script as soon as i had some free times. If you like to learn how to ReadProcessMemory in AutoIt take a look at this thread:
    http://www.d3scene.com/forum/warcraf...urce-code.html
    Thanks for the interest, but yea I undestand the concept. The key lines are these



    $Value = _MemoryRead($Game_dll + 0xACF678, $Process)
    If $Value = 1 Then
    If $GameState = 0 Then
    SoundPlay(@ScriptDir & "\GameStarted.wav") ;.Wav file by DarkSuprme (GM)
    $GameState = 1
    EndIf
    EndIf
    If $Value = 0 Then
    If $GameState = 1 Then
    $GameState = 0
    EndIf
    EndIf


    The thing is, that we are doing exactly the same procedure but it seems like C# doesn't want to add an offset to the game.dll base address. I tried things like


    (IntPtr)(gameDll.BaseAddress.ToInt32() + Convert.ToInt32(0xACF660))

    but nothing worked...


    Any other ideas?

  10. #20
    YourName's Avatar
    YourName is offline THE ONE AND ONLY DARK KNIGHTY


    Array
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    1,553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    16
    Reputation
    1088
    You don't need to cast those values around.
    Providing you with foolish stuff since 2007.

Page 2 of 5 FirstFirst 1234 ... LastLast

Similar Threads

  1. Replies: 0
    Last Post: 08-17-2011, 09:32 PM
  2. Detected offsets in Warcraft III 1.23
    By TyranO in forum Development
    Replies: 11
    Last Post: 01-25-2010, 08:29 PM
  3. Detected offsets in Warcraft III 1.24
    By forgotmylogin in forum Warcraft 3 Hacks, bots and tools
    Replies: 3
    Last Post: 08-16-2009, 03:10 PM
  4. Warcraft 3 Offsets 1.22
    By Bendik in forum Development
    Replies: 17
    Last Post: 06-03-2009, 07:04 PM
  5. Detected Warcraft 3 Offsets
    By rolle in forum Warcraft 3 forum
    Replies: 6
    Last Post: 12-08-2008, 02:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •