[Help] Java Bot reading offset values..^^° menu

Shout-Out

User Tag List

Results 1 to 11 of 11
  1. #1
    kmJeepers's Avatar Member
    Reputation
    1
    Join Date
    Jun 2009
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] Java Bot reading offset values..^^°

    Hello everyone!
    I'm new to the scene and i come with a problem:
    My first try of writing a HP showing tool, it only returns "0"...


    First of all I decided to write a small Bot in Java(I know most peolpe suggest doing it in c#, but i want to try something different^^°)

    Well, first i Got my special method where i try to grab the players HP:

    Code:
    
    public void run() throws NativeException, IllegalAccessException
    	{
    		int playeradress = 0x010BD5F4;
    		int puffer,buffer,playerbase;
    		
    		puffer=Get.getData(playeradress);
    		puffer=puffer+0x34;
    		puffer=Get.getData(puffer);
    		puffer = puffer+0x24;
    		playerbase=Get.getData(puffer);
    			
    		int base=playerbase+0x8;
    		base=Get.getData(base);
    		base=base+0x260*4;
    		buffer=Get.getData(base);
    
    		output.setText(Integer.toString(buffer));
    		
    	}
    Then I Got my special Offset grab method in the class Get:


    Code:
    
    public static  int getData(int hex) throws NativeException, IllegalAccessException
    	{
    		WindowsUtils.setSeDebugPrivilege();
    		int pid = 4128; 
            HANDLE processHandle = Kernel32.OpenProcess(Kernel32.PROCESS_QUERY_INFORMATION | Kernel32.PROCESS_ALL_ACCESS, false, pid); // pid: process id 
            JNative readProcessMemory = new JNative("Kernel32.dll", "ReadProcessMemory"); 
    
            if (processHandle.equals(null)) 
               System.out.println("NULL"); 
             
            int b = 128; // buffer size 
            Pointer p = new Pointer(MemoryBlockFactory.createMemoryBlock(b)); 
     
            int base=hex;
            readProcessMemory.setRetVal(Type.INT); 
            readProcessMemory.setParameter(0,processHandle.getValue().intValue()); 
            readProcessMemory.setParameter(1,base); 
            readProcessMemory.setParameter(2,p); 
            readProcessMemory.setParameter(3, b); 
            readProcessMemory.invoke(); 
            int val = readProcessMemory.getRetValAsInt(); 
            Kernel32.CloseHandle(processHandle);
            
            return p.getAsInt(val);
           	}
    

    Well the grab methodic works, so i could grab the players name in 3.0 with this structure...
    Even if this is in Java i thinks its kind of similar to c#, so i think you will be able to give me advise how to make this work...

    I would appreciate Help and Tipps from you^^°

    greets kmJeepers

    [Help] Java Bot reading offset values..^^°
  2. #2
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This makes AutoIt look good.

    base=base+0x260*4;
    The correct offset for health is UNIT_FIELD_HEALTH = 0x17, I have no idea where you grabbed 0x260 from.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  3. #3
    kmJeepers's Avatar Member
    Reputation
    1
    Join Date
    Jun 2009
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ookay i corrected that, but that does'n change the return value... i checked, and even the value for "playerbase" is "0"...

  4. #4
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That hardcoded process id cannot be right...

    Also, your ReadProcessMemory call doesn't seem correct either...
    ReadProcessMemory Function (Windows)
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  5. #5
    kmJeepers's Avatar Member
    Reputation
    1
    Join Date
    Jun 2009
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well a i said that code worked for a static entry in 3.0....
    I took that code from: java memory reader any trick to getting access to WOW memory
    - So that method "ReadProcessMemory Function" is an internal method by "Jnative" an extenrnal app to read dlls....

  6. #6
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kmJeepers View Post
    Well a i said that code worked for a static entry in 3.0....
    I took that code from: java memory reader any trick to getting access to WOW memory
    - So that method "ReadProcessMemory Function" is an internal method by "Jnative" an extenrnal app to read dlls....
    It can't and won't work if WoW's process ID isn't 4128
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  7. #7
    kmJeepers's Avatar Member
    Reputation
    1
    Join Date
    Jun 2009
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well i enter the correct pid every time i run a new instance of wow XD

  8. #8
    LegacyAX's Avatar Active Member
    Reputation
    21
    Join Date
    Apr 2009
    Posts
    193
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kmJeepers View Post
    well i enter the correct pid every time i run a new instance of wow XD
    Thanks for the good laugh mate. :P

  9. #9
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jesus. That's a pain in the ass, don't you think? FindWindow+GetProcessId much?

  10. #10
    kmJeepers's Avatar Member
    Reputation
    1
    Join Date
    Jun 2009
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think i'm capable of programming something like that... but it isn't that easy in java ^^°
    Well but doesn't change the fact that the main function doesn't work...
    i would like to know whether my main function has issues in the code methodic of reading the memory entries...

  11. #11
    kmJeepers's Avatar Member
    Reputation
    1
    Join Date
    Jun 2009
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in short:
    1.getting the pid in java isn't the problem
    2. Is my code right till now?

    --> if it's right i think i have to use something else than "Jnative"(used in the code above)

Similar Threads

  1. Help with Java Bot
    By SimpleF in forum Programming
    Replies: 8
    Last Post: 12-31-2013, 12:13 AM
  2. Replies: 2
    Last Post: 01-18-2012, 05:15 AM
  3. [WoW]Help Reading offset
    By 0_00_0 in forum WoW Memory Editing
    Replies: 1
    Last Post: 11-29-2009, 06:26 AM
  4. Help with mounts...read
    By Corruptedwow in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-04-2008, 06:55 AM
  5. NEED HELP: experienced players READ plz
    By Dagonarth in forum World of Warcraft General
    Replies: 4
    Last Post: 12-15-2006, 05:43 AM
All times are GMT -5. The time now is 04:18 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search