Skip to content

Commit

Permalink
add threaded scanner, symbol foreach, RTTI/VT preloading
Browse files Browse the repository at this point in the history
  • Loading branch information
sigsegv-mvm committed Jan 27, 2016
1 parent dbbb541 commit e235a4b
Show file tree
Hide file tree
Showing 52 changed files with 1,918 additions and 976 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
build/
MSVC14/Debug/
MSVC14/Release/
MSVC14/Binary/
MSVC14/packages/
MSVC14/*.suo
MSVC14/*.user
MSVC14/.vs
8 changes: 5 additions & 3 deletions AMBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sourceFiles = [
'prop.cpp',
'util/trace.cpp',
'util/backtrace.cpp',
'util/rtti.cpp',
'stub/baseentity.cpp',
'stub/gamerules.cpp',
'stub/misc.cpp',
Expand All @@ -43,9 +44,10 @@ sourceFiles = [
'mod/mod_stickypusher.cpp',
'mod/mod_robottickle.cpp',
'mod/mod_botmulticlassitem.cpp',
'mod/debug_airblastbox.cpp',
'mod/debug_deflectcylinder.cpp',
'mod/debug_ehsphere.cpp',
'mod/mod_robotheadnoslide.cpp',
'mod/visualize_airblastbox.cpp',
'mod/visualize_deflectcylinder.cpp',
'mod/visualize_ehsphere.cpp',
]

###############
Expand Down
22 changes: 18 additions & 4 deletions MSVC14/Performance.psess
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Solution>sigsegv.sln</Solution>
<CollectionMethod>Instrumentation</CollectionMethod>
<AllocationMethod>None</AllocationMethod>
<Reportname>C:\Profiling\Report.vsp</Reportname>
<Reportname>C:\Profiling\Instrumentation.vsp</Reportname>
<AddReport>true</AddReport>
<ResourceBasedAnalysisSelected>true</ResourceBasedAnalysisSelected>
<UniqueReport>Timestamp</UniqueReport>
Expand All @@ -14,6 +14,8 @@
<SysCallCount>10</SysCallCount>
<SamplingCounter Name="" ReloadValue="00000000000f4240" DisplayName="" />
<RelocateBinaries>false</RelocateBinaries>
<BinaryLocation>
</BinaryLocation>
<HardwareCounters EnableHWCounters="false" />
<EtwSettings />
<PdhSettings>
Expand All @@ -30,14 +32,26 @@
<InteractionProfilingEnabled>false</InteractionProfilingEnabled>
<JScriptProfilingEnabled>false</JScriptProfilingEnabled>
<PreinstrumentEvent>
<InstrEventProgram>
</InstrEventProgram>
<InstrEventArguments>
</InstrEventArguments>
<InstrEventDescription>
</InstrEventDescription>
<InstrEventExclude>false</InstrEventExclude>
</PreinstrumentEvent>
<PostinstrumentEvent>
<InstrEventProgram>
</InstrEventProgram>
<InstrEventArguments>
</InstrEventArguments>
<InstrEventDescription>
</InstrEventDescription>
<InstrEventExclude>false</InstrEventExclude>
</PostinstrumentEvent>
<Binaries>
<ProjBinary>
<Path>Release\sigsegv.ext.2.tf2.dll</Path>
<Path>Binary\sigsegv.ext.2.tf2.dll</Path>
<ArgumentTimestamp>01/01/0001 00:00:00</ArgumentTimestamp>
<Instrument>true</Instrument>
<Sample>true</Sample>
Expand All @@ -54,7 +68,7 @@
</Arguments>
<NetAppHost>IIS</NetAppHost>
<NetBrowser>InternetExplorer</NetBrowser>
<ExcludeSmallFuncs>true</ExcludeSmallFuncs>
<ExcludeSmallFuncs>false</ExcludeSmallFuncs>
<JScriptProfilingEnabled>false</JScriptProfilingEnabled>
<PreinstrumentEvent>
<InstrEventExclude>false</InstrEventExclude>
Expand Down Expand Up @@ -85,7 +99,7 @@
+exec cheat</Arguments>
<NetAppHost>IIS</NetAppHost>
<NetBrowser>InternetExplorer</NetBrowser>
<ExcludeSmallFuncs>true</ExcludeSmallFuncs>
<ExcludeSmallFuncs>false</ExcludeSmallFuncs>
<JScriptProfilingEnabled>false</JScriptProfilingEnabled>
<PreinstrumentEvent>
<InstrEventExclude>false</InstrEventExclude>
Expand Down
103 changes: 103 additions & 0 deletions MSVC14/hl2.psess
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<VSPerformanceSession Version="1.00">
<Options>
<Solution>sigsegv.sln</Solution>
<CollectionMethod>Sampling</CollectionMethod>
<AllocationMethod>None</AllocationMethod>
<Reportname>C:\Profiling\Sampling.vsp</Reportname>
<AddReport>true</AddReport>
<ResourceBasedAnalysisSelected>true</ResourceBasedAnalysisSelected>
<UniqueReport>Timestamp</UniqueReport>
<SamplingMethod>Cycles</SamplingMethod>
<CycleCount>10000000</CycleCount>
<PageFaultCount>10</PageFaultCount>
<SysCallCount>10</SysCallCount>
<SamplingCounter Name="" ReloadValue="00000000000f4240" DisplayName="" />
<RelocateBinaries>false</RelocateBinaries>
<HardwareCounters EnableHWCounters="false" />
<EtwSettings />
<PdhSettings>
<PdhCountersEnabled>false</PdhCountersEnabled>
<PdhCountersRate>500</PdhCountersRate>
<PdhCounters>
<PdhCounter>\(_Total)\</PdhCounter>
<PdhCounter>\(_Total)\</PdhCounter>
<PdhCounter>\\</PdhCounter>
</PdhCounters>
</PdhSettings>
</Options>
<ExcludeSmallFuncs>true</ExcludeSmallFuncs>
<InteractionProfilingEnabled>false</InteractionProfilingEnabled>
<JScriptProfilingEnabled>false</JScriptProfilingEnabled>
<PreinstrumentEvent>
<InstrEventExclude>false</InstrEventExclude>
</PreinstrumentEvent>
<PostinstrumentEvent>
<InstrEventExclude>false</InstrEventExclude>
</PostinstrumentEvent>
<Binaries>
<Binary>
<Path>C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\hl2.exe</Path>
<ArgumentTimestamp>01/01/0001 00:00:00</ArgumentTimestamp>
<Instrument>true</Instrument>
<Sample>false</Sample>
<ExternalWebsite>false</ExternalWebsite>
<InteractionProfilingEnabled>false</InteractionProfilingEnabled>
<IsLocalJavascript>false</IsLocalJavascript>
<IsWindowsStoreApp>false</IsWindowsStoreApp>
<IsWWA>false</IsWWA>
<LaunchProject>false</LaunchProject>
<OverrideProjectSettings>true</OverrideProjectSettings>
<LaunchMethod>Executable</LaunchMethod>
<ExecutablePath>C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\hl2.exe</ExecutablePath>
<StartupDirectory>C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\</StartupDirectory>
<Arguments>-steam -game tf -novid -console -condebug -insecure -windowed -w 1280 -h 720 +maxplayers 32 +developer 1 +map mvm_example
+exec cheat</Arguments>
<NetAppHost>IIS</NetAppHost>
<NetBrowser>InternetExplorer</NetBrowser>
<ExcludeSmallFuncs>true</ExcludeSmallFuncs>
<JScriptProfilingEnabled>false</JScriptProfilingEnabled>
<PreinstrumentEvent>
<InstrEventExclude>false</InstrEventExclude>
</PreinstrumentEvent>
<PostinstrumentEvent>
<InstrEventExclude>false</InstrEventExclude>
</PostinstrumentEvent>
</Binary>
<ProjBinary>
<Path>Binary\sigsegv.ext.2.tf2.dll</Path>
<ArgumentTimestamp>01/01/0001 00:00:00</ArgumentTimestamp>
<Instrument>true</Instrument>
<Sample>true</Sample>
<ExternalWebsite>false</ExternalWebsite>
<InteractionProfilingEnabled>false</InteractionProfilingEnabled>
<IsLocalJavascript>false</IsLocalJavascript>
<IsWindowsStoreApp>false</IsWindowsStoreApp>
<IsWWA>false</IsWWA>
<LaunchProject>true</LaunchProject>
<OverrideProjectSettings>false</OverrideProjectSettings>
<LaunchMethod>Executable</LaunchMethod>
<StartupDirectory>.\</StartupDirectory>
<Arguments>
</Arguments>
<NetAppHost>IIS</NetAppHost>
<NetBrowser>InternetExplorer</NetBrowser>
<ExcludeSmallFuncs>true</ExcludeSmallFuncs>
<JScriptProfilingEnabled>false</JScriptProfilingEnabled>
<PreinstrumentEvent>
<InstrEventExclude>false</InstrEventExclude>
</PreinstrumentEvent>
<PostinstrumentEvent>
<InstrEventExclude>false</InstrEventExclude>
</PostinstrumentEvent>
<ProjRef>{B3E797CF-4E77-4C9D-B8A8-7589B6902206}|sigsegv.vcxproj</ProjRef>
<ProjPath>sigsegv.vcxproj</ProjPath>
<ProjName>sigsegv</ProjName>
</ProjBinary>
</Binaries>
<Launches>
<Binary>
<Path>C:\Program Files (x86)\Steam\SteamApps\common\Team Fortress 2\hl2.exe</Path>
</Binary>
</Launches>
</VSPerformanceSession>
4 changes: 4 additions & 0 deletions MSVC14/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="boost" version="1.60.0.0" targetFramework="native" />
</packages>
34 changes: 27 additions & 7 deletions MSVC14/sigsegv.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<RootNamespace>sigsegv</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>sigsegv</ProjectName>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand Down Expand Up @@ -55,6 +56,12 @@
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">sigsegv.ext.2.tf2</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">sigsegv.ext.2.tf2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)Binary\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)Binary\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalOptions>/D SE_EPISODEONE=1 /D SE_DARKMESSIAH=2 /D SE_ORANGEBOX=3 /D SE_BLOODYGOODTIME=4 /D SE_EYE=5 /D SE_CSS=6 /D SE_ORANGEBOXVALVE=7 /D SE_LEFT4DEAD=8 /D SE_LEFT4DEAD2=9 /D SE_ALIENSWARM=10 /D SE_PORTAL2=11 /D SE_CSGO=12</AdditionalOptions>
Expand Down Expand Up @@ -91,8 +98,8 @@
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
</Link>
<PostBuildEvent>
<Command>copy $(TargetDir)\sigsegv.ext.2.tf2.dll $(SolutionDir)\..\build\package\addons\sourcemod\extensions\
copy $(TargetDir)\sigsegv.ext.2.tf2.pdb $(SolutionDir)\..\build\package\addons\sourcemod\extensions\</Command>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down Expand Up @@ -128,8 +135,8 @@ copy $(TargetDir)\sigsegv.ext.2.tf2.pdb $(SolutionDir)\..\build\package\addons\s
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
</Link>
<PostBuildEvent>
<Command>copy $(TargetDir)\sigsegv.ext.2.tf2.dll $(SolutionDir)\..\build\package\addons\sourcemod\extensions\
copy $(TargetDir)\sigsegv.ext.2.tf2.pdb $(SolutionDir)\..\build\package\addons\sourcemod\extensions\</Command>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
Expand All @@ -155,15 +162,16 @@ copy $(TargetDir)\sigsegv.ext.2.tf2.pdb $(SolutionDir)\..\build\package\addons\s
<ClCompile Include="..\mem\patch.cpp" />
<ClCompile Include="..\mem\scan.cpp" />
<ClCompile Include="..\mod.cpp" />
<ClCompile Include="..\mod\debug_airblastbox.cpp" />
<ClCompile Include="..\mod\debug_deflectcylinder.cpp" />
<ClCompile Include="..\mod\debug_ehsphere.cpp" />
<ClCompile Include="..\mod\mod_autocollectspawncredits.cpp" />
<ClCompile Include="..\mod\mod_botmulticlassitem.cpp" />
<ClCompile Include="..\mod\mod_engienopush.cpp" />
<ClCompile Include="..\mod\mod_robotheadnoslide.cpp" />
<ClCompile Include="..\mod\mod_robottickle.cpp" />
<ClCompile Include="..\mod\mod_sniperchargeuncap.cpp" />
<ClCompile Include="..\mod\mod_stickypusher.cpp" />
<ClCompile Include="..\mod\visualize_airblastbox.cpp" />
<ClCompile Include="..\mod\visualize_deflectcylinder.cpp" />
<ClCompile Include="..\mod\visualize_ehsphere.cpp" />
<ClCompile Include="..\prop.cpp" />
<ClCompile Include="..\sdk2013\debugoverlay_shared.cpp" />
<ClCompile Include="..\sdk\smsdk_ext.cpp" />
Expand All @@ -179,6 +187,7 @@ copy $(TargetDir)\sigsegv.ext.2.tf2.pdb $(SolutionDir)\..\build\package\addons\s
<ClCompile Include="..\stub\tfbot.cpp" />
<ClCompile Include="..\stub\tfplayer.cpp" />
<ClCompile Include="..\util\backtrace.cpp" />
<ClCompile Include="..\util\rtti.cpp" />
<ClCompile Include="..\util\trace.cpp" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -224,11 +233,22 @@ copy $(TargetDir)\sigsegv.ext.2.tf2.pdb $(SolutionDir)\..\build\package\addons\s
<ClInclude Include="..\util\backtrace.h" />
<ClInclude Include="..\util\buf.h" />
<ClInclude Include="..\util\misc.h" />
<ClInclude Include="..\util\rtti.h" />
<ClInclude Include="..\util\scope.h" />
<ClInclude Include="..\util\trace.h" />
<ClInclude Include="..\util\util.h" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\boost.1.60.0.0\build\native\boost.targets" Condition="Exists('packages\boost.1.60.0.0\build\native\boost.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\boost.1.60.0.0\build\native\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\boost.1.60.0.0\build\native\boost.targets'))" />
</Target>
</Project>
30 changes: 21 additions & 9 deletions MSVC14/sigsegv.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,6 @@
<ClCompile Include="..\stub\tfplayer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mod\debug_airblastbox.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mod\debug_ehsphere.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mod\debug_deflectcylinder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\sdk2013\debugoverlay_shared.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -134,6 +125,21 @@
<ClCompile Include="..\mem\scan.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mod\mod_robotheadnoslide.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mod\visualize_airblastbox.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mod\visualize_deflectcylinder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mod\visualize_ehsphere.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\util\rtti.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\mod.h">
Expand Down Expand Up @@ -271,5 +277,11 @@
<ClInclude Include="..\mem\scan.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\util\rtti.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions PCH.mak
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
$(OUTFILE): $(INFILE)
#-rm $(OUTFILE)
#-touch $(OUTFILE)
$(CXX) -x c++-header $(INFILE) -o $(OUTFILE)
1 change: 1 addition & 0 deletions PackageScript
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def CopyFiles(src, dest, files):
# GameData files
CopyFiles('gamedata/sigsegv', 'addons/sourcemod/gamedata/sigsegv',
[
'rtti.txt',
'vtables.txt',
'datamaps.txt',
'globals.txt',
Expand Down
13 changes: 13 additions & 0 deletions abi.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,18 @@ struct __RTTI_CompleteObjectLocator
#pragma warning(default:4200)
#endif

#if defined _MSC_VER
/* from VC/crt/src/vcruntime/rtti.cpp */
extern "C" PVOID __CLRCALL_OR_CDECL __RTDynamicCast (
PVOID inptr,
LONG VfDelta,
// const _TypeDescriptor *SrcType,
// const _TypeDescriptor *TargetType,
PVOID SrcType,
PVOID TargetType,
BOOL isReference
) throw(...);
#endif


#endif
Loading

0 comments on commit e235a4b

Please sign in to comment.