Example Usage
void screenshot(string file) {
ULONG_PTR gdiplustoken;
GdiplusStartupInput gdistartupinput;
GdiplusStartupOutput gdistartupoutput;
gdistartupinput.SuppressBackgroundThread = true;
GdiplusStartup(&gdiplustoken, &gdistartupinput, &gdistartupoutput);
HDC dc = GetDC(GetDesktopWindow());
HDC dc2 = CreateCompatibleDC(dc);
RECT rc0kno;
GetClientRect(GetDesktopWindow(), &rc0kno);
int w = rc0kno.right - rc0kno.left;
int h = rc0kno.bottom - rc0kno.top;
HBITMAP hbitmap = CreateCompatibleBitmap(dc, w, h);
HBITMAP holdbitmap = (HBITMAP)SelectObject(dc2, hbitmap);
BitBlt(dc2, 0, 0, w, h, dc, 0, 0, SRCCOPY);
Bitmap* bm = new Bitmap(hbitmap, NULL);
UINT num, size;
ImageCodecInfo* imagecodecinfo;
GetImageEncodersSize(&num, &size);
imagecodecinfo = (ImageCodecInfo*)(malloc(size));
GetImageEncoders(num, size, imagecodecinfo);
CLSID clsidEncoder;
for (int i = 0; i < num; i++) {
if (wcscmp(imagecodecinfo[i].MimeType, L"image/jpeg") == 0)
clsidEncoder = imagecodecinfo[i].Clsid;
}
free(imagecodecinfo);
wstring ws;
ws.assign(file.begin(), file.end());
bm->Save(ws.c_str(), &clsidE
See also
365
Free
BlueTeam, RedTeam, Bug bounty, CTI, OSINT, Threat Hunting, Network and Web Recon, Discovery, Enumera…
ExploitDB / SearchSploit
Open Source
Kali
Archive of public exploits and vulnerable software maintained by Offensive Security. SearchSploit pr…
Nishang
Open Source
Kali
Framework and collection of PowerShell scripts and payloads for offensive security and post-exploita…
NoSQLMap
Open Source
Automated NoSQL injection and database exploitation tool. Targets MongoDB, CouchDB, Redis, and Cassa…
NTRGhidra
Open Source
A Nintendo DS binary loader for Ghidra…
CVE_Prioritizer
Open Source
Streamline vulnerability patching with CVSS, EPSS, and CISA's Known Exploited Vulnerabilities. Prior…