Originally Posted by southpau1
So its another buffer overflow issue. I need to exploit a buffer overflow and overwrite the RET address of a program with the memory address of some code that I want to execute. So I need to be able to put the code I want to run in memory, and I also need to know its memory address so I can set the RET address to the correct value.
If I understand your request, I think that you are looking at this issue wrong. When you develop a program the 'calls' when executed will push a return address onto the stack. When the 'ret' is executed then that return address is popped off the stack. If you are debugging then breakpoints can be used within to allow stepping the program through the program. If the program that you are calling supports externals then it should be easy to find the address or modify to suit if Open Source. Other wise you would need to disassemble, which can be a hassle at times. Better if you have the source.
If you are not careful the stack will be mangled for that program.
Whenever you compile then link the addressing is allocated. Look at linker
then look at Assembler Language
wiki section 2.2 Macros
for some examples related to ASM. The above links should provide enough to understand procedural aspects.
You could look at things from a high level language perspective. In-line is nothing new. CS in such short time/post is difficult.