diff --git a/Dissector/Dissector.cpp b/Dissector/Dissector.cpp index 1545577..30bceec 100644 --- a/Dissector/Dissector.cpp +++ b/Dissector/Dissector.cpp @@ -324,8 +324,9 @@ namespace Dissector { sDissectorData.mCallbacks->ResimulateStart( iDevice ); - int limit = (sDissectorData.mDrawCallLimit >= 0 && iUseFrameLimit) ? - std::min( 1+sDissectorData.mDrawCallLimit, sDissectorData.mCaptureSize ) : sDissectorData.mCaptureSize; + int dclimit = sDissectorData.mCaptureSize < (1 + sDissectorData.mDrawCallLimit) ? sDissectorData.mCaptureSize : (1 + sDissectorData.mDrawCallLimit); + + int limit = (sDissectorData.mDrawCallLimit >= 0 && iUseFrameLimit) ? dclimit : sDissectorData.mCaptureSize; DrawCallData* iterEnd = &sDissectorData.mCaptureData[ limit ]; for( DrawCallData* iter = sDissectorData.mCaptureData; iter != iterEnd; ++iter ) @@ -371,12 +372,12 @@ namespace Dissector void SendStateTypes() { - SendResponse( Dissector::RSP_STATETYPES, sDissectorData.mStateTypeBuffer, sDissectorData.mStateTypeBufferSize, 0 ); + SendResponse( Dissector::RSP_STATETYPES, sDissectorData.mStateTypeBuffer, (unsigned int)sDissectorData.mStateTypeBufferSize, 0 ); } void SendEventList() { - size_t bufferLen = 32*1024; + unsigned int bufferLen = 32*1024; char* outData = (char*)MallocCallback( bufferLen ); if( !outData ) return; @@ -388,11 +389,11 @@ namespace Dissector DrawCallData* iterEnd = &sDissectorData.mCaptureData[ sDissectorData.mCaptureSize ]; for( DrawCallData* iter = sDissectorData.mCaptureData; iter != iterEnd; ++iter ) { - size_t dataLen = 0; + unsigned int dataLen = 0; const char* dataPtr = NULL; if( iter->mEventType == -1 ) { - dataLen = strlen( iter->mDrawCallData ) + 1; // Need to copy null char + dataLen = (unsigned int)strlen(iter->mDrawCallData) + 1; // Need to copy null char dataPtr = iter->mDrawCallData; } else if( iter->mEventType == -2 ) @@ -408,12 +409,12 @@ namespace Dissector } else { - dataLen = strlen( sDissectorData.mEventTypes[ iter->mEventType ].mName ) + 1; // Need to copy null char + dataLen = (unsigned int)strlen(sDissectorData.mEventTypes[iter->mEventType].mName) + 1; // Need to copy null char dataPtr = sDissectorData.mEventTypes[ iter->mEventType ].mName; } } - if( (dataIter + sizeof(int) + sizeof(size_t) + dataLen) >= dataIterEnd ) + if ((dataIter + sizeof(int) + sizeof(unsigned int) + dataLen) >= dataIterEnd) { // Buffer needs to grow size_t bufferLen = dataIterEnd - outData; @@ -448,7 +449,7 @@ namespace Dissector assert( dataIter <= dataIterEnd ); - SendResponse( Dissector::RSP_EVENTLIST, outData, dataIter - outData, 0 ); + SendResponse(Dissector::RSP_EVENTLIST, outData, (unsigned int)(dataIter - outData), 0); FreeCallback( outData ); } @@ -480,8 +481,8 @@ namespace Dissector SendResponse( Dissector::RSP_EVENTINFO, (char*)&iEventNum, sizeof(int), (char*)sDissectorData.mCaptureData[iEventNum].mFirstRenderState, - sDissectorData.mCaptureData[iEventNum].mSizeRenderStateData, - buffer.mPtr, toolDataSize, + (unsigned int)sDissectorData.mCaptureData[iEventNum].mSizeRenderStateData, + buffer.mPtr, (unsigned int)toolDataSize, 0 ); } @@ -512,7 +513,7 @@ namespace Dissector enumIter = *(char**)enumIter; } - SendResponse( Dissector::RSP_ENUMTYPES, data, size, 0 ); + SendResponse(Dissector::RSP_ENUMTYPES, data, (unsigned int)size, 0); FreeCallback( data ); } @@ -587,7 +588,7 @@ namespace Dissector data.numFailures = sizeof( data.fails ) / sizeof(unsigned int); DrawCallData* debugIter = &sDissectorData.mCaptureData[ iEventId ]; sDissectorData.mCallbacks->TestPixelFailure( iDevice, iEventId, *pixel, data.fails ); - SendResponse( Dissector::RSP_TESTPIXELFAILURE, (char*)&data, sizeof(data), 0 ); + SendResponse(Dissector::RSP_TESTPIXELFAILURE, (char*)&data, (unsigned int)(sizeof(data)), 0); } void OverrideRenderState( void* iDevice, void* iMessageData, unsigned int iDataSize ) @@ -833,8 +834,8 @@ namespace Dissector return true; // Must resize the buffer. - size_t bufferSize = sDissectorData.mCaptureDataBufferSize; - size_t newBufferSize = 2 * bufferSize; + int bufferSize = sDissectorData.mCaptureDataBufferSize; + int newBufferSize = 2 * bufferSize; Dissector::DrawCallData* newBuffer = (Dissector::DrawCallData*)MallocCallback( newBufferSize * sizeof(Dissector::DrawCallData) ); if( newBuffer == NULL ) @@ -858,7 +859,7 @@ namespace Dissector if( !PrepareCaptureDataBufferForAdd() ) return; - int nameLen = strlen( iName )+1; + int nameLen = int( strlen( iName )+1 ); if( !PrepareMiscDataBufferForAdd( nameLen ) ) return; @@ -869,10 +870,11 @@ namespace Dissector sDissectorData.mCaptureData[ sDissectorData.mCaptureSize ].mToolRenderStates = 0; - memcpy( sDissectorData.mMiscDataIter, iName, nameLen ); + sDissectorData.mCaptureData[sDissectorData.mCaptureSize].mDrawCallData = sDissectorData.mMiscDataIter; + + memcpy(sDissectorData.mMiscDataIter, iName, nameLen); sDissectorData.mMiscDataIter += nameLen; - sDissectorData.mCaptureData[ sDissectorData.mCaptureSize ].mDrawCallData = sDissectorData.mMiscDataIter; ++sDissectorData.mCaptureSize; } } @@ -894,7 +896,7 @@ namespace Dissector } } - void RegisterEvent( void* iDevice, int iEventType, const void* iEventData, unsigned int iDataSize ) + void RegisterEvent(void* iDevice, int iEventType, const void* iEventData, unsigned int iDataSize) { if( sDissectorData.mMiscDataBuffer ) { @@ -917,7 +919,7 @@ namespace Dissector } } - void AddRenderStateEntries( void* iRenderStateData, unsigned int iDataSize ) + void AddRenderStateEntries(void* iRenderStateData, unsigned int iDataSize) { if( !PrepareMiscDataBufferForAdd( iDataSize ) ) { @@ -961,7 +963,7 @@ namespace Dissector void RegisterEventType( unsigned int iType, unsigned int iFlags, const char* iName ) { - int nameLen = strlen( iName ); + int nameLen = int( strlen( iName ) ); assert( (sDissectorData.mEventNames + nameLen) < sDissectorData.mEventNamesEnd ); sDissectorData.mEventTypes[ sDissectorData.mNumEventTypes ].mFlags = iFlags; @@ -1002,7 +1004,7 @@ namespace Dissector #endif allocSize += sizeof(unsigned int) * 4; - allocSize += iter->mName ? strlen( iter->mName ) : 0; + allocSize += iter->mName ? int( strlen( iter->mName ) ) : 0; } #ifdef CHECK_FOR_DUPE_STATE_TYPES @@ -1036,7 +1038,7 @@ namespace Dissector if( iter->mName ) { - unsigned int len = strlen( iter->mName ); + unsigned int len = (unsigned int)strlen( iter->mName ); StoreBufferData( len, insertPointer ); memcpy( insertPointer, iter->mName, len ); @@ -1056,7 +1058,7 @@ namespace Dissector va_list argList; int count = 0; - int size = sizeof(unsigned int) * 3 + sizeof(char*); + unsigned int size = sizeof(unsigned int) * 3 + sizeof(char*); va_start( argList, iVisualizerId ); @@ -1065,7 +1067,7 @@ namespace Dissector while( iter != NULL ) { ++count; - size += strlen( iter ); + size += (unsigned int)strlen( iter ); size += sizeof(unsigned int)*2; value = va_arg( argList, unsigned int ); iter = va_arg( argList, const char* ); @@ -1079,7 +1081,7 @@ namespace Dissector *(char**)data = sDissectorData.mEnumData; sDissectorData.mEnumData = data; data += sizeof(char*); - + StoreBufferData( size, data ); StoreBufferData( count, data ); StoreBufferData( iVisualizerId, data ); @@ -1093,7 +1095,7 @@ namespace Dissector *(unsigned int*)data = value; StoreBufferData( value, data ); - unsigned int strsize = strlen(iter); + unsigned int strsize = (unsigned int)strlen(iter); StoreBufferData( strsize, data ); memcpy( data, iter, strsize ); @@ -1114,8 +1116,8 @@ namespace Dissector StoreBufferData( iSizeY, iter ); StoreBufferData( iPitch, iter ); - SendResponse( Dissector::RSP_CURRENTRENDERTARGET, header, sizeof(header), - iImage, iSizeY * iPitch, 0 ); + SendResponse(Dissector::RSP_CURRENTRENDERTARGET, header, (unsigned int)(sizeof(header)), + iImage, (unsigned int)(iSizeY * iPitch), 0); } void ImageRetrievalCallback( void* iTexture, unsigned int iRSType, void* iImage, unsigned int iSizeX, @@ -1129,8 +1131,8 @@ namespace Dissector StoreBufferData( iSizeY, iter ); StoreBufferData( iPitch, iter ); - SendResponse( Dissector::RSP_IMAGE, header, sizeof(header), - iImage, iSizeY * iPitch, 0 ); + SendResponse(Dissector::RSP_IMAGE, header, (unsigned int)(sizeof(header)), + iImage, (unsigned int)(iSizeY * iPitch), 0); } void ThumbnailRetrievalCallback( void* iTexture, unsigned int iVisualizerType, void* iImage, unsigned int iSizeX, @@ -1145,11 +1147,11 @@ namespace Dissector StoreBufferData( iPitch, iter ); StoreBufferData( iEventNum, iter ); - SendResponse( Dissector::RSP_THUMBNAIL, header, sizeof(header), - iImage, iSizeY * iPitch, 0 ); + SendResponse(Dissector::RSP_THUMBNAIL, header, (unsigned int)(sizeof(header)), + iImage, (unsigned int)(iSizeY * iPitch), 0); } - void ShaderDebugDataCallback( char* iDataBlob, unsigned int iDataSize, int iEventId, unsigned int loc0, unsigned int loc1 ) + void ShaderDebugDataCallback(char* iDataBlob, unsigned int iDataSize, int iEventId, unsigned int loc0, unsigned int loc1) { struct { @@ -1161,7 +1163,7 @@ namespace Dissector message.eventId = iEventId; message.loc0 = loc0; message.loc1 = loc1; - SendResponse( Dissector::RSP_SHADERDEBUGINFO, &message, sizeof(message), iDataBlob, iDataSize, 0 ); + SendResponse(Dissector::RSP_SHADERDEBUGINFO, &message, (unsigned int)(sizeof(message)), iDataBlob, (unsigned int)iDataSize, 0); } void ShaderDebugFailedCallback( int iEventId, unsigned int loc0, unsigned int loc1 ) @@ -1176,13 +1178,13 @@ namespace Dissector message.eventId = iEventId; message.loc0 = loc0; message.loc1 = loc1; - SendResponse( Dissector::RSP_SHADERDEBUGFAILED, &message, sizeof(message), 0 ); + SendResponse(Dissector::RSP_SHADERDEBUGFAILED, &message, (unsigned int)(sizeof(message)), 0); } // Call from GetMeshCallback to supply the mesh. void MeshDebugDataCallback( unsigned int iEventId, Dissector::PrimitiveType::Type iType, - unsigned int iNumPrims, char* iVertsBlob, unsigned int iVertsSize, char* iIndices, unsigned int iIndicesSize ) + unsigned int iNumPrims, char* iVertsBlob, unsigned int iVertsSize, char* iIndices, unsigned int iIndicesSize) { struct { @@ -1195,13 +1197,13 @@ namespace Dissector messageHeader.eventId = iEventId; messageHeader.primtype = iType; messageHeader.numPrims = iNumPrims; - messageHeader.vertSize = iVertsSize; - messageHeader.indexSize = iIndicesSize; + messageHeader.vertSize = (unsigned int)iVertsSize; + messageHeader.indexSize = (unsigned int)iIndicesSize; if( iIndicesSize ) - SendResponse( Dissector::RSP_MESH, &messageHeader, sizeof(messageHeader), iVertsBlob, iVertsSize, iIndices, iIndicesSize, 0 ); + SendResponse(Dissector::RSP_MESH, &messageHeader, sizeof(messageHeader), iVertsBlob, (unsigned int)iVertsSize, iIndices, (unsigned int)iIndicesSize, 0); else - SendResponse( Dissector::RSP_MESH, &messageHeader, sizeof(messageHeader), iVertsBlob, iVertsSize, 0 ); + SendResponse(Dissector::RSP_MESH, &messageHeader, sizeof(messageHeader), iVertsBlob, (unsigned int)iVertsSize, 0); } // ------------------------------------------------------------------------------------ diff --git a/Dissector/Dissector.h b/Dissector/Dissector.h index 32a010f..d82b639 100644 --- a/Dissector/Dissector.h +++ b/Dissector/Dissector.h @@ -203,8 +203,8 @@ namespace Dissector Dissector::RenderState* mFirstRenderState; char* mDrawCallData; ToolDataItem* mToolRenderStates; // Linked list of overridden render states - int mSizeDrawCallData; - int mSizeRenderStateData; + unsigned int mSizeDrawCallData; + unsigned int mSizeRenderStateData; int mEventType; // -1 means a draw call group, -2 means end of draw group }; @@ -333,7 +333,7 @@ namespace Dissector virtual void TestPixelFailure(void* iDevice, unsigned int iEventId, Dissector::PixelLocation iPixel, unsigned int *oFails ) { iDevice; iEventId; iPixel; oFails; } virtual void GetMesh(void* iDevice, unsigned int iEventId, unsigned int iType ) { iDevice; iEventId; iType; } - virtual void GetEventText( DrawCallData* iDC, size_t iMaxSize, char* oBuffer, size_t& oSize ) { iDC; iMaxSize; oBuffer; oSize; } + virtual void GetEventText(DrawCallData* iDC, unsigned int iMaxSize, char* oBuffer, unsigned int& oSize) { iDC; iMaxSize; oBuffer; oSize; } virtual void SlaveFrameBegin() {} virtual void SlaveFrameEnd() {} diff --git a/Dissector/Dissector.vcxproj b/Dissector/Dissector.vcxproj index 6bf4d64..6a24d8a 100644 --- a/Dissector/Dissector.vcxproj +++ b/Dissector/Dissector.vcxproj @@ -1,14 +1,22 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {A6A1B567-08F3-4312-8E74-6F6BFB4E258E} @@ -19,12 +27,27 @@ StaticLibrary true NotSet + v120 + + + StaticLibrary + true + NotSet + v120 StaticLibrary false true NotSet + v120 + + + StaticLibrary + false + true + NotSet + v120 @@ -32,9 +55,15 @@ + + + + + + @@ -42,6 +71,18 @@ Level3 Disabled MultiThreadedDebugDLL + true + + + true + + + + + Level3 + Disabled + MultiThreadedDebugDLL + true true @@ -54,6 +95,22 @@ true true MultiThreadedDLL + true + + + true + true + true + + + + + Level3 + MaxSpeed + true + true + MultiThreadedDLL + true true diff --git a/DissectorDX9/DX9Helpers.cpp b/DissectorDX9/DX9Helpers.cpp index 54ab425..75353fc 100644 --- a/DissectorDX9/DX9Helpers.cpp +++ b/DissectorDX9/DX9Helpers.cpp @@ -487,7 +487,7 @@ namespace DissectorDX9 size = (size > (2*desc.Size)) ? (2*desc.Size) : size; rvalue = (UINT*)Dissector::MallocCallback( size ); - oBufferSize = size; + oBufferSize = (unsigned int)size; unsigned short* iter = ((unsigned short*)buf) + iStartElement; unsigned short* end = (unsigned short*)(((unsigned char*)iter) + baseSize); UINT* outIter = rvalue; @@ -501,7 +501,7 @@ namespace DissectorDX9 size_t size = iNumElements * sizeof(UINT); size = (size > desc.Size) ? desc.Size : size; - oBufferSize = size; + oBufferSize = (unsigned int)size; rvalue = (UINT*)Dissector::MallocCallback( size ); if( rvalue ) { @@ -568,7 +568,7 @@ namespace DissectorDX9 vertEnd = vertIter + numVerts * streamStride; //TODO: Convert the position for each vertex into a float4 and return that buffer. - oBufferSize = numVerts * 4 * sizeof(float); + oBufferSize = (unsigned int)(numVerts * 4 * sizeof(float)); float* rvalue = (float*)Dissector::MallocCallback( oBufferSize ); if( rvalue ) { diff --git a/DissectorDX9/DissectorDX9.cpp b/DissectorDX9/DissectorDX9.cpp index 4ba2ea1..351c818 100644 --- a/DissectorDX9/DissectorDX9.cpp +++ b/DissectorDX9/DissectorDX9.cpp @@ -1401,6 +1401,11 @@ namespace DissectorDX9 } info = ShaderDebugDX9::GetShaderInfo( shaderData, shaderSize, D3DDevice ); + if (!info.mDebugHeader) + { + rvalue = false; + goto DebugShaderCleanup; + } regPtr = (RegisterData*)Dissector::MallocCallback( sizeof(RegisterData) * info.mInstructionCount ); unsigned int regSize = 0; @@ -1509,8 +1514,8 @@ namespace DissectorDX9 for( int ii = 0; ii < blobHeader.mNumFilenames; ++ii ) { char* str = info.GetFilename( ii ); - sizeofFilenames += strlen( str ); - sizeofFilenames += sizeof( int ); // for the leading size of the string + sizeofFilenames += (unsigned int)strlen( str ); + sizeofFilenames += (unsigned int)sizeof(int); // for the leading size of the string } blobHeader.mNumVariables = 0; @@ -1524,7 +1529,7 @@ namespace DissectorDX9 _D3DXSHADER_TYPEINFO* typeInfo = info.DebugOffsetToPointer< _D3DXSHADER_TYPEINFO* >( entry.offsetToTypeInfo ); - int nameLength = strlen( name ); + unsigned int nameLength = (unsigned int)strlen(name); if( typeInfo->StructMembers ) { blobHeader.mNumVariables += typeInfo->StructMembers; @@ -1537,7 +1542,7 @@ namespace DissectorDX9 char* memName = info.DebugOffsetToPointer< char* >( memInfo[jj].Name ); sizeofVariableNames += nameLength; - sizeofVariableNames += strlen( memName ) + 1; // +1 for '.' + sizeofVariableNames += (unsigned int)strlen(memName) + 1; // +1 for '.' sizeofVariableNames += sizeof( int ); // for the leading size of the string blobHeader.mVariableBlockSize += memtypeInfo->Columns * memtypeInfo->Rows * sizeof(float); } @@ -1690,7 +1695,7 @@ namespace DissectorDX9 if( rvalue && validResults ) { - Dissector::ShaderDebugDataCallback( debugBlob, iter - debugBlob, iEventId, pixelX, pixelY ); + Dissector::ShaderDebugDataCallback(debugBlob, (unsigned int)(iter - debugBlob), iEventId, pixelX, pixelY); if( debugBlob ) { Dissector::FreeCallback( debugBlob ); @@ -1879,9 +1884,9 @@ namespace DissectorDX9 { if( Dissector::IsCapturing() ) { - size_t indexSize = IndexDataFormat == D3DFMT_INDEX16 ? 2 : 4; + unsigned int indexSize = IndexDataFormat == D3DFMT_INDEX16 ? 2 : 4; int numIndices = GetNumVertices( PrimitiveType, PrimitiveCount ); - int dataSize = sizeof(DrawIndexedUpData) + VertexStreamZeroStride * NumVertices + numIndices * indexSize; + int dataSize = (unsigned int)(sizeof(DrawIndexedUpData)) + VertexStreamZeroStride * NumVertices + numIndices * indexSize; assert( dataSize < 2048 ); char* drawcalldata = (char*)sDX9Data.mUPDataBuffer; @@ -2624,7 +2629,7 @@ namespace DissectorDX9 numPrimitives, (char*)meshData, bufferSize, (char*)indexData, indexSize ); } - virtual void GetEventText( Dissector::DrawCallData* iDC, size_t iMaxSize, char* oBuffer, size_t& oSize ) + virtual void GetEventText(Dissector::DrawCallData* iDC, unsigned int iMaxSize, char* oBuffer, unsigned int& oSize) { DrawBase* dc = (DrawBase*)(iDC->mDrawCallData); switch( iDC->mEventType ) @@ -2671,7 +2676,7 @@ namespace DissectorDX9 } oBuffer[iMaxSize-1] = 0; - oSize = strlen( oBuffer ) + 1; + oSize = (unsigned int)strlen(oBuffer) + 1; } virtual void SlaveFrameBegin() diff --git a/DissectorDX9/DissectorDX9.vcxproj b/DissectorDX9/DissectorDX9.vcxproj index b23d20f..533e73f 100644 --- a/DissectorDX9/DissectorDX9.vcxproj +++ b/DissectorDX9/DissectorDX9.vcxproj @@ -1,14 +1,22 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {8081C1FB-31C0-4C81-99BF-1FE28610135B} @@ -19,12 +27,27 @@ StaticLibrary true NotSet + v120 + + + StaticLibrary + true + NotSet + v120 StaticLibrary false true NotSet + v120 + + + StaticLibrary + false + true + NotSet + v120 @@ -32,9 +55,15 @@ + + + + + + @@ -43,6 +72,19 @@ Disabled D:\code\Dissector;$(DXSDK_DIR)\Include;%(AdditionalIncludeDirectories) MultiThreadedDebugDLL + true + + + true + + + + + Level3 + Disabled + D:\code\Dissector;$(DXSDK_DIR)\Include;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + true true @@ -56,6 +98,23 @@ true D:\code\Dissector;$(DXSDK_DIR)\Include;%(AdditionalIncludeDirectories) MultiThreadedDLL + true + + + true + true + true + + + + + Level3 + MaxSpeed + true + true + D:\code\Dissector;$(DXSDK_DIR)\Include;%(AdditionalIncludeDirectories) + MultiThreadedDLL + true true diff --git a/DissectorDX9/ShaderDebugDX9.cpp b/DissectorDX9/ShaderDebugDX9.cpp index 5b8b1f2..b446932 100644 --- a/DissectorDX9/ShaderDebugDX9.cpp +++ b/DissectorDX9/ShaderDebugDX9.cpp @@ -846,7 +846,7 @@ namespace ShaderDebugDX9 // Write the shader end instruction. StoreBufferData( D3DSIO_END, oIter ); - oDataSize = oIter - (char*)oData; + oDataSize = UINT(oIter - (char*)oData); return true; } diff --git a/DissectorGUI/mainwindow.cpp b/DissectorGUI/mainwindow.cpp index fa9b9cf..b97ef5a 100644 --- a/DissectorGUI/mainwindow.cpp +++ b/DissectorGUI/mainwindow.cpp @@ -1304,8 +1304,17 @@ void MainWindow::PopulateEventInfo() case(Dissector::RSTF_VISUALIZE_RESOURCE_RENDERTARGET): { editable->setIcon( QIcon() ); - RequestThumbnail( eventNum, eventData, rstype.mVisualizerType, editable ); - value.sprintf( "0x%x", *(unsigned int*)eventData ); + unsigned __int64 eventptr; + if( rs->mSize == 8 ) { + eventptr = *(unsigned __int64*)eventData; + value.sprintf( "0x%llu", eventptr ); + } else { + eventptr = *(unsigned int*)eventData; + value.sprintf( "0x%x", eventptr ); + } + + RequestThumbnail( eventNum, eventptr, rstype.mVisualizerType, editable ); + editable->setText( value ); } break; @@ -1317,7 +1326,10 @@ void MainWindow::PopulateEventInfo() case(Dissector::RSTF_VISUALIZE_RESOURCE_COMPUTE_SHADER): case(Dissector::RSTF_VISUALIZE_RESOURCE_BUFFER): case(Dissector::RSTF_VISUALIZE_RESOURCE_VERTEXTYPE): - value.sprintf( "0x%x", *(unsigned int*)eventData ); + if( rs->mSize == 8 ) + value.sprintf( "0x%llu", *(unsigned __int64*)eventData ); + else + value.sprintf( "0x%x", *(unsigned int*)eventData ); editable->setText( value ); break; default: @@ -1372,10 +1384,10 @@ void MainWindow::PopulateEnumInfo() } -void MainWindow::RequestTexture( int iEventNum, char* iEventData, unsigned int iType ) +void MainWindow::RequestTexture( int iEventNum, unsigned __int64 iEventData, unsigned int iType ) { iEventData; - __int64 id = iType;//*(unsigned int*)&iEventData; + unsigned __int64 id = iType;//*(unsigned int*)&iEventData; if( !id ) return; @@ -1405,9 +1417,9 @@ void MainWindow::RequestTexture( int iEventNum, char* iEventData, unsigned int i SendCommand( Dissector::CMD_GETIMAGE, data, sizeof(data) ); } -void MainWindow::RequestThumbnail( int iEventNum, char* iEventData, unsigned int iType, QStandardItem* ioDestination ) +void MainWindow::RequestThumbnail( int iEventNum, unsigned __int64 iEventData, unsigned int iType, QStandardItem* ioDestination ) { - __int64 id = *(unsigned int*)iEventData; + unsigned __int64 id = iEventData; if( !id ) return; diff --git a/DissectorGUI/mainwindow.h b/DissectorGUI/mainwindow.h index 7f0c574..4cc4d05 100644 --- a/DissectorGUI/mainwindow.h +++ b/DissectorGUI/mainwindow.h @@ -39,12 +39,12 @@ struct ThumbnailData struct ThumbnailPendingRequest { ThumbnailPendingRequest(){} - ThumbnailPendingRequest( __int64 iId, int iEvent, QStandardItem* iDestination ): + ThumbnailPendingRequest( unsigned __int64 iId, int iEvent, QStandardItem* iDestination ): mId( iId ), mEventNum( iEvent ), mDestination( iDestination ) {} - __int64 mId; + unsigned __int64 mId; int mEventNum; QStandardItem* mDestination; }; @@ -113,10 +113,10 @@ private slots: void HandleClearedRenderStateOverrides(); void RegisterRenderStateTypes(); - void RequestThumbnail( int iEventNum, char* iEventData, unsigned int iType, + void RequestThumbnail( int iEventNum, unsigned __int64, unsigned int iType, QStandardItem* iDestination ); - void RequestTexture( int iEventNum, char* iEventData, unsigned int iType ); + void RequestTexture( int iEventNum, unsigned __int64, unsigned int iType ); void CreateTextureWindow( unsigned int iType, bool iDebuggable ); void TextureWindowClosed( TextureViewerFast* iWindow ); diff --git a/DissectorInjector/DissectorInjector.sln b/DissectorInjector/DissectorInjector.sln index a1de011..c41a70b 100644 --- a/DissectorInjector/DissectorInjector.sln +++ b/DissectorInjector/DissectorInjector.sln @@ -1,6 +1,8 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DissectorInjector", "DissectorInjector\DissectorInjector.vcxproj", "{5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}" ProjectSection(ProjectDependencies) = postProject {A6A1B567-08F3-4312-8E74-6F6BFB4E258E} = {A6A1B567-08F3-4312-8E74-6F6BFB4E258E} @@ -25,29 +27,51 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}.Debug|Win32.ActiveCfg = Debug|Win32 {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}.Debug|Win32.Build.0 = Debug|Win32 + {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}.Debug|x64.ActiveCfg = Debug|x64 + {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}.Debug|x64.Build.0 = Debug|x64 {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}.Release|Win32.ActiveCfg = Release|Win32 {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}.Release|Win32.Build.0 = Release|Win32 + {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}.Release|x64.ActiveCfg = Release|x64 + {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D}.Release|x64.Build.0 = Release|x64 {8081C1FB-31C0-4C81-99BF-1FE28610135B}.Debug|Win32.ActiveCfg = Debug|Win32 {8081C1FB-31C0-4C81-99BF-1FE28610135B}.Debug|Win32.Build.0 = Debug|Win32 + {8081C1FB-31C0-4C81-99BF-1FE28610135B}.Debug|x64.ActiveCfg = Debug|x64 + {8081C1FB-31C0-4C81-99BF-1FE28610135B}.Debug|x64.Build.0 = Debug|x64 {8081C1FB-31C0-4C81-99BF-1FE28610135B}.Release|Win32.ActiveCfg = Release|Win32 {8081C1FB-31C0-4C81-99BF-1FE28610135B}.Release|Win32.Build.0 = Release|Win32 + {8081C1FB-31C0-4C81-99BF-1FE28610135B}.Release|x64.ActiveCfg = Release|x64 + {8081C1FB-31C0-4C81-99BF-1FE28610135B}.Release|x64.Build.0 = Release|x64 {A6A1B567-08F3-4312-8E74-6F6BFB4E258E}.Debug|Win32.ActiveCfg = Debug|Win32 {A6A1B567-08F3-4312-8E74-6F6BFB4E258E}.Debug|Win32.Build.0 = Debug|Win32 + {A6A1B567-08F3-4312-8E74-6F6BFB4E258E}.Debug|x64.ActiveCfg = Debug|x64 + {A6A1B567-08F3-4312-8E74-6F6BFB4E258E}.Debug|x64.Build.0 = Debug|x64 {A6A1B567-08F3-4312-8E74-6F6BFB4E258E}.Release|Win32.ActiveCfg = Release|Win32 {A6A1B567-08F3-4312-8E74-6F6BFB4E258E}.Release|Win32.Build.0 = Release|Win32 + {A6A1B567-08F3-4312-8E74-6F6BFB4E258E}.Release|x64.ActiveCfg = Release|x64 + {A6A1B567-08F3-4312-8E74-6F6BFB4E258E}.Release|x64.Build.0 = Release|x64 {DB0172D5-A6AF-4708-BCE6-9B0163501248}.Debug|Win32.ActiveCfg = Debug|Win32 {DB0172D5-A6AF-4708-BCE6-9B0163501248}.Debug|Win32.Build.0 = Debug|Win32 + {DB0172D5-A6AF-4708-BCE6-9B0163501248}.Debug|x64.ActiveCfg = Debug|x64 + {DB0172D5-A6AF-4708-BCE6-9B0163501248}.Debug|x64.Build.0 = Debug|x64 {DB0172D5-A6AF-4708-BCE6-9B0163501248}.Release|Win32.ActiveCfg = Release|Win32 {DB0172D5-A6AF-4708-BCE6-9B0163501248}.Release|Win32.Build.0 = Release|Win32 + {DB0172D5-A6AF-4708-BCE6-9B0163501248}.Release|x64.ActiveCfg = Release|x64 + {DB0172D5-A6AF-4708-BCE6-9B0163501248}.Release|x64.Build.0 = Release|x64 {6C2E649F-0B11-4CAA-B310-576536CF29EB}.Debug|Win32.ActiveCfg = Debug|Win32 {6C2E649F-0B11-4CAA-B310-576536CF29EB}.Debug|Win32.Build.0 = Debug|Win32 + {6C2E649F-0B11-4CAA-B310-576536CF29EB}.Debug|x64.ActiveCfg = Debug|x64 + {6C2E649F-0B11-4CAA-B310-576536CF29EB}.Debug|x64.Build.0 = Debug|x64 {6C2E649F-0B11-4CAA-B310-576536CF29EB}.Release|Win32.ActiveCfg = Release|Win32 {6C2E649F-0B11-4CAA-B310-576536CF29EB}.Release|Win32.Build.0 = Release|Win32 + {6C2E649F-0B11-4CAA-B310-576536CF29EB}.Release|x64.ActiveCfg = Release|x64 + {6C2E649F-0B11-4CAA-B310-576536CF29EB}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/DissectorInjector/DissectorInjector/DissectorInjector.cpp b/DissectorInjector/DissectorInjector/DissectorInjector.cpp index edb7f21..1bc9354 100644 --- a/DissectorInjector/DissectorInjector/DissectorInjector.cpp +++ b/DissectorInjector/DissectorInjector/DissectorInjector.cpp @@ -5,10 +5,11 @@ #include "stdafx.h" #include "Injection.h" #include "DissectorInjectorDLL\DLLExports.h" +#include int wmain(int argc, WCHAR* argv[]) { - DoNothing(); + DoNothing(); // Necessary for some reason. I think it's because it calls in to the DLL. Also possibly magic. STARTUPINFOW startinfo; PROCESS_INFORMATION procinfo; @@ -56,8 +57,35 @@ int wmain(int argc, WCHAR* argv[]) if( !ret ) return -1; - InjectIntoProcess( procinfo.dwProcessId, false, waitForDebugger ? 60 : 0 ); - ResumeThread( procinfo.hThread ); + InjectReturns injectres = InjectIntoProcess(procinfo.dwProcessId, false, waitForDebugger ? 60 : 0); + switch (injectres) + { + case(eInjectSuccess) : ResumeThread(procinfo.hThread); break; + case(eInjectFailedBitMismatch) : + { + std::wstring exeName = argv[0]; +#ifdef WIN64 + exeName = exeName.substr(0, exeName.length() - 8); + exeName += L".exe"; +#else + exeName = exeName.substr(0, exeName.length() - 4); + exeName += L"_x64.exe"; +#endif + std::wstring commandLine; + for (WCHAR** iter = &argv[1], **end = &argv[argc]; iter < end; ++iter) + { + commandLine += ' '; + commandLine += '"'; + commandLine += *iter; + commandLine += '"'; + } + + BOOL ret = CreateProcess(exeName.c_str(), (LPWSTR)commandLine.c_str(), NULL, NULL, FALSE, + CREATE_NO_WINDOW, NULL, dir, &startinfo, &procinfo); + + }break; + default: break; + } return 0; } diff --git a/DissectorInjector/DissectorInjector/DissectorInjector.vcxproj b/DissectorInjector/DissectorInjector/DissectorInjector.vcxproj index adc5b8b..6016f18 100644 --- a/DissectorInjector/DissectorInjector/DissectorInjector.vcxproj +++ b/DissectorInjector/DissectorInjector/DissectorInjector.vcxproj @@ -1,14 +1,22 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {5FD7AEC0-07CE-4EA5-9FFB-9B34D41D2C7D} @@ -20,12 +28,27 @@ Application true Unicode + v120 + + + Application + true + Unicode + v120 Application false true Unicode + v120 + + + Application + false + true + Unicode + v120 @@ -33,16 +56,30 @@ + + + + + + true + + true + $(ProjectName)_x64 + false + + false + $(ProjectName)_x64 + Use @@ -62,6 +99,25 @@ false + + + Use + Level3 + Disabled + WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + + + Console + true + DissectorInjectorDLL_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + ..\x64\Debug + + + false + + Level3 @@ -88,6 +144,38 @@ copy /y $(SolutionDir)$(Configuration)\DissectorInjector.exe $(SolutionDir)\..\bin\ copy /y $(SolutionDir)$(Configuration)\DissectorInjectorDLL.dll $(SolutionDir)\..\bin\ + + + + Copy to bin + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + Console + true + true + true + DissectorInjectorDLL_x64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + ..\x64\Release + + + + + + + copy /y $(SolutionDir)$(Platform)\$(Configuration)\$(TargetName).exe $(SolutionDir)\..\bin\ +copy /y $(SolutionDir)$(Platform)\$(Configuration)\DissectorInjectorDLL_x64.dll $(SolutionDir)\..\bin\ @@ -106,7 +194,9 @@ copy /y $(SolutionDir)$(Configuration)\DissectorInjectorDLL.dll $(SolutionDir)\. Create + Create Create + Create diff --git a/DissectorInjector/DissectorInjector/Injection.cpp b/DissectorInjector/DissectorInjector/Injection.cpp index ac94bc9..e217adb 100644 --- a/DissectorInjector/DissectorInjector/Injection.cpp +++ b/DissectorInjector/DissectorInjector/Injection.cpp @@ -26,6 +26,7 @@ #include "stdafx.h" #include #include +#include "Injection.h" #ifndef _UINTPTR_T_DEFINED #ifdef _WIN64 @@ -36,6 +37,15 @@ typedef _W64 unsigned int uintptr_t; #define _UINTPTR_T_DEFINED #endif +#if defined(WIN64) +static const char* dllName = "dissectorinjectordll_x64.dll"; +static const WCHAR* dllNameL = L"dissectorinjectordll_x64.dll"; +#else +static const char* dllName = "dissectorinjectordll.dll"; +static const WCHAR* dllNameL = L"dissectorinjectordll.dll"; +#endif + + #define RDCEraseMem(a, b) memset(a, 0, b) #define RDCEraseEl(a) memset(&a, 0, sizeof(a)) @@ -56,7 +66,7 @@ void InjectDLL(HANDLE hProcess, WCHAR* libName) VirtualFreeEx(hProcess, remoteMem, sizeof(dllPath), MEM_RELEASE); } -uintptr_t FindRemoteDLL(DWORD pid, WCHAR* libName) +uintptr_t FindRemoteDLL(DWORD pid, const WCHAR* libName) { HANDLE hModuleSnap = INVALID_HANDLE_VALUE; @@ -146,7 +156,8 @@ void InjectFunctionCall(HANDLE hProcess, uintptr_t renderdoc_remote, const char printf("Injecting call to %hs", funcName); - HMODULE renderdoc_local = GetModuleHandleA("dissectorinjectordll.dll"); + + HMODULE renderdoc_local = GetModuleHandleA(dllName); uintptr_t func_local = (uintptr_t)GetProcAddress(renderdoc_local, funcName); @@ -167,11 +178,11 @@ void InjectFunctionCall(HANDLE hProcess, uintptr_t renderdoc_remote, const char VirtualFreeEx(hProcess, remoteMem, dataLen, MEM_RELEASE); } -unsigned int InjectIntoProcess(unsigned int pid, bool waitForExit, unsigned int waitForDebugger ) +InjectReturns InjectIntoProcess(unsigned int pid, bool waitForExit, unsigned int waitForDebugger) { HANDLE hProcess = OpenProcess( PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | - PROCESS_VM_WRITE | PROCESS_VM_READ | SYNCHRONIZE, + PROCESS_VM_WRITE | PROCESS_VM_READ | PROCESS_TERMINATE | SYNCHRONIZE, FALSE, pid ); if(waitForDebugger > 0) @@ -200,91 +211,41 @@ unsigned int InjectIntoProcess(unsigned int pid, bool waitForExit, unsigned int //RDCLOG("Injecting renderdoc into process %lu", pid); - wchar_t renderdocPath[MAX_PATH] = {0}; - GetModuleFileNameW(GetModuleHandleA("dissectorinjectordll.dll"), &renderdocPath[0], MAX_PATH-1); + wchar_t dllpath[MAX_PATH] = {0}; + GetModuleFileNameW(GetModuleHandleA(dllName), &dllpath[0], MAX_PATH - 1); BOOL isWow64 = FALSE; - BOOL success = IsWow64Process(hProcess, &isWow64); + BOOL success = IsWow64Process(hProcess, &isWow64); // This actually returns if the application bitness is different than the OS bitness if(!success) { printf("Couldn't determine bitness of process\n"); CloseHandle(hProcess); - return 0; + return eInjectFailed; } -#if !defined(WIN64) - if(!isWow64) - { - printf("Can't capture x64 process with x86 renderdoc\n"); - CloseHandle(hProcess); - return 0; - } +#ifdef WIN64 + if (isWow64) + { + TerminateProcess(hProcess, 0); + return eInjectFailedBitMismatch; + } #else - // farm off to x86 version - if(isWow64) - { - wchar_t *slash = wcsrchr(renderdocPath, L'\\'); - - if(slash) *slash = 0; - - wcscat_s(renderdocPath, L"\\x86\\renderdoccmd.exe"); - - PROCESS_INFORMATION pi; - STARTUPINFO si; - SECURITY_ATTRIBUTES pSec; - SECURITY_ATTRIBUTES tSec; - - RDCEraseEl(pi); - RDCEraseEl(si); - RDCEraseEl(pSec); - RDCEraseEl(tSec); - - pSec.nLength = sizeof(pSec); - tSec.nLength = sizeof(tSec); - - wchar_t *paramsAlloc = new wchar_t[256]; - - string optstr = opts->ToString(); - - _snwprintf_s(paramsAlloc, 255, 255, L"\"%ls\" -cap32for64 %d \"%ls\" \"%hs\"", renderdocPath, pid, logfile, optstr.c_str()); - - BOOL retValue = CreateProcessW(NULL, paramsAlloc, &pSec, &tSec, false, CREATE_SUSPENDED, NULL, NULL, &si, &pi); - - SAFE_DELETE_ARRAY(paramsAlloc); - - if (!retValue) - { - printf("Can't spawn x86 renderdoccmd - missing files?\n"); - return 0; - } - - ResumeThread(pi.hThread); - WaitForSingleObject(pi.hThread, INFINITE); - CloseHandle(pi.hThread); - - DWORD exitCode = 0; - GetExitCodeProcess(pi.hProcess, &exitCode); - CloseHandle(pi.hProcess); - - if(waitForExit) - WaitForSingleObject(hProcess, INFINITE); - - CloseHandle(hProcess); - - return (uint32_t)exitCode; - } + if (!isWow64) + { + TerminateProcess(hProcess, 0); + return eInjectFailedBitMismatch; + } #endif - // misc InjectDLL(hProcess, L"kernel32.dll"); // D3D11 InjectDLL(hProcess, L"d3d9.dll"); - InjectDLL(hProcess, renderdocPath); + InjectDLL(hProcess, dllpath); - uintptr_t loc = FindRemoteDLL(pid, L"dissectorinjectordll.dll"); + uintptr_t loc = FindRemoteDLL(pid, dllNameL); unsigned int remoteident = 0; @@ -303,5 +264,5 @@ unsigned int InjectIntoProcess(unsigned int pid, bool waitForExit, unsigned int CloseHandle(hProcess); - return remoteident; + return eInjectSuccess; } \ No newline at end of file diff --git a/DissectorInjector/DissectorInjector/Injection.h b/DissectorInjector/DissectorInjector/Injection.h index b3569bb..9b4aabf 100644 --- a/DissectorInjector/DissectorInjector/Injection.h +++ b/DissectorInjector/DissectorInjector/Injection.h @@ -24,4 +24,10 @@ * THE SOFTWARE. ******************************************************************************/ -unsigned int InjectIntoProcess(unsigned int pid, bool waitForExit, unsigned int waitForDebugger ); +enum InjectReturns { + eInjectSuccess = 0, + eInjectFailed, + eInjectFailedBitMismatch, +}; + +InjectReturns InjectIntoProcess(unsigned int pid, bool waitForExit, unsigned int waitForDebugger); diff --git a/DissectorInjectorDLL/DissectorInjectorDLL.vcxproj b/DissectorInjectorDLL/DissectorInjectorDLL.vcxproj index d51bff4..c8cfc3c 100644 --- a/DissectorInjectorDLL/DissectorInjectorDLL.vcxproj +++ b/DissectorInjectorDLL/DissectorInjectorDLL.vcxproj @@ -1,14 +1,22 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {6C2E649F-0B11-4CAA-B310-576536CF29EB} @@ -19,12 +27,27 @@ DynamicLibrary true Unicode + v120 + + + DynamicLibrary + true + Unicode + v120 DynamicLibrary false true Unicode + v120 + + + DynamicLibrary + false + true + Unicode + v120 @@ -32,17 +55,29 @@ + + + + + + - + + $(ProjectName)_x64 + + + $(ProjectName)_x64 + Level3 Disabled ..\; MultiThreadedDebugDLL + true true @@ -53,6 +88,23 @@ true + + + Level3 + Disabled + ..\; + MultiThreadedDebugDLL + true + + + true + d3dx9.lib;Dissector.lib;DissectorDX9.lib;DissectorWinSock.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\x64\$(Configuration)\;$(DXSDK_DIR)\lib\x64\ + + + true + + Level3 @@ -61,6 +113,7 @@ true ..\; MultiThreadedDLL + true true @@ -70,6 +123,24 @@ $(SolutionDir)$(Configuration)\;$(DXSDK_DIR)\lib\x86\ + + + Level3 + MaxSpeed + true + true + ..\; + MultiThreadedDLL + true + + + true + true + true + d3dx9.lib;Dissector.lib;DissectorDX9.lib;DissectorWinSock.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\x64\$(Configuration)\;$(DXSDK_DIR)\lib\x64\ + + diff --git a/DissectorInjectorDLL/Hooks.cpp b/DissectorInjectorDLL/Hooks.cpp index 6979ed7..504b149 100644 --- a/DissectorInjectorDLL/Hooks.cpp +++ b/DissectorInjectorDLL/Hooks.cpp @@ -88,7 +88,7 @@ LRESULT CALLBACK WinProcOverride(HWND hWnd,UINT uint_Message,WPARAM wParam,LPARA LRESULT res = CallWindowProc(gSavedWinProc, hWnd,uint_Message,wParam,lParam); if( !gKeepRunning ) { - SetWindowLongPtr( hWnd, GWL_WNDPROC, (LONG)gSavedWinProc ); + SetWindowLongPtr( hWnd, GWLP_WNDPROC, (LONG_PTR)gSavedWinProc ); gSavedWinProc = NULL; } return res; @@ -98,7 +98,7 @@ void SlaveEnded() { if( gSavedWinProc ) { - SetWindowLongPtr( gHWND, GWL_WNDPROC, (LONG)gSavedWinProc ); + SetWindowLongPtr(gHWND, GWLP_WNDPROC, (LONG_PTR)gSavedWinProc); } } @@ -143,10 +143,10 @@ void PresentInternal( IDirect3DDevice9* iDevice, HRESULT res ) Dissector::EndFrame( iDevice ); DissectorDX9::SetUIPumpFunction( PumpFunction ); gKeepRunning = true; - gSavedWinProc = (WNDPROC)GetWindowLongPtr( gHWND, GWL_WNDPROC ); + gSavedWinProc = (WNDPROC)GetWindowLongPtr( gHWND, GWLP_WNDPROC ); if( gSavedWinProc ) { - SetWindowLongPtr( gHWND, GWL_WNDPROC, (LONG)&WinProcOverride ); + SetWindowLongPtr( gHWND, GWLP_WNDPROC, (LONG_PTR)&WinProcOverride ); } Dissector::SetSlaveEndingCallback( SlaveEnded ); diff --git a/DissectorWinSock/DissectorWinSock.vcxproj b/DissectorWinSock/DissectorWinSock.vcxproj index af90175..a68a715 100644 --- a/DissectorWinSock/DissectorWinSock.vcxproj +++ b/DissectorWinSock/DissectorWinSock.vcxproj @@ -1,14 +1,22 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {DB0172D5-A6AF-4708-BCE6-9B0163501248} @@ -19,12 +27,27 @@ StaticLibrary true NotSet + v120 + + + StaticLibrary + true + NotSet + v120 StaticLibrary false true NotSet + v120 + + + StaticLibrary + false + true + NotSet + v120 @@ -32,9 +55,15 @@ + + + + + + @@ -42,6 +71,18 @@ Level3 Disabled MultiThreadedDebugDLL + true + + + true + + + + + Level3 + Disabled + MultiThreadedDebugDLL + true true @@ -54,6 +95,22 @@ true true MultiThreadedDLL + true + + + true + true + true + + + + + Level3 + MaxSpeed + true + true + MultiThreadedDLL + true true diff --git a/bin/DissectorGUI.exe b/bin/DissectorGUI.exe index 2fe54a8..d617f70 100644 Binary files a/bin/DissectorGUI.exe and b/bin/DissectorGUI.exe differ diff --git a/bin/DissectorInjector.exe b/bin/DissectorInjector.exe index 53301e4..580c91e 100644 Binary files a/bin/DissectorInjector.exe and b/bin/DissectorInjector.exe differ diff --git a/bin/DissectorInjectorDLL.dll b/bin/DissectorInjectorDLL.dll index d0621e3..5b84a85 100644 Binary files a/bin/DissectorInjectorDLL.dll and b/bin/DissectorInjectorDLL.dll differ diff --git a/bin/DissectorInjectorDLL_x64.dll b/bin/DissectorInjectorDLL_x64.dll new file mode 100644 index 0000000..974fadc Binary files /dev/null and b/bin/DissectorInjectorDLL_x64.dll differ diff --git a/bin/DissectorInjector_x64.exe b/bin/DissectorInjector_x64.exe new file mode 100644 index 0000000..cc69280 Binary files /dev/null and b/bin/DissectorInjector_x64.exe differ