Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

is this possible...?

This topic is 2678 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

int function(...)
{
int x;
int q;


if (condition)
{
}

<-----is there a way to put a marker here...then use a pointer to store the address of the marker...right before the 2nd conditional statement in my code?

if (condition2)
{

}


return val;
}

Share this post


Link to post
Share on other sites
Advertisement
int function(...)
{
int x;
int q;


if (condition)
{
}

return function2(x, q);
}

int function2(...)
{
if (condition2)
{

}


return val;
}



You could just do something like that. It's hard to tell without some real code >.<

Share this post


Link to post
Share on other sites
What are you trying to do? If you want to jump to a specific part of the code, that is generally frowned on. It makes for very unreadable and unmaintainable code. If you are just trying to debug, just put a statement there such as a printf().

Share this post


Link to post
Share on other sites
im trying to use the address,hardcoded at compile time, to read in the bytes starting at that address till the end of the return and store all these bytes into a buffer..... -thx

Share this post


Link to post
Share on other sites

im trying to use the address,hardcoded at compile time, to read in the bytes starting at that address till the end of the return and store all these bytes into a buffer..... -thx


>.< But why? You could use a function pointer address and try and increment it by some value I guess. But what are you trying to accomplish?

Share this post


Link to post
Share on other sites
So are you trying to have the program read a portion of itself? If so, why?

edit: Also, if I understand correctly, I think you will be reading the actual compiled x86 instructions. That is, if you're looking to get variable values, those will be stored elsewhere, in the stack or heap.

Share this post


Link to post
Share on other sites
When you say "all these bytes" what bytes are you referring to? Some section of compiled machine code? I agree with others that the better question is what problem are you attempting to solve with this so you can be given a better solution.

Share this post


Link to post
Share on other sites
im wanting to read my compiled code at a certain point(which i specify) read it into a buffer, and then be able to copy those bytes to a file for viewing...!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!