Switch build system to CMake
This commit is contained in:
		
							parent
							
								
									aa1c8171b2
								
							
						
					
					
						commit
						7784f97820
					
				
					 24 changed files with 655 additions and 1084 deletions
				
			
		
							
								
								
									
										528
									
								
								ScrapHacks/.gitignore → .gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										528
									
								
								ScrapHacks/.gitignore → .gitignore
									
										
									
									
										vendored
									
									
								
							|  | @ -1,263 +1,265 @@ | |||
| ## Ignore Visual Studio temporary files, build results, and | ||||
| ## files generated by popular Visual Studio add-ons. | ||||
| 
 | ||||
| # User-specific files | ||||
| *.suo | ||||
| *.user | ||||
| *.userosscache | ||||
| *.sln.docstates | ||||
| 
 | ||||
| # User-specific files (MonoDevelop/Xamarin Studio) | ||||
| *.userprefs | ||||
| 
 | ||||
| # Build results | ||||
| [Dd]ebug/ | ||||
| [Dd]ebugPublic/ | ||||
| [Rr]elease/ | ||||
| [Rr]eleases/ | ||||
| x64/ | ||||
| x86/ | ||||
| bld/ | ||||
| [Bb]in/ | ||||
| [Oo]bj/ | ||||
| [Ll]og/ | ||||
| 
 | ||||
| # Visual Studio 2015 cache/options directory | ||||
| .vs/ | ||||
| # Uncomment if you have tasks that create the project's static files in wwwroot | ||||
| #wwwroot/ | ||||
| 
 | ||||
| # MSTest test Results | ||||
| [Tt]est[Rr]esult*/ | ||||
| [Bb]uild[Ll]og.* | ||||
| 
 | ||||
| # NUNIT | ||||
| *.VisualState.xml | ||||
| TestResult.xml | ||||
| 
 | ||||
| # Build Results of an ATL Project | ||||
| [Dd]ebugPS/ | ||||
| [Rr]eleasePS/ | ||||
| dlldata.c | ||||
| 
 | ||||
| # DNX | ||||
| project.lock.json | ||||
| project.fragment.lock.json | ||||
| artifacts/ | ||||
| 
 | ||||
| *_i.c | ||||
| *_p.c | ||||
| *_i.h | ||||
| *.ilk | ||||
| *.meta | ||||
| *.obj | ||||
| *.pch | ||||
| *.pdb | ||||
| *.pgc | ||||
| *.pgd | ||||
| *.rsp | ||||
| *.sbr | ||||
| *.tlb | ||||
| *.tli | ||||
| *.tlh | ||||
| *.tmp | ||||
| *.tmp_proj | ||||
| *.log | ||||
| *.vspscc | ||||
| *.vssscc | ||||
| .builds | ||||
| *.pidb | ||||
| *.svclog | ||||
| *.scc | ||||
| 
 | ||||
| # Chutzpah Test files | ||||
| _Chutzpah* | ||||
| 
 | ||||
| # Visual C++ cache files | ||||
| ipch/ | ||||
| *.aps | ||||
| *.ncb | ||||
| *.opendb | ||||
| *.opensdf | ||||
| *.sdf | ||||
| *.cachefile | ||||
| *.VC.db | ||||
| *.VC.VC.opendb | ||||
| 
 | ||||
| # Visual Studio profiler | ||||
| *.psess | ||||
| *.vsp | ||||
| *.vspx | ||||
| *.sap | ||||
| 
 | ||||
| # TFS 2012 Local Workspace | ||||
| $tf/ | ||||
| 
 | ||||
| # Guidance Automation Toolkit | ||||
| *.gpState | ||||
| 
 | ||||
| # ReSharper is a .NET coding add-in | ||||
| _ReSharper*/ | ||||
| *.[Rr]e[Ss]harper | ||||
| *.DotSettings.user | ||||
| 
 | ||||
| # JustCode is a .NET coding add-in | ||||
| .JustCode | ||||
| 
 | ||||
| # TeamCity is a build add-in | ||||
| _TeamCity* | ||||
| 
 | ||||
| # DotCover is a Code Coverage Tool | ||||
| *.dotCover | ||||
| 
 | ||||
| # NCrunch | ||||
| _NCrunch_* | ||||
| .*crunch*.local.xml | ||||
| nCrunchTemp_* | ||||
| 
 | ||||
| # MightyMoose | ||||
| *.mm.* | ||||
| AutoTest.Net/ | ||||
| 
 | ||||
| # Web workbench (sass) | ||||
| .sass-cache/ | ||||
| 
 | ||||
| # Installshield output folder | ||||
| [Ee]xpress/ | ||||
| 
 | ||||
| # DocProject is a documentation generator add-in | ||||
| DocProject/buildhelp/ | ||||
| DocProject/Help/*.HxT | ||||
| DocProject/Help/*.HxC | ||||
| DocProject/Help/*.hhc | ||||
| DocProject/Help/*.hhk | ||||
| DocProject/Help/*.hhp | ||||
| DocProject/Help/Html2 | ||||
| DocProject/Help/html | ||||
| 
 | ||||
| # Click-Once directory | ||||
| publish/ | ||||
| 
 | ||||
| # Publish Web Output | ||||
| *.[Pp]ublish.xml | ||||
| *.azurePubxml | ||||
| # TODO: Comment the next line if you want to checkin your web deploy settings | ||||
| # but database connection strings (with potential passwords) will be unencrypted | ||||
| #*.pubxml | ||||
| *.publishproj | ||||
| 
 | ||||
| # Microsoft Azure Web App publish settings. Comment the next line if you want to | ||||
| # checkin your Azure Web App publish settings, but sensitive information contained | ||||
| # in these scripts will be unencrypted | ||||
| PublishScripts/ | ||||
| 
 | ||||
| # NuGet Packages | ||||
| *.nupkg | ||||
| # The packages folder can be ignored because of Package Restore | ||||
| **/packages/* | ||||
| # except build/, which is used as an MSBuild target. | ||||
| !**/packages/build/ | ||||
| # Uncomment if necessary however generally it will be regenerated when needed | ||||
| #!**/packages/repositories.config | ||||
| # NuGet v3's project.json files produces more ignoreable files | ||||
| *.nuget.props | ||||
| *.nuget.targets | ||||
| 
 | ||||
| # Microsoft Azure Build Output | ||||
| csx/ | ||||
| *.build.csdef | ||||
| 
 | ||||
| # Microsoft Azure Emulator | ||||
| ecf/ | ||||
| rcf/ | ||||
| 
 | ||||
| # Windows Store app package directories and files | ||||
| AppPackages/ | ||||
| BundleArtifacts/ | ||||
| Package.StoreAssociation.xml | ||||
| _pkginfo.txt | ||||
| 
 | ||||
| # Visual Studio cache files | ||||
| # files ending in .cache can be ignored | ||||
| *.[Cc]ache | ||||
| # but keep track of directories ending in .cache | ||||
| !*.[Cc]ache/ | ||||
| 
 | ||||
| # Others | ||||
| ClientBin/ | ||||
| ~$* | ||||
| *~ | ||||
| *.dbmdl | ||||
| *.dbproj.schemaview | ||||
| *.jfm | ||||
| *.pfx | ||||
| *.publishsettings | ||||
| node_modules/ | ||||
| orleans.codegen.cs | ||||
| 
 | ||||
| # Since there are multiple workflows, uncomment next line to ignore bower_components | ||||
| # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) | ||||
| #bower_components/ | ||||
| 
 | ||||
| # RIA/Silverlight projects | ||||
| Generated_Code/ | ||||
| 
 | ||||
| # Backup & report files from converting an old project file | ||||
| # to a newer Visual Studio version. Backup files are not needed, | ||||
| # because we have git ;-) | ||||
| _UpgradeReport_Files/ | ||||
| Backup*/ | ||||
| UpgradeLog*.XML | ||||
| UpgradeLog*.htm | ||||
| 
 | ||||
| # SQL Server files | ||||
| *.mdf | ||||
| *.ldf | ||||
| 
 | ||||
| # Business Intelligence projects | ||||
| *.rdl.data | ||||
| *.bim.layout | ||||
| *.bim_*.settings | ||||
| 
 | ||||
| # Microsoft Fakes | ||||
| FakesAssemblies/ | ||||
| 
 | ||||
| # GhostDoc plugin setting file | ||||
| *.GhostDoc.xml | ||||
| 
 | ||||
| # Node.js Tools for Visual Studio | ||||
| .ntvs_analysis.dat | ||||
| 
 | ||||
| # Visual Studio 6 build log | ||||
| *.plg | ||||
| 
 | ||||
| # Visual Studio 6 workspace options file | ||||
| *.opt | ||||
| 
 | ||||
| # Visual Studio LightSwitch build output | ||||
| **/*.HTMLClient/GeneratedArtifacts | ||||
| **/*.DesktopClient/GeneratedArtifacts | ||||
| **/*.DesktopClient/ModelManifest.xml | ||||
| **/*.Server/GeneratedArtifacts | ||||
| **/*.Server/ModelManifest.xml | ||||
| _Pvt_Extensions | ||||
| 
 | ||||
| # Paket dependency manager | ||||
| .paket/paket.exe | ||||
| paket-files/ | ||||
| 
 | ||||
| # FAKE - F# Make | ||||
| .fake/ | ||||
| 
 | ||||
| # JetBrains Rider | ||||
| .idea/ | ||||
| *.sln.iml | ||||
| 
 | ||||
| # CodeRush | ||||
| .cr/ | ||||
| 
 | ||||
| # Python Tools for Visual Studio (PTVS) | ||||
| __pycache__/ | ||||
| *.pyc | ||||
| 
 | ||||
| ScrapHack/dx8/ | ||||
| ## Ignore Visual Studio temporary files, build results, and | ||||
| ## files generated by popular Visual Studio add-ons. | ||||
| 
 | ||||
| # User-specific files | ||||
| *.suo | ||||
| *.user | ||||
| *.userosscache | ||||
| *.sln.docstates | ||||
| 
 | ||||
| # User-specific files (MonoDevelop/Xamarin Studio) | ||||
| *.userprefs | ||||
| 
 | ||||
| # Build results | ||||
| [Dd]ebug/ | ||||
| [Dd]ebugPublic/ | ||||
| [Rr]elease/ | ||||
| [Rr]eleases/ | ||||
| x64/ | ||||
| x86/ | ||||
| bld/ | ||||
| [Bb]in/ | ||||
| [Oo]bj/ | ||||
| [Ll]og/ | ||||
| 
 | ||||
| # Visual Studio 2015 cache/options directory | ||||
| .vs/ | ||||
| # Uncomment if you have tasks that create the project's static files in wwwroot | ||||
| #wwwroot/ | ||||
| 
 | ||||
| # MSTest test Results | ||||
| [Tt]est[Rr]esult*/ | ||||
| [Bb]uild[Ll]og.* | ||||
| 
 | ||||
| # NUNIT | ||||
| *.VisualState.xml | ||||
| TestResult.xml | ||||
| 
 | ||||
| # Build Results of an ATL Project | ||||
| [Dd]ebugPS/ | ||||
| [Rr]eleasePS/ | ||||
| dlldata.c | ||||
| 
 | ||||
| # DNX | ||||
| project.lock.json | ||||
| project.fragment.lock.json | ||||
| artifacts/ | ||||
| 
 | ||||
| *_i.c | ||||
| *_p.c | ||||
| *_i.h | ||||
| *.ilk | ||||
| *.meta | ||||
| *.obj | ||||
| *.pch | ||||
| *.pdb | ||||
| *.pgc | ||||
| *.pgd | ||||
| *.rsp | ||||
| *.sbr | ||||
| *.tlb | ||||
| *.tli | ||||
| *.tlh | ||||
| *.tmp | ||||
| *.tmp_proj | ||||
| *.log | ||||
| *.vspscc | ||||
| *.vssscc | ||||
| .builds | ||||
| *.pidb | ||||
| *.svclog | ||||
| *.scc | ||||
| 
 | ||||
| # Chutzpah Test files | ||||
| _Chutzpah* | ||||
| 
 | ||||
| # Visual C++ cache files | ||||
| ipch/ | ||||
| *.aps | ||||
| *.ncb | ||||
| *.opendb | ||||
| *.opensdf | ||||
| *.sdf | ||||
| *.cachefile | ||||
| *.VC.db | ||||
| *.VC.VC.opendb | ||||
| 
 | ||||
| # Visual Studio profiler | ||||
| *.psess | ||||
| *.vsp | ||||
| *.vspx | ||||
| *.sap | ||||
| 
 | ||||
| # TFS 2012 Local Workspace | ||||
| $tf/ | ||||
| 
 | ||||
| # Guidance Automation Toolkit | ||||
| *.gpState | ||||
| 
 | ||||
| # ReSharper is a .NET coding add-in | ||||
| _ReSharper*/ | ||||
| *.[Rr]e[Ss]harper | ||||
| *.DotSettings.user | ||||
| 
 | ||||
| # JustCode is a .NET coding add-in | ||||
| .JustCode | ||||
| 
 | ||||
| # TeamCity is a build add-in | ||||
| _TeamCity* | ||||
| 
 | ||||
| # DotCover is a Code Coverage Tool | ||||
| *.dotCover | ||||
| 
 | ||||
| # NCrunch | ||||
| _NCrunch_* | ||||
| .*crunch*.local.xml | ||||
| nCrunchTemp_* | ||||
| 
 | ||||
| # MightyMoose | ||||
| *.mm.* | ||||
| AutoTest.Net/ | ||||
| 
 | ||||
| # Web workbench (sass) | ||||
| .sass-cache/ | ||||
| 
 | ||||
| # Installshield output folder | ||||
| [Ee]xpress/ | ||||
| 
 | ||||
| # DocProject is a documentation generator add-in | ||||
| DocProject/buildhelp/ | ||||
| DocProject/Help/*.HxT | ||||
| DocProject/Help/*.HxC | ||||
| DocProject/Help/*.hhc | ||||
| DocProject/Help/*.hhk | ||||
| DocProject/Help/*.hhp | ||||
| DocProject/Help/Html2 | ||||
| DocProject/Help/html | ||||
| 
 | ||||
| # Click-Once directory | ||||
| publish/ | ||||
| 
 | ||||
| # Publish Web Output | ||||
| *.[Pp]ublish.xml | ||||
| *.azurePubxml | ||||
| # TODO: Comment the next line if you want to checkin your web deploy settings | ||||
| # but database connection strings (with potential passwords) will be unencrypted | ||||
| #*.pubxml | ||||
| *.publishproj | ||||
| 
 | ||||
| # Microsoft Azure Web App publish settings. Comment the next line if you want to | ||||
| # checkin your Azure Web App publish settings, but sensitive information contained | ||||
| # in these scripts will be unencrypted | ||||
| PublishScripts/ | ||||
| 
 | ||||
| # NuGet Packages | ||||
| *.nupkg | ||||
| # The packages folder can be ignored because of Package Restore | ||||
| **/packages/* | ||||
| # except build/, which is used as an MSBuild target. | ||||
| !**/packages/build/ | ||||
| # Uncomment if necessary however generally it will be regenerated when needed | ||||
| #!**/packages/repositories.config | ||||
| # NuGet v3's project.json files produces more ignoreable files | ||||
| *.nuget.props | ||||
| *.nuget.targets | ||||
| 
 | ||||
| # Microsoft Azure Build Output | ||||
| csx/ | ||||
| *.build.csdef | ||||
| 
 | ||||
| # Microsoft Azure Emulator | ||||
| ecf/ | ||||
| rcf/ | ||||
| 
 | ||||
| # Windows Store app package directories and files | ||||
| AppPackages/ | ||||
| BundleArtifacts/ | ||||
| Package.StoreAssociation.xml | ||||
| _pkginfo.txt | ||||
| 
 | ||||
| # Visual Studio cache files | ||||
| # files ending in .cache can be ignored | ||||
| *.[Cc]ache | ||||
| # but keep track of directories ending in .cache | ||||
| !*.[Cc]ache/ | ||||
| 
 | ||||
| # Others | ||||
| ClientBin/ | ||||
| ~$* | ||||
| *~ | ||||
| *.dbmdl | ||||
| *.dbproj.schemaview | ||||
| *.jfm | ||||
| *.pfx | ||||
| *.publishsettings | ||||
| node_modules/ | ||||
| orleans.codegen.cs | ||||
| 
 | ||||
| # Since there are multiple workflows, uncomment next line to ignore bower_components | ||||
| # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) | ||||
| #bower_components/ | ||||
| 
 | ||||
| # RIA/Silverlight projects | ||||
| Generated_Code/ | ||||
| 
 | ||||
| # Backup & report files from converting an old project file | ||||
| # to a newer Visual Studio version. Backup files are not needed, | ||||
| # because we have git ;-) | ||||
| _UpgradeReport_Files/ | ||||
| Backup*/ | ||||
| UpgradeLog*.XML | ||||
| UpgradeLog*.htm | ||||
| 
 | ||||
| # SQL Server files | ||||
| *.mdf | ||||
| *.ldf | ||||
| 
 | ||||
| # Business Intelligence projects | ||||
| *.rdl.data | ||||
| *.bim.layout | ||||
| *.bim_*.settings | ||||
| 
 | ||||
| # Microsoft Fakes | ||||
| FakesAssemblies/ | ||||
| 
 | ||||
| # GhostDoc plugin setting file | ||||
| *.GhostDoc.xml | ||||
| 
 | ||||
| # Node.js Tools for Visual Studio | ||||
| .ntvs_analysis.dat | ||||
| 
 | ||||
| # Visual Studio 6 build log | ||||
| *.plg | ||||
| 
 | ||||
| # Visual Studio 6 workspace options file | ||||
| *.opt | ||||
| 
 | ||||
| # Visual Studio LightSwitch build output | ||||
| **/*.HTMLClient/GeneratedArtifacts | ||||
| **/*.DesktopClient/GeneratedArtifacts | ||||
| **/*.DesktopClient/ModelManifest.xml | ||||
| **/*.Server/GeneratedArtifacts | ||||
| **/*.Server/ModelManifest.xml | ||||
| _Pvt_Extensions | ||||
| 
 | ||||
| # Paket dependency manager | ||||
| .paket/paket.exe | ||||
| paket-files/ | ||||
| 
 | ||||
| # FAKE - F# Make | ||||
| .fake/ | ||||
| 
 | ||||
| # JetBrains Rider | ||||
| .idea/ | ||||
| *.sln.iml | ||||
| 
 | ||||
| # CodeRush | ||||
| .cr/ | ||||
| 
 | ||||
| # Python Tools for Visual Studio (PTVS) | ||||
| __pycache__/ | ||||
| *.pyc | ||||
| 
 | ||||
| .history | ||||
| 
 | ||||
| ScrapHacks/build/* | ||||
							
								
								
									
										61
									
								
								NOTES.md
									
										
									
									
									
								
							
							
						
						
									
										61
									
								
								NOTES.md
									
										
									
									
									
								
							|  | @ -46,8 +46,10 @@ | |||
| - m3d.ini loader @ 0x5f7000 | ||||
| - SM3 Scene Loader @ 0x650f80 (?) | ||||
| - M3D Model Loader @ 0x6665a0 (??) | ||||
| - World_Init @ 0x479b20 (???) | ||||
| - World_Constructor @ 0x479b20 (???) | ||||
| - World_Init @ 0x479b40 | ||||
| - World_DeInit @ 0x402510 | ||||
| - Make_World @ 0x479870 | ||||
| 
 | ||||
| # Data Structures | ||||
| 
 | ||||
|  | @ -55,31 +57,31 @@ | |||
| 
 | ||||
| Points to World struct | ||||
| 
 | ||||
| | Offset | Type       | Description                      | | ||||
| |--------|------------|----------------------------------| | ||||
| | 0x0000 | `void**`   | Virtual Method Table             | | ||||
| | 0x0004 | `uint32_t` | Size of Entity Hashtable         | | ||||
| | 0x0008 | `void**`   | Pointer to Entity Hashtable      | | ||||
| | 0x02B8 | `uint32_t` | Number of entity lists           | | ||||
| | 0x02BC | `void**`   | Pointer to entity list Hashtable | | ||||
| | 0x0330 | `float[3]` | Time (why 3 times?)              | | ||||
| | 0x1C6C | `float`    | Alarm level                      | | ||||
| | 0x1C68 | `float`    | Alarm Grow Level                 | | ||||
| | 0x2158 | `???`      | Used in `World_Init`             | | ||||
| | 0x2170 | `???`      | Used in `World_Init`             | | ||||
| | 0x2180 | `???`      | Used in `World_Init`             | | ||||
| | 0x2188 | `???`      | Used in `World_Init`             | | ||||
| | 0x218C | `???`      | Used in `World_Init`             | | ||||
| | 0x2190 | `???`      | Used in `World_Init`             | | ||||
| | 0x2198 | `???`      | Used in `World_Init`             | | ||||
| | 0x219C | `???`      | Used in `World_Init`             | | ||||
| | 0x21A0 | `???`      | Used in `World_Init`             | | ||||
| | 0x21B4 | `???`      | Used in `World_Init`             | | ||||
| | 0x21C8 | `???`      | Used in `World_Init`             | | ||||
| | 0x2204 | `???`      | Used in `World_Init`             | | ||||
| | 0x2230 | `???`      | Used in `World_Init`             | | ||||
| | 0x2238 | `???`      | Used in `World_Init`             | | ||||
| | 0x2254 | `???`      | Used in `World_Init`             | | ||||
| | Offset | Type                     | Description                            | | ||||
| | ------ | ------------------------ | -------------------------------------- | | ||||
| | 0x0000 | `void**`                 | Virtual Method Table                   | | ||||
| | 0x0004 | `uint32_t`               | Size of Entity Hashtable               | | ||||
| | 0x0008 | `void**`                 | Pointer to Entity Hashtable            | | ||||
| | 0x02B8 | `uint32_t`               | Number of entity lists                 | | ||||
| | 0x02BC | `void**`                 | Pointer to entity list Hashtable       | | ||||
| | 0x0330 | `float[3]`               | Time (why 3 times?)                    | | ||||
| | 0x1C6C | `float`                  | Alarm level                            | | ||||
| | 0x1C68 | `float`                  | Alarm Grow Level                       | | ||||
| | 0x2158 | `float`                  | Used in `World_Init`                   | | ||||
| | 0x2170 | `???`                    | Used in `World_Init`                   | | ||||
| | 0x2180 | `float`                  | Used in `World_Init`                   | | ||||
| | 0x2188 | `void*`                  | Used in `World_Init`                   | | ||||
| | 0x218C | `void*`                  | Used in `World_Init`                   | | ||||
| | 0x2190 | `float`                  | Used in `World_Init`                   | | ||||
| | 0x2198 | `void*`                  | Used in `World_Init`                   | | ||||
| | 0x219C | `void*`                  | Used in `World_Init`                   | | ||||
| | 0x21A0 | `void**`                 | Used in `World_Init` (VTable pointer?) | | ||||
| | 0x21B4 | `void**`                 | Used in `World_Init` (VTable pointer?) | | ||||
| | 0x21C8 | `???`                    | Used in `World_Init`                   | | ||||
| | 0x2204 | `uint32_t` or `uint16_t` | Used in `World_Init`                   | | ||||
| | 0x2230 | `float`                  | Used in `World_Init`                   | | ||||
| | 0x2238 | `???`                    | Used in `World_Init`                   | | ||||
| | 0x2254 | `float`                  | Used in `World_Init`                   | | ||||
| 
 | ||||
| 
 | ||||
| ## Entity Hash Table | ||||
|  | @ -89,7 +91,7 @@ Hash-function used: [PJW](https://en.wikipedia.org/wiki/PJW_hash_function) (Same | |||
| Entry format: | ||||
| 
 | ||||
| | Offset | Type          | Description                    | | ||||
| |--------|---------------|--------------------------------| | ||||
| | ------ | ------------- | ------------------------------ | | ||||
| | 0x0    | `void*`       | Pointer to data                | | ||||
| | 0x4    | `const char*` | key as `char*`                 | | ||||
| | 0x8    | `void*`       | Pointer to next entry in chain | | ||||
|  | @ -97,7 +99,7 @@ Entry format: | |||
| Data format: | ||||
| 
 | ||||
| | Offset | Type          | Description              | | ||||
| |--------|---------------|--------------------------| | ||||
| | ------ | ------------- | ------------------------ | | ||||
| | 0x0    | `void**`      | Virtual Method Table (?) | | ||||
| | 0x4    | `const char*` | name as string           | | ||||
| | 0x14   | `void*`       | pointer to self (why?)   | | ||||
|  | @ -106,12 +108,13 @@ Data format: | |||
| ## Game Window Object (?) Pointer @ `0x7fa380` | ||||
| 
 | ||||
| | Offset | Type          | Description          | | ||||
| |--------|---------------|----------------------| | ||||
| | ------ | ------------- | -------------------- | | ||||
| | 0x0000 | `void**`      | Virtual Method Table | | ||||
| | 0x0004 | `const char*` | Some Model Name (?)  | | ||||
| | 0x0008 | `void*`       | Pointer to something | | ||||
| | 0x000C | `void*`       | Ditto                | | ||||
| 
 | ||||
| 
 | ||||
| # File Formats | ||||
| 
 | ||||
| ## .packed File Format: | ||||
|  |  | |||
							
								
								
									
										11
									
								
								ScrapHacks/.vscode/settings.json
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								ScrapHacks/.vscode/settings.json
									
										
									
									
										vendored
									
									
								
							|  | @ -1,11 +0,0 @@ | |||
| { | ||||
|     "spellright.language": [ | ||||
|         "de", | ||||
|         "en" | ||||
|     ], | ||||
|     "spellright.documentTypes": [ | ||||
|         "markdown", | ||||
|         "latex", | ||||
|         "plaintext" | ||||
|     ] | ||||
| } | ||||
							
								
								
									
										19
									
								
								ScrapHacks/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								ScrapHacks/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| cmake_minimum_required (VERSION 2.6) | ||||
| project(ScrapHacks) | ||||
| SET(CMAKE_BUILD_TYPE "Release") | ||||
| SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}") | ||||
| if(WIN32) | ||||
|   if(MSVC) | ||||
|     # ensure we use minimal "windows.h" lib without the crazy min max macros     | ||||
|     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"WIN32_LEAN_AND_MEAN\"") | ||||
|     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"NOMINMAX\"") | ||||
|     # disable SAFESEH - to avoid "LNK2026: module unsafe" | ||||
|     SET(CMAKE_CXX_FLAGS           "${CMAKE_CXX_FLAGS} /D \"SAFESEH:NO\"") | ||||
|     SET(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") | ||||
|     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") | ||||
|     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") | ||||
|   endif(MSVC) | ||||
| endif(WIN32) | ||||
| 
 | ||||
| add_subdirectory(Injector) | ||||
| add_subdirectory(ScrapHack) | ||||
							
								
								
									
										2
									
								
								ScrapHacks/Injector/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								ScrapHacks/Injector/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,2 @@ | |||
| add_executable(Injector Injector.cpp) | ||||
| install(TARGETS Injector DESTINATION bin) | ||||
|  | @ -27,6 +27,11 @@ string GetLastErrorAsString() | |||
| 	return message; | ||||
| } | ||||
| 
 | ||||
| void fail(char* msg) { | ||||
| 	cerr << "[!] "<<msg<<": "<<GetLastErrorAsString()<<endl; | ||||
| 	exit(1); | ||||
| } | ||||
| 
 | ||||
| string fromhex(string input) | ||||
| { | ||||
| 	transform(input.begin(), input.end(), input.begin(), ::toupper); | ||||
|  | @ -113,7 +118,6 @@ bool HasModule(int PID, const char *modname) | |||
| 
 | ||||
| bool ProcRunning(DWORD PID) | ||||
| { | ||||
| 	bool ret = false; | ||||
| 	HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, PID); | ||||
| 	if (hSnap == INVALID_HANDLE_VALUE) | ||||
| 	{ | ||||
|  | @ -130,14 +134,12 @@ bool adjustPrivs(HANDLE hProc) | |||
| 	TOKEN_PRIVILEGES tkprivs; | ||||
| 	if (!OpenProcessToken(hProc, (TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY), &hToken)) | ||||
| 	{ | ||||
| 		cout << "[!] Could not Open Process Token: " << GetLastErrorAsString() << endl; | ||||
| 		return 0; | ||||
| 		fail("Could not open process token:"); | ||||
| 	} | ||||
| 	if (!LookupPrivilegeValue(0, SE_DEBUG_NAME, &luid)) | ||||
| 	{ | ||||
| 		CloseHandle(hToken); | ||||
| 		cout << "[!] Error Looking up Privilege Value: " << GetLastErrorAsString() << endl; | ||||
| 		return 0; | ||||
| 		fail("Error looking up privilege value for SE_DEBUG_NAME"); | ||||
| 	} | ||||
| 	tkprivs.PrivilegeCount = 1; | ||||
| 	tkprivs.Privileges[0].Luid = luid; | ||||
|  | @ -146,7 +148,7 @@ bool adjustPrivs(HANDLE hProc) | |||
| 	CloseHandle(hToken); | ||||
| 	if (!bRet) | ||||
| 	{ | ||||
| 		cout << "[!] Could Not Adjust Privileges: " << GetLastErrorAsString() << endl; | ||||
| 		fail("Could not adjust privileges"); | ||||
| 	} | ||||
| 	return bRet; | ||||
| } | ||||
|  | @ -161,31 +163,32 @@ void InjectDll(DWORD PID) | |||
| 	HANDLE hRemThread, hProc; | ||||
| 	const char *dll_name = DLL_NAME; | ||||
| 	char dll_full_path[MAX_PATH]; | ||||
| 	char executable_dir[MAX_PATH]; | ||||
| 	GetModuleFileNameA(NULL,executable_dir,MAX_PATH); | ||||
| 	if (!fexists(dll_name)) | ||||
| 	{ | ||||
| 		cout << "[!] DLL not found!" << endl; | ||||
| 		fail("DLL not found"); | ||||
| 		return; | ||||
| 	} | ||||
| 	cout << "[*] Injecting DLL " << dll_name << " into PID " << PID << endl; | ||||
| 	cout << "[*] Opening Process Handle" << endl; | ||||
| 	cout << "[*] Opening process handle" << endl; | ||||
| 	hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, PID); | ||||
| 	GetFullPathNameA(dll_name, MAX_PATH, dll_full_path, 0); | ||||
| 	cout << "[*] Adjusting Privileges of Process" << endl; | ||||
| 	cout << "[*] Adjusting privileges of process" << endl; | ||||
| 	adjustPrivs(hProc); | ||||
| 	if (HasModule(PID, dll_name)) | ||||
| 	{ | ||||
| 		cout << "[*] DLL already Loaded" << endl; | ||||
| 		cout << "[*] DLL already loaded" << endl; | ||||
| 		CloseHandle(hProc); | ||||
| 		return; | ||||
| 	}; | ||||
| 	if (!fexists(dll_full_path)) | ||||
| 	{ | ||||
| 		cout << "[!] DLL file not found!" << endl; | ||||
| 		CloseHandle(hProc); | ||||
| 		return; | ||||
| 		fail("DLL file not found"); | ||||
| 	} | ||||
| 	HINSTANCE hK32 = LoadLibraryA("kernel32"); | ||||
| 	cout << "[*] Getting Address of LoadLibrary" << endl; | ||||
| 	cout << "[*] Getting address of LoadLibrary" << endl; | ||||
| 	LPVOID LoadLibrary_Address = (LPVOID)GetProcAddress(hK32, "LoadLibraryA"); | ||||
| 	FreeLibrary(hK32); | ||||
| 	cout << "[+] LoadLibrary is at " << LoadLibrary_Address << endl; | ||||
|  | @ -193,7 +196,7 @@ void InjectDll(DWORD PID) | |||
| 	LPVOID mem = VirtualAllocEx(hProc, NULL, strlen(dll_full_path), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); | ||||
| 	if (mem == NULL) | ||||
| 	{ | ||||
| 		cout << "[!] Could not Allocate Memory: " << GetLastErrorAsString() << endl; | ||||
| 		fail("Could not allocate memory"); | ||||
| 		return; | ||||
| 	} | ||||
| 	cout << "[*] Writing DLL Name to Process Memory at " << mem << endl; | ||||
|  | @ -228,37 +231,26 @@ int main(int argc, char *argv[]) | |||
| 	DWORD PID = 0; | ||||
| 	char s_PID[MAX_PATH]; | ||||
| 	snprintf(s_PID, MAX_PATH, "%d", GetCurrentProcessId()); | ||||
| 	SetEnvironmentVariable("Inj_PID", s_PID); | ||||
| 	cout << "[*] Injector PID: " << GetCurrentProcessId() << endl; | ||||
| 	SetEnvironmentVariableA("Inj_PID", s_PID); | ||||
| 	if ((argc>1)&&fexists(argv[1])) { | ||||
| 		cout << "[*] Injector PID: " << GetCurrentProcessId() << endl; | ||||
| 		cout << "[*] Spawning process for \"" << argv[1] << "\"" << endl; | ||||
| 		vector<HANDLE> handles = spawn(argv[1]); | ||||
| 		if (handles.empty()) { | ||||
| 			cout << "[!] Error: " << GetLastErrorAsString() << endl; | ||||
| 			return -1; | ||||
| 			fail("Failed to spawn process"); | ||||
| 		} | ||||
| 		hProc = handles[0]; | ||||
| 		hThread = handles[1]; | ||||
| 		PID = GetProcessId(hProc); | ||||
| 		cout << "[+] Got PID: " << PID << endl; | ||||
| 	} else { | ||||
| 		GetWindowThreadProcessId(FindWindowA("ScrapClass", NULL), &PID); | ||||
| 		if (PID == 0) | ||||
| 		{ | ||||
| 			cout << "[*] Waiting for Scrapland to Launch..." << endl; | ||||
| 		} | ||||
| 		while (PID == 0) | ||||
| 		{ | ||||
| 			Sleep(100); | ||||
| 			GetWindowThreadProcessId(FindWindowA("ScrapClass", NULL), &PID); | ||||
| 		} | ||||
| 		cout << "[+] Found PID: " << PID << endl; | ||||
| 		cerr<<"Usage: " << argv[0] << " <Path to Scrap.exe>"<<endl; | ||||
| 		return 1; | ||||
| 	} | ||||
| 	InjectDll(PID); | ||||
| 	if (hThread != INVALID_HANDLE_VALUE) { | ||||
| 		while (ResumeThread(hThread)); | ||||
| 	} | ||||
| 	SetEnvironmentVariable("Inj_PID", NULL); | ||||
| 	SetEnvironmentVariableA("Inj_PID", NULL); | ||||
| 	cout << "[*] Done!" << endl; | ||||
| 	return 0; | ||||
| } | ||||
|  | @ -1,31 +0,0 @@ | |||
|  | ||||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||||
| # Visual Studio 15 | ||||
| VisualStudioVersion = 15.0.27703.2042 | ||||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Injector", "Injector\Injector.vcxproj", "{7C91C225-D95C-4B7A-9251-0CE358BAF556}" | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| 		Debug|x64 = Debug|x64 | ||||
| 		Debug|x86 = Debug|x86 | ||||
| 		Release|x64 = Release|x64 | ||||
| 		Release|x86 = Release|x86 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|x64.ActiveCfg = Debug|x64 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|x64.Build.0 = Debug|x64 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|x86.ActiveCfg = Debug|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|x86.Build.0 = Debug|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|x64.ActiveCfg = Release|x64 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|x64.Build.0 = Release|x64 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|x86.ActiveCfg = Release|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|x86.Build.0 = Release|Win32 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(SolutionProperties) = preSolution | ||||
| 		HideSolutionNode = FALSE | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(ExtensibilityGlobals) = postSolution | ||||
| 		SolutionGuid = {8AE8D706-DEB4-42C3-AA4F-CEF2EB636A39} | ||||
| 	EndGlobalSection | ||||
| EndGlobal | ||||
|  | @ -1,164 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||
|   <ItemGroup Label="ProjectConfigurations"> | ||||
|     <ProjectConfiguration Include="Debug|Win32"> | ||||
|       <Configuration>Debug</Configuration> | ||||
|       <Platform>Win32</Platform> | ||||
|     </ProjectConfiguration> | ||||
|     <ProjectConfiguration Include="Release|Win32"> | ||||
|       <Configuration>Release</Configuration> | ||||
|       <Platform>Win32</Platform> | ||||
|     </ProjectConfiguration> | ||||
|     <ProjectConfiguration Include="Debug|x64"> | ||||
|       <Configuration>Debug</Configuration> | ||||
|       <Platform>x64</Platform> | ||||
|     </ProjectConfiguration> | ||||
|     <ProjectConfiguration Include="Release|x64"> | ||||
|       <Configuration>Release</Configuration> | ||||
|       <Platform>x64</Platform> | ||||
|     </ProjectConfiguration> | ||||
|   </ItemGroup> | ||||
|   <PropertyGroup Label="Globals"> | ||||
|     <VCProjectVersion>15.0</VCProjectVersion> | ||||
|     <ProjectGuid>{7C91C225-D95C-4B7A-9251-0CE358BAF556}</ProjectGuid> | ||||
|     <Keyword>Win32Proj</Keyword> | ||||
|     <RootNamespace>Injector</RootNamespace> | ||||
|     <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> | ||||
|   </PropertyGroup> | ||||
|   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||||
|     <ConfigurationType>Application</ConfigurationType> | ||||
|     <UseDebugLibraries>true</UseDebugLibraries> | ||||
|     <PlatformToolset>v141</PlatformToolset> | ||||
|     <CharacterSet>MultiByte</CharacterSet> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||||
|     <ConfigurationType>Application</ConfigurationType> | ||||
|     <UseDebugLibraries>false</UseDebugLibraries> | ||||
|     <PlatformToolset>v141</PlatformToolset> | ||||
|     <WholeProgramOptimization>true</WholeProgramOptimization> | ||||
|     <CharacterSet>MultiByte</CharacterSet> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||||
|     <ConfigurationType>Application</ConfigurationType> | ||||
|     <UseDebugLibraries>true</UseDebugLibraries> | ||||
|     <PlatformToolset>v141</PlatformToolset> | ||||
|     <CharacterSet>MultiByte</CharacterSet> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||||
|     <ConfigurationType>Application</ConfigurationType> | ||||
|     <UseDebugLibraries>false</UseDebugLibraries> | ||||
|     <PlatformToolset>v141</PlatformToolset> | ||||
|     <WholeProgramOptimization>true</WholeProgramOptimization> | ||||
|     <CharacterSet>MultiByte</CharacterSet> | ||||
|   </PropertyGroup> | ||||
|   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||||
|   <ImportGroup Label="ExtensionSettings"> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="Shared"> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||||
|     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||||
|     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||||
|     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||||
|     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||||
|   </ImportGroup> | ||||
|   <PropertyGroup Label="UserMacros" /> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||||
|     <LinkIncremental>true</LinkIncremental> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||||
|     <LinkIncremental>true</LinkIncremental> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||||
|     <LinkIncremental>false</LinkIncremental> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||||
|     <LinkIncremental>false</LinkIncremental> | ||||
|   </PropertyGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||||
|     <ClCompile> | ||||
|       <PrecompiledHeader>Use</PrecompiledHeader> | ||||
|       <WarningLevel>Level3</WarningLevel> | ||||
|       <Optimization>Disabled</Optimization> | ||||
|       <SDLCheck>true</SDLCheck> | ||||
|       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS ;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <ConformanceMode>true</ConformanceMode> | ||||
|     </ClCompile> | ||||
|     <Link> | ||||
|       <SubSystem>Console</SubSystem> | ||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
|     </Link> | ||||
|   </ItemDefinitionGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||||
|     <ClCompile> | ||||
|       <PrecompiledHeader>Use</PrecompiledHeader> | ||||
|       <WarningLevel>Level3</WarningLevel> | ||||
|       <Optimization>Disabled</Optimization> | ||||
|       <SDLCheck>true</SDLCheck> | ||||
|       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <ConformanceMode>true</ConformanceMode> | ||||
|     </ClCompile> | ||||
|     <Link> | ||||
|       <SubSystem>Console</SubSystem> | ||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
|     </Link> | ||||
|   </ItemDefinitionGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||||
|     <ClCompile> | ||||
|       <PrecompiledHeader>Use</PrecompiledHeader> | ||||
|       <WarningLevel>Level3</WarningLevel> | ||||
|       <Optimization>MaxSpeed</Optimization> | ||||
|       <FunctionLevelLinking>true</FunctionLevelLinking> | ||||
|       <IntrinsicFunctions>true</IntrinsicFunctions> | ||||
|       <SDLCheck>true</SDLCheck> | ||||
|       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS ;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <ConformanceMode>true</ConformanceMode> | ||||
|     </ClCompile> | ||||
|     <Link> | ||||
|       <SubSystem>Console</SubSystem> | ||||
|       <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||||
|       <OptimizeReferences>true</OptimizeReferences> | ||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
|     </Link> | ||||
|   </ItemDefinitionGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||||
|     <ClCompile> | ||||
|       <PrecompiledHeader>Use</PrecompiledHeader> | ||||
|       <WarningLevel>Level3</WarningLevel> | ||||
|       <Optimization>MaxSpeed</Optimization> | ||||
|       <FunctionLevelLinking>true</FunctionLevelLinking> | ||||
|       <IntrinsicFunctions>true</IntrinsicFunctions> | ||||
|       <SDLCheck>true</SDLCheck> | ||||
|       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <ConformanceMode>true</ConformanceMode> | ||||
|     </ClCompile> | ||||
|     <Link> | ||||
|       <SubSystem>Console</SubSystem> | ||||
|       <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||||
|       <OptimizeReferences>true</OptimizeReferences> | ||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
|     </Link> | ||||
|   </ItemDefinitionGroup> | ||||
|   <ItemGroup> | ||||
|     <ClInclude Include="stdafx.h" /> | ||||
|     <ClInclude Include="targetver.h" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClCompile Include="Injector.cpp" /> | ||||
|     <ClCompile Include="stdafx.cpp"> | ||||
|       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> | ||||
|       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> | ||||
|       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> | ||||
|       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> | ||||
|     </ClCompile> | ||||
|   </ItemGroup> | ||||
|   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||||
|   <ImportGroup Label="ExtensionTargets" /> | ||||
| </Project> | ||||
|  | @ -1,33 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||
|   <ItemGroup> | ||||
|     <Filter Include="Quelldateien"> | ||||
|       <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||||
|       <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||||
|     </Filter> | ||||
|     <Filter Include="Headerdateien"> | ||||
|       <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||||
|       <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> | ||||
|     </Filter> | ||||
|     <Filter Include="Ressourcendateien"> | ||||
|       <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||||
|       <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||||
|     </Filter> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClInclude Include="stdafx.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="targetver.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClCompile Include="stdafx.cpp"> | ||||
|       <Filter>Quelldateien</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="Injector.cpp"> | ||||
|       <Filter>Quelldateien</Filter> | ||||
|     </ClCompile> | ||||
|   </ItemGroup> | ||||
| </Project> | ||||
|  | @ -1,20 +1,11 @@ | |||
|  | ||||
| 
 | ||||
| ## Usage | ||||
| 
 | ||||
| 0. Download `DirectX.8.0a.SDK.zip` from [here](https://archive.org/download/DirectX.8.0a.SDK_includes_libs_only) | ||||
| 1. Extract `DirectX.SDK/8.0/include` and `DirectX.SDK/8.0/lib` to `ScrapHacks/ScrapHack/dx8/include` and `ScrapHacks/ScrapHack/dx8/lib` | ||||
| 2. Add include and library dirs to project | ||||
| 3. Build Project | ||||
| 4. Run Injector `.\Injector.exe <Path to Scrap.exe>` | ||||
| 5. Wait for game to crash | ||||
| 6. Comment out `hook_d3d8()` call in `ScrapHack.cpp:DllPreInit()`  | ||||
| 7. Rebuild and run Injector again | ||||
| Open VS 2017 32-bit command prompt (`vcvars32.bat`) | ||||
| 
 | ||||
| ```batch | ||||
| mkdir build | ||||
| cd build | ||||
| cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="" .. | ||||
| cmake --build . | ||||
| cmake --install . | ||||
| ``` | ||||
| [F3 ] Unload ScrapHacks | ||||
| [F7 ] Set Money to 0x7fffffff | ||||
| [F8 ] Dump python modules to console | ||||
| [F10] Enable python tracing | ||||
| [ F ] "Handbrake" (*Will* crash the game after some time!) | ||||
| ``` | ||||
| 
 | ||||
| this will drop the compiled files into `./build/bin` | ||||
							
								
								
									
										17
									
								
								ScrapHacks/ScrapHack/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								ScrapHacks/ScrapHack/CMakeLists.txt
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| include(ExternalProject) | ||||
| ExternalProject_Add(DirectX | ||||
|     PREFIX ${CMAKE_CURRENT_BINARY_DIR} | ||||
|     CONFIGURE_COMMAND "" | ||||
|     BUILD_COMMAND "" | ||||
|     INSTALL_COMMAND "" | ||||
|     URL https://archive.org/download/DirectX.8.0a.SDK_includes_libs_only/DirectX.8.0a.SDK.zip | ||||
|     URL_HASH SHA1=39f168336d0df92ff14d62d5e3aef1b9e3191312 | ||||
| ) | ||||
| ExternalProject_Get_Property(DirectX SOURCE_DIR) | ||||
| include_directories(AFTER ${SOURCE_DIR}/8.0/include/) | ||||
| link_directories(AFTER ${SOURCE_DIR}/8.0/lib/) | ||||
| add_compile_definitions(_CRT_SECURE_NO_WARNINGS) | ||||
| add_compile_definitions(POINTER_64=__ptr64) | ||||
| add_library(ScrapHack SHARED ScrapHack.cpp dllmain.cpp) | ||||
| target_link_libraries(ScrapHack d3d8 d3dx8 legacy_stdio_definitions) | ||||
| install(TARGETS ScrapHack DESTINATION bin) | ||||
|  | @ -13,12 +13,23 @@ D3DCOLOR color = D3DCOLOR_ARGB(255,255, 0, 0); | |||
| RECT Rect = { 0,0,0,0 }; | ||||
| D3DRECT panel; | ||||
| 
 | ||||
| size_t size_ht(HashTable<EntityList>* ht); | ||||
| size_t size_ht(HashTable<Entity>* ht); | ||||
| 
 | ||||
| LPDIRECT3DDEVICE8 Render(LPDIRECT3DDEVICE8 dev) { | ||||
| 	if (!overlay) { | ||||
| 		return dev; | ||||
| 	} | ||||
| 	char text[1024]; | ||||
| 	snprintf(text, 1024, "ScrapHack v0.1\nFrame: [%lld]", ++frame); | ||||
| 	char text[4096]; | ||||
| 	int32_t money = 0; | ||||
| 	size_t num_ents = 0; | ||||
| 	size_t num_ent_lst = 0; | ||||
| 	if (ptr<void>(P_WORLD, 0)!=nullptr) { | ||||
| 		money = ptr<int32_t>(P_WORLD, O_MONEY)[0]; | ||||
| 		num_ents= size_ht(ptr<HashTable<Entity>>(P_WORLD, O_ENTS)); | ||||
| 		num_ent_lst = size_ht(ptr<HashTable<EntityList>>(P_WORLD, O_ENTLISTS)); | ||||
| 	} | ||||
| 	snprintf(text, 4096, "ScrapHack v0.1\nFrame: [%lld]\nMoney: [%d]\nEntities: [%ld]\nEntity Lists: [%ld]", ++frame, money, num_ents,num_ent_lst); | ||||
| 	if (m_pFont == nullptr) { | ||||
| 		D3DXCreateFont(dev, hFont, &m_pFont); | ||||
| 		CloseHandle(hFont); | ||||
|  |  | |||
|  | @ -1,4 +1,3 @@ | |||
| #define WIN32_LEAN_AND_MEAN | ||||
| #include "stdafx.h" | ||||
| #include <string> | ||||
| #include <sstream> | ||||
|  | @ -11,10 +10,6 @@ | |||
| #include <Windows.h> | ||||
| #include <TlHelp32.h> | ||||
| 
 | ||||
| #pragma comment(lib, "d3d8.lib") | ||||
| #pragma comment(lib, "d3dx8.lib") | ||||
| #pragma comment(lib, "legacy_stdio_definitions.lib") | ||||
| 
 | ||||
| using namespace std; | ||||
| 
 | ||||
| #include "Scrapland.h" | ||||
|  | @ -34,230 +29,292 @@ HMODULE mod = 0; | |||
| void DllUnload(HMODULE); | ||||
| void hook_exit(); | ||||
| 
 | ||||
| size_t dump_ht(HashTable<EntityList>* ht) { | ||||
| 	size_t cnt = 0; | ||||
| 	for (size_t i = 0; i < ht->size; ++i) { | ||||
| 		HashTableEntry<EntityList>* ent = ht->chains[i]; | ||||
| 		if (ent) { | ||||
| 			cout << i << ": "; | ||||
| 			while (ent) { | ||||
| 				++cnt; | ||||
| 				cout << "[ " << ent->name << ": " << ent->data << "]"; | ||||
| 				if (ent->next) { | ||||
| 					cout << " -> "; | ||||
| 				}; | ||||
| 				ent = ent->next; | ||||
| 			} | ||||
| 			cout << endl; | ||||
| 		} | ||||
| 	} | ||||
| 	cout << cnt << " Entries" << endl; | ||||
| 	return cnt; | ||||
| size_t size_ht(HashTable<EntityList> *ht) | ||||
| { | ||||
|     size_t cnt = 0; | ||||
|     for (size_t i = 0; i < ht->size; ++i) | ||||
|     { | ||||
|         HashTableEntry<EntityList> *ent = ht->chains[i]; | ||||
|         if (ent) | ||||
|         { | ||||
|             while (ent) | ||||
|             { | ||||
|                 ++cnt; | ||||
|                 ent = ent->next; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     return cnt; | ||||
| } | ||||
| 
 | ||||
| size_t dump_ht(HashTable<Entity>* ht) { | ||||
| 	size_t cnt = 0; | ||||
| 	for (size_t i = 0; i < ht->size; ++i) { | ||||
| 		HashTableEntry<Entity>* ent = ht->chains[i]; | ||||
| 		if (ent) { | ||||
| 			cout << i << ": "; | ||||
| 			while (ent) { | ||||
| 				++cnt; | ||||
| 				cout << "[ " << ent->name << ": " << ent->data<<"]"; | ||||
| 				if (ent->next) { | ||||
| 					cout << " -> "; | ||||
| 				}; | ||||
| 				ent = ent->next; | ||||
| 			} | ||||
| 			cout << endl; | ||||
| 		} | ||||
| 	} | ||||
| 	cout << cnt << " Entries" << endl; | ||||
| 	return cnt; | ||||
| size_t size_ht(HashTable<Entity> *ht) | ||||
| { | ||||
|     size_t cnt = 0; | ||||
|     for (size_t i = 0; i < ht->size; ++i) | ||||
|     { | ||||
|         HashTableEntry<Entity> *ent = ht->chains[i]; | ||||
|         if (ent) | ||||
|         { | ||||
|             while (ent) | ||||
|             { | ||||
|                 ++cnt; | ||||
|                 ent = ent->next; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     return cnt; | ||||
| } | ||||
| 
 | ||||
| size_t dump_ht(HashTable<EntityList> *ht) | ||||
| { | ||||
|     size_t cnt = 0; | ||||
|     for (size_t i = 0; i < ht->size; ++i) | ||||
|     { | ||||
|         HashTableEntry<EntityList> *ent = ht->chains[i]; | ||||
|         if (ent) | ||||
|         { | ||||
|             cout << i << ": "; | ||||
|             while (ent) | ||||
|             { | ||||
|                 ++cnt; | ||||
|                 cout << "[ " << ent->name << ": " << ent->data << "]"; | ||||
|                 if (ent->next) | ||||
|                 { | ||||
|                     cout << " -> "; | ||||
|                 }; | ||||
|                 ent = ent->next; | ||||
|             } | ||||
|             cout << endl; | ||||
|         } | ||||
|     } | ||||
|     cout << cnt << " Entries" << endl; | ||||
|     return cnt; | ||||
| } | ||||
| 
 | ||||
| size_t dump_ht(HashTable<Entity> *ht) | ||||
| { | ||||
|     size_t cnt = 0; | ||||
|     for (size_t i = 0; i < ht->size; ++i) | ||||
|     { | ||||
|         HashTableEntry<Entity> *ent = ht->chains[i]; | ||||
|         if (ent) | ||||
|         { | ||||
|             cout << i << ": "; | ||||
|             while (ent) | ||||
|             { | ||||
|                 ++cnt; | ||||
|                 cout << "[ " << ent->name << ": " << ent->data << "]"; | ||||
|                 if (ent->next) | ||||
|                 { | ||||
|                     cout << " -> "; | ||||
|                 }; | ||||
|                 ent = ent->next; | ||||
|             } | ||||
|             cout << endl; | ||||
|         } | ||||
|     } | ||||
|     cout << cnt << " Entries" << endl; | ||||
|     return cnt; | ||||
| } | ||||
| 
 | ||||
| void MainLoop(HMODULE mod) | ||||
| { | ||||
| 	Sleep(100); | ||||
| 	hook_exit(); | ||||
| 	cout << "[*] Starting main Loop" << endl; | ||||
| 	cout << endl; | ||||
| 	cout << "[F3 ] Unload ScrapHacks" << endl; | ||||
| 	cout << "[F5 ] Show Overlay" << endl; | ||||
| 	cout << "[F6 ] Show Alarm status" << endl; | ||||
| 	cout << "[F7 ] Set Money to 0x7fffffff" << endl; | ||||
| 	cout << "[F8 ] Dump python modules" << endl; | ||||
| 	cout << "[F9 ] Dump Entity hashtable" << endl; | ||||
| 	cout << "[F10] Enable python tracing" << endl; | ||||
| 	cout << "[ F ] \"Handbrake\" (*Will* crash the game after some time!)" << endl; | ||||
|     Sleep(100); | ||||
|     hook_exit(); | ||||
|     cout << "[*] Starting main Loop" << endl; | ||||
|     cout << endl; | ||||
|     cout << "[F3 ] Unload ScrapHacks" << endl; | ||||
|     cout << "[F5 ] Show Overlay" << endl; | ||||
|     cout << "[F6 ] Show Alarm status" << endl; | ||||
|     cout << "[F7 ] Set Money to 0x7fffffff" << endl; | ||||
|     cout << "[F8 ] Dump python modules" << endl; | ||||
|     cout << "[F9 ] Dump Entity hashtable" << endl; | ||||
|     cout << "[F10] Enable python tracing" << endl; | ||||
|     cout << "[ F ] \"Handbrake\" (*Will* crash the game after some time!)" << endl; | ||||
| 
 | ||||
| 	while (running) | ||||
| 	{ | ||||
| 		Sleep(100); | ||||
|     while (running) | ||||
|     { | ||||
|         Sleep(100); | ||||
| 
 | ||||
| 		while (key_down('F')) | ||||
| 		{ | ||||
| 			scrap_exec("dbg.brake()"); | ||||
| 		} | ||||
| 		if (key_down_norepeat(VK_F3)) | ||||
| 		{ | ||||
| 			break; | ||||
| 		} | ||||
|         while (key_down('F')) | ||||
|         { | ||||
|             scrap_exec("dbg.brake()"); | ||||
|         } | ||||
|         if (key_down_norepeat(VK_F3)) | ||||
|         { | ||||
|             break; | ||||
|         } | ||||
| 
 | ||||
| 		if (key_down_norepeat(VK_F5)) | ||||
| 		{ | ||||
| 			overlay = !overlay; | ||||
| 		} | ||||
| 		if (key_down_norepeat(VK_F6)) | ||||
| 		{ | ||||
| 			 | ||||
| 			float* alarm = ptr<float>(P_WORLD, O_ALARM); | ||||
| 			float* alarm_grow = ptr<float>(P_WORLD, O_ALARM_GROW); | ||||
| 			cout << "Alarm: " << alarm[0] << " + " << alarm_grow[0] << endl; | ||||
| 		} | ||||
| 		if (key_down_norepeat(VK_F7)) | ||||
| 		{ | ||||
| 			int32_t *money = ptr<int32_t>(P_WORLD,O_MONEY); | ||||
| 			*money = 0x7fffffff; | ||||
| 		} | ||||
| 		if (key_down_norepeat(VK_F8)) | ||||
| 		{ | ||||
| 			for (auto mod : Py) | ||||
| 			{ | ||||
| 				for (auto meth : mod.second.methods) | ||||
| 				{ | ||||
| 					cout << mod.first << "." << meth.first << " @ " << meth.second->ml_meth << endl; | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|         if (key_down_norepeat(VK_F5)) | ||||
|         { | ||||
|             overlay = !overlay; | ||||
|         } | ||||
|         if (key_down_norepeat(VK_F6)) | ||||
|         { | ||||
| 
 | ||||
| 		if (key_down_norepeat(VK_F9)) { | ||||
| 			cout << "Entities:" << endl; | ||||
| 			dump_ht(ptr<HashTable<Entity>>(P_WORLD, O_ENTS)); | ||||
| 			cout << "Entity Lists:" << endl; | ||||
| 			dump_ht(ptr<HashTable<EntityList>>(P_WORLD, O_ENTLISTS)); | ||||
| 		} | ||||
| 		if (key_down_norepeat(VK_F10)) | ||||
| 		{ | ||||
| 			scrap_exec("dbg.settrace()"); | ||||
| 		} | ||||
| 	} | ||||
| 	FreeLibraryAndExitThread(mod, 0); | ||||
|             float *alarm = ptr<float>(P_WORLD, O_ALARM); | ||||
|             float *alarm_grow = ptr<float>(P_WORLD, O_ALARM_GROW); | ||||
|             cout << "Alarm: " << alarm[0] << " + " << alarm_grow[0] << endl; | ||||
|         } | ||||
|         if (key_down_norepeat(VK_F7)) | ||||
|         { | ||||
|             int32_t *money = ptr<int32_t>(P_WORLD, O_MONEY); | ||||
|             *money = 0x7fffffff; | ||||
|         } | ||||
|         if (key_down_norepeat(VK_F8)) | ||||
|         { | ||||
|             for (auto mod : Py) | ||||
|             { | ||||
|                 for (auto meth : mod.second.methods) | ||||
|                 { | ||||
|                     cout << mod.first << "." << meth.first << " @ " << meth.second->ml_meth << endl; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (key_down_norepeat(VK_F9)) | ||||
|         { | ||||
|             cout << "Entities:" << endl; | ||||
|             dump_ht(ptr<HashTable<Entity>>(P_WORLD, O_ENTS)); | ||||
|             cout << "Entity Lists:" << endl; | ||||
|             dump_ht(ptr<HashTable<EntityList>>(P_WORLD, O_ENTLISTS)); | ||||
|         } | ||||
|         if (key_down_norepeat(VK_F10)) | ||||
|         { | ||||
|             scrap_exec("dbg.settrace()"); | ||||
|         } | ||||
|     } | ||||
|     FreeLibraryAndExitThread(mod, 0); | ||||
| } | ||||
| 
 | ||||
| void InitConsole() | ||||
| { | ||||
| 	char me[1024]; | ||||
| 	GetModuleFileName(mod, me, 1024); | ||||
| 	SetupConsole(me); | ||||
|     char me[1024]; | ||||
|     GetModuleFileName(mod, me, 1024); | ||||
|     SetupConsole(me); | ||||
| } | ||||
| 
 | ||||
| void handle_command(const char* cmd) { | ||||
| 	cout << "CMD: " << cmd << endl; | ||||
| 	scrap_log(0x00ff00, "HAXX: "); | ||||
| 	scrap_log(0x00ff00,cmd); | ||||
| 	scrap_log(0x00ff00,"\n"); | ||||
| 	return; | ||||
| void handle_command(const char *cmd) | ||||
| { | ||||
|     cout << "CMD: " << cmd << endl; | ||||
|     scrap_log(0x00ff00, "HAXX: "); | ||||
|     scrap_log(0x00ff00, cmd); | ||||
|     scrap_log(0x00ff00, "\n"); | ||||
|     return; | ||||
| } | ||||
| 
 | ||||
| int hooked_console(const char* cmd) { | ||||
| 	typedef int(_cdecl *t_func)(const char*); | ||||
| 	shared_ptr<Hook> hook = Hook::get(hooked_console); | ||||
| 	if (cmd[0] == '$') { | ||||
| 		handle_command(++cmd); | ||||
| 		return 0; | ||||
| 	} | ||||
| 	int ret= hook->func<t_func>(cmd); | ||||
| 	return ret; | ||||
| int hooked_console(const char *cmd) | ||||
| { | ||||
|     typedef int(_cdecl * t_func)(const char *); | ||||
|     shared_ptr<Hook> hook = Hook::get(hooked_console); | ||||
|     if (cmd[0] == '$') | ||||
|     { | ||||
|         handle_command(++cmd); | ||||
|         return 0; | ||||
|     } | ||||
|     int ret = hook->func<t_func>(cmd); | ||||
|     return ret; | ||||
| } | ||||
| 
 | ||||
| void hook_console() { | ||||
| 	Hook::addr(reinterpret_cast<void*>(P_CON_HANDLER) , hooked_console); | ||||
| void hook_console() | ||||
| { | ||||
|     Hook::addr(reinterpret_cast<void *>(P_CON_HANDLER), hooked_console); | ||||
| } | ||||
| 
 | ||||
| void H_Exit(){ | ||||
| 	typedef void(_cdecl *t_func)(void); | ||||
| 	shared_ptr<Hook> hook = Hook::get(H_Exit); | ||||
| 	DllUnload(mod); | ||||
| 	HWND hMainWindow = ptr<HWND>(0x7FA830, 0x7c)[0]; | ||||
| 	SendMessage(hMainWindow, WM_CLOSE, 0, 0); | ||||
| 	return; | ||||
| void H_Exit() | ||||
| { | ||||
|     typedef void(_cdecl * t_func)(void); | ||||
|     shared_ptr<Hook> hook = Hook::get(H_Exit); | ||||
|     DllUnload(mod); | ||||
|     HWND hMainWindow = ptr<HWND>(0x7FA830, 0x7c)[0]; | ||||
|     SendMessage(hMainWindow, WM_CLOSE, 0, 0); | ||||
|     return; | ||||
| } | ||||
| 
 | ||||
| void hook_exit() { | ||||
| 	Hook::addr(reinterpret_cast<void*>(0x4010c0), H_Exit); | ||||
| void hook_exit() | ||||
| { | ||||
|     Hook::addr(reinterpret_cast<void *>(P_SCRAP_EXIT), H_Exit); | ||||
| } | ||||
| 
 | ||||
| DWORD PPID() { | ||||
| 	DWORD PID = GetCurrentProcessId(); | ||||
| 	HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | ||||
| 	PROCESSENTRY32 procentry; | ||||
| 	if (hSnapShot == INVALID_HANDLE_VALUE) { | ||||
| 		cout << GetLastErrorAsString() << endl; | ||||
| 		return -1; | ||||
| 	} | ||||
| 	if (Process32First(hSnapShot, &procentry)) { | ||||
| 		do { | ||||
| 			if (procentry.th32ProcessID == PID) { | ||||
| 				CloseHandle(hSnapShot); | ||||
| 				return procentry.th32ParentProcessID; | ||||
| 			} | ||||
| 			procentry.dwSize = sizeof(PROCESSENTRY32); | ||||
| 		} while (Process32Next(hSnapShot, &procentry)); | ||||
| 	} | ||||
| 	CloseHandle(hSnapShot); | ||||
| 	return -1; | ||||
| DWORD PPID() | ||||
| { | ||||
|     DWORD PID = GetCurrentProcessId(); | ||||
|     HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); | ||||
|     PROCESSENTRY32 procentry; | ||||
|     if (hSnapShot == INVALID_HANDLE_VALUE) | ||||
|     { | ||||
|         cout << GetLastErrorAsString() << endl; | ||||
|         return -1; | ||||
|     } | ||||
|     if (Process32First(hSnapShot, &procentry)) | ||||
|     { | ||||
|         do | ||||
|         { | ||||
|             if (procentry.th32ProcessID == PID) | ||||
|             { | ||||
|                 CloseHandle(hSnapShot); | ||||
|                 return procentry.th32ParentProcessID; | ||||
|             } | ||||
|             procentry.dwSize = sizeof(PROCESSENTRY32); | ||||
|         } while (Process32Next(hSnapShot, &procentry)); | ||||
|     } | ||||
|     CloseHandle(hSnapShot); | ||||
|     return -1; | ||||
| } | ||||
| 
 | ||||
| void DllPreInit(HMODULE _mod) { | ||||
| 	char mfn[1024]; | ||||
| 	char inj[MAX_PATH]; | ||||
| 	DWORD INJ_PID=0; | ||||
| 	InitConsole(); | ||||
| 	GetModuleFileName(0, mfn, 1024); | ||||
| 	Py = get_modules(P_PY_MODS); | ||||
| 	cout << "[+] ScrapHacks v0.1 Loaded in " << mfn << " (PID: " << std::hex << GetCurrentProcessId() <<std::dec << ")" << endl; | ||||
| 	GetEnvironmentVariable("Inj_PID", inj, MAX_PATH); | ||||
| 	SetEnvironmentVariable("Inj_PID", NULL); | ||||
| 	hook_console(); | ||||
| 	sscanf(inj, "%d", &INJ_PID); | ||||
| 	cout << INJ_PID << "," << PPID() << endl; | ||||
| 	if (PPID() == INJ_PID) { | ||||
| 		hook_d3d8(); | ||||
| 		overlay = true; | ||||
| 	} | ||||
| 	else { | ||||
| 		cout << "[-] No launched by Injector, not hooking DX8" << endl; | ||||
| 	} | ||||
| void DllPreInit(HMODULE _mod) | ||||
| { | ||||
|     char mfn[1024]; | ||||
|     char inj[MAX_PATH]; | ||||
|     DWORD INJ_PID = 0; | ||||
|     InitConsole(); | ||||
|     GetModuleFileNameA(0, mfn, 1024); | ||||
|     Py = get_modules(P_PY_MODS); | ||||
|     cout << "[+] ScrapHacks v0.1 Loaded in " << mfn << " (PID: " << std::hex << GetCurrentProcessId() << std::dec << ")" << endl; | ||||
|     GetEnvironmentVariableA("Inj_PID", inj, MAX_PATH); | ||||
|     SetEnvironmentVariableA("Inj_PID", NULL); | ||||
|     hook_console(); | ||||
|     sscanf_s(inj, "%d", &INJ_PID); | ||||
|     cout << INJ_PID << "," << PPID() << endl; | ||||
|     if (PPID() == INJ_PID) | ||||
|     { | ||||
|         hook_d3d8(); | ||||
|         overlay = true; | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         cout << "[-] No launched by Injector, not hooking DX8" << endl; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void DllInit(HMODULE _mod) | ||||
| { | ||||
| 	initialized = true; | ||||
| 	mod = _mod; | ||||
| 	Sleep(3000); | ||||
| 	cout << "[*] World: " << ptr<void>(P_WORLD, 0) << endl; | ||||
| 	cout << "[*] Importing python dbg module" << endl; | ||||
| 	scrap_exec("import dbg"); | ||||
| 	scrap_log(0xff0000, "ScrapHacks loaded!\n"); | ||||
| 	CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)MainLoop, mod, 0, 0); | ||||
| 	cout << "[*] Starting message pump" << endl; | ||||
| 	MSG msg; | ||||
| 	while (GetMessage(&msg, NULL, 0, 0)) | ||||
| 	{ | ||||
| 		TranslateMessage(&msg); | ||||
| 		DispatchMessage(&msg); | ||||
| 	} | ||||
| 	return; | ||||
|     initialized = true; | ||||
|     mod = _mod; | ||||
|     Sleep(3000); | ||||
|     cout << "[*] World: " << ptr<void>(P_WORLD, 0) << endl; | ||||
|     cout << "[*] Importing python dbg module" << endl; | ||||
|     scrap_exec("import dbg"); | ||||
|     scrap_log(0xff0000, "ScrapHacks loaded!\n"); | ||||
|     CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)MainLoop, mod, 0, 0); | ||||
|     cout << "[*] Starting message pump" << endl; | ||||
|     MSG msg; | ||||
|     while (GetMessage(&msg, NULL, 0, 0)) | ||||
|     { | ||||
|         TranslateMessage(&msg); | ||||
|         DispatchMessage(&msg); | ||||
|     } | ||||
|     return; | ||||
| } | ||||
| 
 | ||||
| void DllUnload(HMODULE _mod) { | ||||
| 	SetConsoleCtrlHandler(NULL, false); | ||||
| 	unhook_d3d8(); | ||||
| 	Hook::clear(); | ||||
| 	scrap_log(0xff0000, "ScrapHacks unloaded!\n"); | ||||
| 	cout << "[+] ScrapHacks unloaded, you can now close the console!" << endl; | ||||
| 	FreeConsole(); | ||||
| 	DestroyWindow(GetConsoleWindow()); | ||||
| 	return; | ||||
| void DllUnload(HMODULE _mod) | ||||
| { | ||||
|     SetConsoleCtrlHandler(NULL, false); | ||||
|     unhook_d3d8(); | ||||
|     Hook::clear(); | ||||
|     scrap_log(0xff0000, "ScrapHacks unloaded!\n"); | ||||
|     cout << "[+] ScrapHacks unloaded, you can now close the console!" << endl; | ||||
|     FreeConsole(); | ||||
|     DestroyWindow(GetConsoleWindow()); | ||||
|     return; | ||||
| } | ||||
|  | @ -1,178 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||
|   <ItemGroup Label="ProjectConfigurations"> | ||||
|     <ProjectConfiguration Include="Debug|Win32"> | ||||
|       <Configuration>Debug</Configuration> | ||||
|       <Platform>Win32</Platform> | ||||
|     </ProjectConfiguration> | ||||
|     <ProjectConfiguration Include="Release|Win32"> | ||||
|       <Configuration>Release</Configuration> | ||||
|       <Platform>Win32</Platform> | ||||
|     </ProjectConfiguration> | ||||
|     <ProjectConfiguration Include="Debug|x64"> | ||||
|       <Configuration>Debug</Configuration> | ||||
|       <Platform>x64</Platform> | ||||
|     </ProjectConfiguration> | ||||
|     <ProjectConfiguration Include="Release|x64"> | ||||
|       <Configuration>Release</Configuration> | ||||
|       <Platform>x64</Platform> | ||||
|     </ProjectConfiguration> | ||||
|   </ItemGroup> | ||||
|   <PropertyGroup Label="Globals"> | ||||
|     <VCProjectVersion>15.0</VCProjectVersion> | ||||
|     <ProjectGuid>{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}</ProjectGuid> | ||||
|     <Keyword>Win32Proj</Keyword> | ||||
|     <RootNamespace>ScrapHack</RootNamespace> | ||||
|     <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion> | ||||
|   </PropertyGroup> | ||||
|   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||||
|     <ConfigurationType>DynamicLibrary</ConfigurationType> | ||||
|     <UseDebugLibraries>true</UseDebugLibraries> | ||||
|     <PlatformToolset>v141</PlatformToolset> | ||||
|     <CharacterSet>MultiByte</CharacterSet> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||||
|     <ConfigurationType>DynamicLibrary</ConfigurationType> | ||||
|     <UseDebugLibraries>false</UseDebugLibraries> | ||||
|     <PlatformToolset>v141</PlatformToolset> | ||||
|     <WholeProgramOptimization>true</WholeProgramOptimization> | ||||
|     <CharacterSet>MultiByte</CharacterSet> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||||
|     <ConfigurationType>DynamicLibrary</ConfigurationType> | ||||
|     <UseDebugLibraries>true</UseDebugLibraries> | ||||
|     <PlatformToolset>v141</PlatformToolset> | ||||
|     <CharacterSet>MultiByte</CharacterSet> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||||
|     <ConfigurationType>DynamicLibrary</ConfigurationType> | ||||
|     <UseDebugLibraries>false</UseDebugLibraries> | ||||
|     <PlatformToolset>v141</PlatformToolset> | ||||
|     <WholeProgramOptimization>true</WholeProgramOptimization> | ||||
|     <CharacterSet>MultiByte</CharacterSet> | ||||
|   </PropertyGroup> | ||||
|   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||||
|   <ImportGroup Label="ExtensionSettings"> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="Shared"> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||||
|     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||||
|     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||||
|     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||||
|   </ImportGroup> | ||||
|   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||||
|     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||||
|   </ImportGroup> | ||||
|   <PropertyGroup Label="UserMacros" /> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||||
|     <LinkIncremental>true</LinkIncremental> | ||||
|     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)dx8\include;$(SolutionDir)include</IncludePath> | ||||
|     <LibraryPath>$(ProjectDir)dx8\lib;$(SolutionDir)lib;$(LibraryPath)</LibraryPath> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||||
|     <LinkIncremental>true</LinkIncremental> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||||
|     <LinkIncremental>false</LinkIncremental> | ||||
|     <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)dx8\include;$(SolutionDir)include</IncludePath> | ||||
|     <LibraryPath>$(ProjectDir)dx8\lib;$(SolutionDir)lib;$(LibraryPath)</LibraryPath> | ||||
|   </PropertyGroup> | ||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||||
|     <LinkIncremental>false</LinkIncremental> | ||||
|   </PropertyGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||||
|     <ClCompile> | ||||
|       <PrecompiledHeader>Use</PrecompiledHeader> | ||||
|       <WarningLevel>Level3</WarningLevel> | ||||
|       <Optimization>Disabled</Optimization> | ||||
|       <SDLCheck>true</SDLCheck> | ||||
|       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS ;WIN32;_DEBUG;SCRAPHACK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <ConformanceMode>true</ConformanceMode> | ||||
|     </ClCompile> | ||||
|     <Link> | ||||
|       <SubSystem>Windows</SubSystem> | ||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
|     </Link> | ||||
|   </ItemDefinitionGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||||
|     <ClCompile> | ||||
|       <PrecompiledHeader>Use</PrecompiledHeader> | ||||
|       <WarningLevel>Level3</WarningLevel> | ||||
|       <Optimization>Disabled</Optimization> | ||||
|       <SDLCheck>true</SDLCheck> | ||||
|       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;SCRAPHACK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <ConformanceMode>true</ConformanceMode> | ||||
|     </ClCompile> | ||||
|     <Link> | ||||
|       <SubSystem>Windows</SubSystem> | ||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
|     </Link> | ||||
|   </ItemDefinitionGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||||
|     <ClCompile> | ||||
|       <PrecompiledHeader>Use</PrecompiledHeader> | ||||
|       <WarningLevel>Level3</WarningLevel> | ||||
|       <Optimization>MaxSpeed</Optimization> | ||||
|       <FunctionLevelLinking>true</FunctionLevelLinking> | ||||
|       <IntrinsicFunctions>true</IntrinsicFunctions> | ||||
|       <SDLCheck>true</SDLCheck> | ||||
|       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS ;WIN32;NDEBUG;SCRAPHACK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <ConformanceMode>true</ConformanceMode> | ||||
|     </ClCompile> | ||||
|     <Link> | ||||
|       <SubSystem>Windows</SubSystem> | ||||
|       <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||||
|       <OptimizeReferences>true</OptimizeReferences> | ||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
|       <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> | ||||
|       <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> | ||||
|     </Link> | ||||
|   </ItemDefinitionGroup> | ||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||||
|     <ClCompile> | ||||
|       <PrecompiledHeader>Use</PrecompiledHeader> | ||||
|       <WarningLevel>Level3</WarningLevel> | ||||
|       <Optimization>MaxSpeed</Optimization> | ||||
|       <FunctionLevelLinking>true</FunctionLevelLinking> | ||||
|       <IntrinsicFunctions>true</IntrinsicFunctions> | ||||
|       <SDLCheck>true</SDLCheck> | ||||
|       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;SCRAPHACK_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||||
|       <ConformanceMode>true</ConformanceMode> | ||||
|     </ClCompile> | ||||
|     <Link> | ||||
|       <SubSystem>Windows</SubSystem> | ||||
|       <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||||
|       <OptimizeReferences>true</OptimizeReferences> | ||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||
|     </Link> | ||||
|   </ItemDefinitionGroup> | ||||
|   <ItemGroup> | ||||
|     <ClInclude Include="D3D8_Hook.h" /> | ||||
|     <ClInclude Include="VMT_Hook.h" /> | ||||
|     <ClInclude Include="Hook.h" /> | ||||
|     <ClInclude Include="Py_Utils.h" /> | ||||
|     <ClInclude Include="Structures.h" /> | ||||
|     <ClInclude Include="Scrapland.h" /> | ||||
|     <ClInclude Include="stdafx.h" /> | ||||
|     <ClInclude Include="targetver.h" /> | ||||
|     <ClInclude Include="Util.h" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClCompile Include="dllmain.cpp" /> | ||||
|     <ClCompile Include="ScrapHack.cpp" /> | ||||
|     <ClCompile Include="stdafx.cpp"> | ||||
|       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> | ||||
|       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> | ||||
|       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> | ||||
|       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> | ||||
|     </ClCompile> | ||||
|   </ItemGroup> | ||||
|   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||||
|   <ImportGroup Label="ExtensionTargets" /> | ||||
| </Project> | ||||
|  | @ -1,57 +0,0 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||
|   <ItemGroup> | ||||
|     <Filter Include="Quelldateien"> | ||||
|       <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||||
|       <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||||
|     </Filter> | ||||
|     <Filter Include="Headerdateien"> | ||||
|       <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||||
|       <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> | ||||
|     </Filter> | ||||
|     <Filter Include="Ressourcendateien"> | ||||
|       <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||||
|       <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||||
|     </Filter> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClInclude Include="stdafx.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="targetver.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="Scrapland.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="Util.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="Structures.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="Py_Utils.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="Hook.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="D3D8_Hook.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="VMT_Hook.h"> | ||||
|       <Filter>Headerdateien</Filter> | ||||
|     </ClInclude> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <ClCompile Include="stdafx.cpp"> | ||||
|       <Filter>Quelldateien</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="ScrapHack.cpp"> | ||||
|       <Filter>Quelldateien</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="dllmain.cpp"> | ||||
|       <Filter>Quelldateien</Filter> | ||||
|     </ClCompile> | ||||
|   </ItemGroup> | ||||
| </Project> | ||||
|  | @ -13,6 +13,7 @@ | |||
| #define P_CON_HANDLER 0x402190 | ||||
| #define P_SCRAP_LOG 0x4134C0 | ||||
| #define P_SCRAP_EXEC 0x5a8390 | ||||
| #define P_SCRAP_EXIT 0x4010c0 | ||||
| 
 | ||||
| //FUNCTION TYPES
 | ||||
| #define T_SCRAP_LOG int(_cdecl*)(unsigned int, const char*) | ||||
|  |  | |||
|  | @ -134,9 +134,9 @@ T* __ptr(uintptr_t addr) | |||
| template<typename T> | ||||
| T* __ptr(uintptr_t addr, ptrdiff_t offset) | ||||
| { | ||||
| 	cout << "[" << (void*)addr << "] + " << (void*)offset << " = "; | ||||
| 	//cout << "[" << (void*)addr << "] + " << (void*)offset << " = ";
 | ||||
| 	addr = reinterpret_cast<uintptr_t*>(addr)[0] + offset; | ||||
| 	cout << (void*)addr << endl;; | ||||
| 	//cout << (void*)addr << endl;;
 | ||||
| 	auto ret = __ptr<T>(addr); | ||||
| 	return ret; | ||||
| } | ||||
|  | @ -144,9 +144,9 @@ T* __ptr(uintptr_t addr, ptrdiff_t offset) | |||
| 
 | ||||
| template<typename T, typename... Offsets> | ||||
| T* __ptr(uintptr_t addr, ptrdiff_t offset, Offsets... offsets) { | ||||
| 	cout << "[" << (void*)addr << "] + " << (void*)offset << " = "; | ||||
| 	//cout << "[" << (void*)addr << "] + " << (void*)offset << " = ";
 | ||||
| 	addr = reinterpret_cast<uintptr_t*>(addr)[0] + offset; | ||||
| 	cout << (void*)addr << endl;; | ||||
| 	//cout << (void*)addr << endl;;
 | ||||
| 	auto ret = __ptr<T>(addr, offsets...); | ||||
| 	return ret; | ||||
| } | ||||
|  |  | |||
|  | @ -4,25 +4,24 @@ void DllInit(HMODULE); | |||
| void DllPreInit(HMODULE); | ||||
| void DllUnload(HMODULE); | ||||
| 
 | ||||
| 
 | ||||
| BOOL APIENTRY DllMain(HMODULE hModule, | ||||
|                       DWORD ul_reason_for_call, | ||||
|                       LPVOID lpReserved) | ||||
| { | ||||
|     HANDLE hThread = INVALID_HANDLE_VALUE; | ||||
|     switch (ul_reason_for_call) | ||||
|     { | ||||
|     case DLL_PROCESS_ATTACH: | ||||
| 		DisableThreadLibraryCalls(hModule); | ||||
| 		DllPreInit(hModule); | ||||
|         hThread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)DllInit, hModule, 0, 0); | ||||
|         break; | ||||
|     case DLL_PROCESS_DETACH: | ||||
| 		DllUnload(hModule); | ||||
| 		break; | ||||
|     case DLL_THREAD_ATTACH: | ||||
|     case DLL_THREAD_DETACH: | ||||
|         break; | ||||
|     } | ||||
|     return TRUE; | ||||
|   HANDLE hThread = INVALID_HANDLE_VALUE; | ||||
|   switch (ul_reason_for_call) | ||||
|   { | ||||
|   case DLL_PROCESS_ATTACH: | ||||
|     DisableThreadLibraryCalls(hModule); | ||||
|     DllPreInit(hModule); | ||||
|     hThread = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)DllInit, hModule, 0, 0); | ||||
|     break; | ||||
|   case DLL_PROCESS_DETACH: | ||||
|     DllUnload(hModule); | ||||
|     break; | ||||
|   case DLL_THREAD_ATTACH: | ||||
|   case DLL_THREAD_DETACH: | ||||
|     break; | ||||
|   } | ||||
|   return TRUE; | ||||
| } | ||||
|  |  | |||
|  | @ -7,8 +7,6 @@ | |||
| 
 | ||||
| #include "targetver.h" | ||||
| 
 | ||||
| #define WIN32_LEAN_AND_MEAN // Selten verwendete Komponenten aus Windows-Headern ausschließen
 | ||||
| // Windows-Headerdateien:
 | ||||
| #include <windows.h> | ||||
| 
 | ||||
| // TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
 | ||||
|  |  | |||
|  | @ -1,47 +0,0 @@ | |||
|  | ||||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||||
| # Visual Studio 15 | ||||
| VisualStudioVersion = 15.0.27703.2042 | ||||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScrapHack", "ScrapHack\ScrapHack.vcxproj", "{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}" | ||||
| EndProject | ||||
| Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Injector", "Injector\Injector\Injector.vcxproj", "{7C91C225-D95C-4B7A-9251-0CE358BAF556}" | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| 		Debug|Any CPU = Debug|Any CPU | ||||
| 		Debug|x64 = Debug|x64 | ||||
| 		Debug|x86 = Debug|x86 | ||||
| 		Release|Any CPU = Release|Any CPU | ||||
| 		Release|x64 = Release|x64 | ||||
| 		Release|x86 = Release|x86 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Debug|Any CPU.ActiveCfg = Debug|Win32 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Debug|x64.ActiveCfg = Debug|x64 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Debug|x64.Build.0 = Debug|x64 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Debug|x86.ActiveCfg = Debug|Win32 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Debug|x86.Build.0 = Debug|Win32 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Release|Any CPU.ActiveCfg = Release|Win32 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Release|x64.ActiveCfg = Release|x64 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Release|x64.Build.0 = Release|x64 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Release|x86.ActiveCfg = Release|Win32 | ||||
| 		{72CB1B9E-50C7-4010-BEAD-82FACF87A87A}.Release|x86.Build.0 = Release|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|Any CPU.ActiveCfg = Debug|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|x64.ActiveCfg = Debug|x64 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|x64.Build.0 = Debug|x64 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|x86.ActiveCfg = Debug|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Debug|x86.Build.0 = Debug|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|Any CPU.ActiveCfg = Release|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|x64.ActiveCfg = Release|x64 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|x64.Build.0 = Release|x64 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|x86.ActiveCfg = Release|Win32 | ||||
| 		{7C91C225-D95C-4B7A-9251-0CE358BAF556}.Release|x86.Build.0 = Release|Win32 | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(SolutionProperties) = preSolution | ||||
| 		HideSolutionNode = FALSE | ||||
| 	EndGlobalSection | ||||
| 	GlobalSection(ExtensibilityGlobals) = postSolution | ||||
| 		SolutionGuid = {663B3F14-E592-447F-8F03-3210FE04AA89} | ||||
| 	EndGlobalSection | ||||
| EndGlobal | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 807 KiB | 
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue