Find the right address menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Ikse's Avatar Member
    Reputation
    1
    Join Date
    Dec 2014
    Posts
    10
    Thanks G/R
    3/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Find the right address

    Hi,

    I'm trying to make my own dumper, and I'm at the very beginning of the process.
    I've at the moment few python lines that search into a binary file a given pattern.

    Here is my "problem":

    When I try my python script on a simple binary file (like ls program), I've no problem find the correct address, but when I'm trying it on more complex program, it "almost" find it.

    I explain myself:

    if I do an objdump on a binary and take an arbitrary line like:
    Code:
    1400d114b:	48 89 05 36 8c 3d 00
    So now, I take the pattern: 48 89 05 36 8c 3d 00 and wait to result to be d114b.
    The problem is that on this binary file: the python script give me as result: 0xd054b which is 0xC00 less than the expected result.

    Or maybe the result should be result + 0x1000 - 0x400
    why + 0x1000 ?
    I don't know exactly, i've found that the .text section in objdump start at 140001000

    Can someone help me find out the explanation ?

    Thank you in advance for your help !

    Find the right address
  2. #2
    Ikse's Avatar Member
    Reputation
    1
    Join Date
    Dec 2014
    Posts
    10
    Thanks G/R
    3/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've found the solution, that was pretty obvious finally.
    Just had to find out the offset of the .text section in the binary file and substract the result given by my python script and the found .text address.

    Hope this help someone is beginning

  3. #3
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sorry I'm late to the thread. The offset to each section (.text, etc.) can be found in the PE file header. Check out CFF Explorer, it'll give you a good idea of the structure of a PE file.

    If you want the info to translate the address programatically, your process should look like this:

    1. DOS PE header:
    Read e_lfanew (offset to NT header)

    2. NT PE header:
    Read NumberOfSections (number of entries in sections)
    Read SizeOfOptionalHeader
    Sections Address = (e_lfanew + sizeof(NtHeader) + SizeOfOptionalHeader)

    3. Sections (array containing NumberOfSections of the following data, iterate it until you find Name == ".text\0\0\0"):
    0x00 Name (8 byte string)
    0x08 Virtual Size (DWORD)
    0x0C Virtual Address (DWORD)
    0x10 Raw Size (DWORD)
    0x14 Raw Address (DWORD)
    0x18 Reloc Address (DWORD)
    0x1C Line Numbers (DWORD)
    0x20 Reloc Number (DWORD)
    0x24 Characteristics (DWORD)

    4. Translate from raw address to virtual address using the above data.
    Result += (Virtual Address - Raw Address), which should (at least for Wow) look like the two values you have found:
    Result += (0x1000 - 0x400)

  4. Thanks Ikse (1 members gave Thanks to Jadd for this useful post)
  5. #4
    Ikse's Avatar Member
    Reputation
    1
    Join Date
    Dec 2014
    Posts
    10
    Thanks G/R
    3/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you

    This is very clear and I'm sure it will help more than one beginner !

    I'm on linux so my binary file is in an ELF file format. But the idea is still the same

    Thank you again

Similar Threads

  1. [Question] DBC Spell swapping, finding the right spell.
    By moogood in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 07-30-2010, 12:26 PM
  2. [ Question ] Find the right Texture Files
    By Chaoty in forum WoW ME Questions and Requests
    Replies: 5
    Last Post: 05-18-2008, 01:37 PM
  3. Replies: 3
    Last Post: 11-12-2007, 01:49 PM
  4. where is that guide to finding the memory-address which Enables model editing
    By mikesanders in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 07-12-2007, 11:19 PM
All times are GMT -5. The time now is 08:38 AM. 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