Results 1 to 9 of 9
  1. #1
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty

    Entrypoint vs. BaseAddress?

    I want to find the base address of a DLL. I know there's a way to do this, with API functions, but I heard that some Dynamically Linked Libraries can be compiled so that they always load at the same address. So if that were the case I figure it might be easier just to open the .dll up in a debugger and see what where it starts out. However the question I had was rather the entry point of a .dll would be the same thing as the base address. I would suppose not, but I don't know for sure, which is why Im asking.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  2. #2
    [sheep]'s Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    9
    My Mood
    Happy
    hi why.. been a bit busy myself over the last few days.. so havent had time to come around.. ok.. i think we covered this before on another thread about code shifting.. i think even HELL posted some c++ that found the base address of a dll.. my trainer engine has the ASM equivalent..( i rarely code in anything other than asm) .. the BASE and ENTRY POINT are not the same thing.. BASE is where the dll is loaded and the ENTRY point is where the code starts execution. usually 1000 bytes after the header.. not always though... can be anywhere technically. google for a util called LORDPE it will list all running processes and give u all the info u need about what dlls your game is running and the base addresses etc etc.. hope that helps.. if not just leave more feedback and ill keep talking
    Last edited by [sheep]; 02-07-2010 at 11:38 PM.

  3. The Following 2 Users Say Thank You to [sheep] For This Useful Post:

    Hell_Demon (02-08-2010),why06 (02-08-2010)

  4. #3
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Wow, that was quick. I could have swore you were not online? o_O

    Anyway thanks. And yeh I know there are ways to find it in C++, I was just wondering...., so essentially it would be the first address listed in my disassembly window, if Im using a debugger or something?

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  5. #4
    [sheep]'s Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    15
    Reputation
    10
    Thanks
    9
    My Mood
    Happy
    heya. hehe i wasnt online.. when u sent me a PM it sent me an email which was then sent to my blackberry.. so i got it then Yeah your debugger will give u the base address of all dlls of the current process.

  6. #5
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    If you load up your debug target with olly(attach) it will show the base address of the DLL at runtime, if you load up the Dll only(olly uses LoadDll.exe for it) it shows as 0x10000000 range I believe.
    Both can be used tho, just substract 0x10000000 from the address shown in olly and then add the return value of GetModuleHandle and you'll have the location at runtime and vice versa.
    Ah we-a blaze the fyah, make it bun dem!

  7. The Following User Says Thank You to Hell_Demon For This Useful Post:

    why06 (02-08-2010)

  8. #6
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Hell_Demon View Post
    If you load up your debug target with olly(attach) it will show the base address of the DLL at runtime, if you load up the Dll only(olly uses LoadDll.exe for it) it shows as 0x10000000 range I believe.
    Both can be used tho, just substract 0x10000000 from the address shown in olly and then add the return value of GetModuleHandle and you'll have the location at runtime and vice versa.
    I thought the module handle was not the same thing as the base address, however you can use GetModuleInformation, to see what the base point was.

    Also I how do you attach to a process at runtime with Olly?

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  9. #7
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Quote Originally Posted by why06 View Post
    how do you attach to a process at runtime with Olly?
    Run game/exe, start olly, file -> attach
    Ah we-a blaze the fyah, make it bun dem!

  10. The Following User Says Thank You to Hell_Demon For This Useful Post:

    why06 (02-08-2010)

  11. #8
    Toymaker's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Location
    Hannah, Montana
    Posts
    659
    Reputation
    14
    Thanks
    193
    My Mood
    Amused
    All jokes aside, if you don't want to waste a ridiculous amount of time using the APIs, just run the program, attach it to OLLYDBG, go to executable modules and pick your .DLL, then scroll to the very top =\ if the addresses are 404D### the base is 40400000 and if its like 6F###### the base is 6F000000 =\ easy find =p haha.

  12. #9
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Toymaker View Post
    All jokes aside, if you don't want to waste a ridiculous amount of time using the APIs, just run the program, attach it to OLLYDBG, go to executable modules and pick your .DLL, then scroll to the very top =\ if the addresses are 404D### the base is 40400000 and if its like 6F###### the base is 6F000000 =\ easy find =p haha.
    Thanks TM. I've Actually in that past few day have been looking at the PE structure and have learned to find the entry point bt using the hex veiwer in Olly. Very interesting stuff, and apparently its one of the ways they pack executables to deter nub reversers (aka. me :P)

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

Similar Threads

  1. [Help] How Can I Set An Entrypoint For DLLs ? [Solved]
    By T0P-CENT in forum C++/C Programming
    Replies: 6
    Last Post: 10-05-2011, 08:23 AM
  2. [Release] Pointer & BaseAddress
    By HLBOT in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 11
    Last Post: 07-06-2011, 09:56 PM