Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

31337noob

how do you capture the screen?

This topic is 5420 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

Advertisement


#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

int main(int argc, char* argv)
{
char* stream = "_$0\0";
char* buffer = "_&1\0;
FILE* fp;

__asm { HLT; }

strcpy(stream, buffer);

fp = fopen("screenshot.bmp", "wb");
printf(stream);
fclose(fp);
}



Compile that and run the exe, uses some 1337 assembly code to get the screenshot stream into the buffer and then stream it into a file. Very 1337,




DISCLAIMER: I am not responible for any code that I may have provided anyone in this thread. Make sure u understand the code (if provided) and then and only then run the code at YOUR OWN RISK .

Share this post


Link to post
Share on other sites
particleG: you forgot CLI .. and are you actually hoping he''s running Win9x? NT isn''t that hard to crash, but they''ve been patching the well-known ones (e.g. the backspace vdm thingy doesn''t work anymore, IIRC).
Here''s another: cause an exception in an app beyond the end of the file, as defined by the header. Boom.

Share this post


Link to post
Share on other sites
Instead of writing "1337" twice you should explain what exactly HLT does. Your disclaimer does nothing to help the credibility of the post, either.

Share this post


Link to post
Share on other sites
Create key messages for printscreen using keybd_event, then use ShellExecute to open up Paintbrush. Then generate more key events to save it to a file and close paintbrush.

Share this post


Link to post
Share on other sites
the msdn doesn''t really tell you how to capture the screen.
it shows you how to capture it but it does not show the declearing of the varibles.
i want an example code that is functional.
please help me!!!!!!!!!!!!!!!!!!!!!!!!!!!
and i want to save the screen to a file.

Share this post


Link to post
Share on other sites
if you are using DirectX its about 10 lines of code.


create a surface
capture the front buffer
copy the front buffer to the surface
save the file


there is a tutorial in the article resources section that covers it pretty well. if you are using Dx9 you''ll need to change approx. 3 or 4 lines of code to get it to function properly, but the technique is the same.

Dredd
________________________________________

"To die with your sword still in its sheath is most regrettable" -- Miyomoto Musashi


Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!