void HackerContext::DumpRenderTargets() { UINT i; NvAPI_Status nvret; wchar_t filename[MAX_PATH]; HRESULT hr; if (analyse_options & FrameAnalysisOptions::STEREO) { // Enable reverse stereo blit for all resources we are about to dump: nvret = NvAPI_Stereo_ReverseStereoBlitControl(mHackerDevice->mStereoHandle, true); if (nvret != NVAPI_OK) { LogInfo("DumpStereoResource failed to enable reverse stereo blit\n"); // Continue anyway, we should still be able to dump in 2D... } } for (i = 0; i < mCurrentRenderTargets.size(); ++i) { hr = FrameAnalysisFilename(filename, MAX_PATH, false, false, false, i); if (FAILED(hr)) goto out; DumpResource((ID3D11Resource*)mCurrentRenderTargets[i], filename); } if (mCurrentDepthTarget) { hr = FrameAnalysisFilename(filename, MAX_PATH, false, false, true, 0); if (FAILED(hr)) goto out; DumpResource((ID3D11Resource*)mCurrentDepthTarget, filename); } out: if (analyse_options & FrameAnalysisOptions::STEREO) NvAPI_Stereo_ReverseStereoBlitControl(mHackerDevice->mStereoHandle, false); }
static int DumpDir( WResDir dir, WResFileID handle ) /**************************************************/ { int retcode; bool error; WResDirWindow wind; uint_16 os; retcode = 0; if( WResIsEmpty( dir ) ) { printf( "Directory in file %s is empty\n", CmdLineParms.FileName ); } else { os = WResGetTargetOS( dir ); wind = WResFirstResource( dir ); while( !WResIsLastResource( wind, dir ) ) { error = DumpResource( wind, handle, os ); if( error ) { retcode = 2; } wind = WResNextResource( wind, dir ); } error = DumpResource( wind, handle, os ); if( error ) { retcode = 2; } } return( retcode ); }
bool DumpCursor(int Id, const TCHAR* Caption) { // NEWHEADER // RES_CURSOR HGLOBAL hGlobal; int Size; const BYTE* Data; if (!LoadResource(Id, RT_GROUP_CURSOR, hGlobal, Data, Size)) return false; const NEWHEADER* Header = (const NEWHEADER*)Data; if (Header->ResType != RES_CURSOR || Header->ResCount < 1) return false; const RESDIR* Resdir = (const RESDIR*)(Header + 1); int IconId = Resdir->IconCursorId; UnlockAndFreeResource(hGlobal); DumpResource(IconId, Caption, RT_CURSOR); // const int FormatVersion = 0x00030000; // static HCURSOR hCursor = // CreateIconFromResource(FilterBits, FilterBitsCount, FALSE/*!fIcon*/, FormatVersion); // SetCursor(hCursor); return true; }
INT _tmain(INT argc, _TCHAR* argv[]) { #ifdef _DEBUG DumpResource(L"empty.restd"); #endif return 0; }
void HackerContext::DumpUAVs(bool compute) { UINT i; NvAPI_Status nvret; ID3D11UnorderedAccessView *uavs[D3D11_PS_CS_UAV_REGISTER_COUNT]; ID3D11Resource *resource; wchar_t filename[MAX_PATH]; HRESULT hr; if (analyse_options & FrameAnalysisOptions::STEREO) { // Enable reverse stereo blit for all resources we are about to dump: nvret = NvAPI_Stereo_ReverseStereoBlitControl(mHackerDevice->mStereoHandle, true); if (nvret != NVAPI_OK) { LogInfo("DumpStereoResource failed to enable reverse stereo blit\n"); // Continue anyway, we should still be able to dump in 2D... } } mOrigContext->CSGetUnorderedAccessViews(0, D3D11_PS_CS_UAV_REGISTER_COUNT, uavs); for (i = 0; i < D3D11_PS_CS_UAV_REGISTER_COUNT; ++i) { if (!uavs[i]) continue; uavs[i]->GetResource(&resource); if (!resource) { uavs[i]->Release(); continue; } hr = FrameAnalysisFilename(filename, MAX_PATH, compute, true, false, i); if (SUCCEEDED(hr)) DumpResource(resource, filename); resource->Release(); uavs[i]->Release(); } if (analyse_options & FrameAnalysisOptions::STEREO) NvAPI_Stereo_ReverseStereoBlitControl(mHackerDevice->mStereoHandle, false); }
bool DumpDialog(int Id, const TCHAR* Caption) { return DumpResource(Id, Caption, RT_DIALOG); }
bool DumpBitmap(int Id, const TCHAR* Caption) { return DumpResource(Id, Caption, RT_BITMAP); }