Big Update
Added more functions to DLL Simplified Injector Added Screenshot Added some more functions to dbg.py module
This commit is contained in:
		
							parent
							
								
									2a30b53cfb
								
							
						
					
					
						commit
						0461764566
					
				
					 8 changed files with 80 additions and 37 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							|  | @ -1,12 +1,10 @@ | ||||||
|  |  | ||||||
|  | 
 | ||||||
| ## Usage | ## Usage | ||||||
| 
 | 
 | ||||||
| `.\Injector.exe dll .\ScrapHack.dll <PATH_TO_SCRAP.exe>` | 0. Build Project | ||||||
| e.g: | 1. Run Injector `.\Injector.exe` | ||||||
| `.\Injector.exe dll .\ScrapHack.dll "D:\Games\Deep Silver\Scrapland\Bin\Scrap.exe"` | 2. Run Game | ||||||
| 
 | 3. Wait ~10 Seconds for game to load and Injector to works its magic | ||||||
| or inject into a running instance of the game using your DLL-Injector of choise like so: |  | ||||||
| 
 |  | ||||||
| `.\Injector.exe dll .\ScrapHack.dll <PID>` |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| Currently the Injected DLL creates a thread that waits for you to press F12 and then writes something to the ingame console |  | ||||||
										
											Binary file not shown.
										
									
								
							|  | @ -78,6 +78,8 @@ | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||||||
|     <LinkIncremental>false</LinkIncremental> |     <LinkIncremental>false</LinkIncremental> | ||||||
|  |     <IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath> | ||||||
|  |     <LibraryPath>$(SolutionDir)lib;$(LibraryPath)</LibraryPath> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||||||
|     <LinkIncremental>false</LinkIncremental> |     <LinkIncremental>false</LinkIncremental> | ||||||
|  | @ -126,6 +128,7 @@ | ||||||
|       <EnableCOMDATFolding>true</EnableCOMDATFolding> |       <EnableCOMDATFolding>true</EnableCOMDATFolding> | ||||||
|       <OptimizeReferences>true</OptimizeReferences> |       <OptimizeReferences>true</OptimizeReferences> | ||||||
|       <GenerateDebugInformation>true</GenerateDebugInformation> |       <GenerateDebugInformation>true</GenerateDebugInformation> | ||||||
|  |       <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> | ||||||
|     </Link> |     </Link> | ||||||
|   </ItemDefinitionGroup> |   </ItemDefinitionGroup> | ||||||
|   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||||||
|  | @ -162,6 +165,5 @@ | ||||||
|     </ClCompile> |     </ClCompile> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||||||
|   <ImportGroup Label="ExtensionTargets"> |   <ImportGroup Label="ExtensionTargets" /> | ||||||
|   </ImportGroup> |  | ||||||
| </Project> | </Project> | ||||||
|  | @ -1,2 +1,6 @@ | ||||||
| #pragma once | #pragma once | ||||||
| auto scrap_log = (int(_cdecl *)(int, const char*))0x4134C0; | #define WORLD 0x7FE944 | ||||||
|  | #define PY_MODS 0x79C698 | ||||||
|  | 
 | ||||||
|  | auto scrap_log = (int(_cdecl*)(int, const char*))0x4134C0; | ||||||
|  | auto scrap_exec = (void(_cdecl*)(const char*))0x5a8390; | ||||||
|  |  | ||||||
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								ScrapHacks/img/Screenshot_1.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								ScrapHacks/img/Screenshot_1.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 853 KiB | 
							
								
								
									
										91
									
								
								lib/dbg.py
									
										
									
									
									
								
							
							
						
						
									
										91
									
								
								lib/dbg.py
									
										
									
									
									
								
							|  | @ -4,10 +4,15 @@ import quickconsole | ||||||
| import MissionsFuncs | import MissionsFuncs | ||||||
| import SScorer | import SScorer | ||||||
| import Menu | import Menu | ||||||
|  | import sys | ||||||
| QC = quickconsole | QC = quickconsole | ||||||
| MF = MissionsFuncs | MF = MissionsFuncs | ||||||
| last_frame = None | last_frame = None | ||||||
| 
 | 
 | ||||||
|  | sys.path.append(".\\pylib\\Lib") | ||||||
|  | sys.path.append(".\\pylib\\Libs") | ||||||
|  | sys.path.append(".\\pylib") | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| def reload(): | def reload(): | ||||||
|     sys.settrace(None) |     sys.settrace(None) | ||||||
|  | @ -15,9 +20,10 @@ def reload(): | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def dgb_info(): | def dgb_info(): | ||||||
|     txt =`last_frame` |     SScorer.SetLabelText(`last_frame`, Scrap.GetTime() + 0.1) | ||||||
|     SScorer.SetLabelText(txt, Scrap.GetTime()+0.1) |     Scrap.DeleteScheduledFuncs("dbg.dbg_info") | ||||||
|     Scrap.AddScheduledFunc(Scrap.GetTime()+0.1, dgb_info, (), "dbg_info") |     Scrap.DeleteScheduledFuncs("dbg.dbg_info") | ||||||
|  |     Scrap.AddScheduledFunc(Scrap.GetTime()+0.1, dgb_info, (), "dbg.dbg_info") | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def crazy(): | def crazy(): | ||||||
|  | @ -117,14 +123,6 @@ def helpfunc(func): | ||||||
|     print "    "+func.__doc__ |     print "    "+func.__doc__ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| for module in sys.builtin_module_names: |  | ||||||
|     if module[0] == "S": |  | ||||||
|         print "Loading "+module |  | ||||||
|     exec("import " + module) |  | ||||||
| 
 |  | ||||||
| sys.settrace(None) |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def trace(frame, event, arg): | def trace(frame, event, arg): | ||||||
|     global last_frame |     global last_frame | ||||||
|     if event != "call": |     if event != "call": | ||||||
|  | @ -189,10 +187,10 @@ def helplib(): | ||||||
|                 continue |                 continue | ||||||
|             if hasattr(value, "__doc__"): |             if hasattr(value, "__doc__"): | ||||||
|                 if value.__doc__: |                 if value.__doc__: | ||||||
|                     log("- "+name+":") |                     log("- "+name+":"+repr(value)) | ||||||
|                     log("      "+value.__doc__) |                     log("      "+value.__doc__) | ||||||
|                 else: |                 else: | ||||||
|                     log("- "+name+": ???") |                     log("- "+name+":"+repr(value)) | ||||||
|             else: |             else: | ||||||
|                 log("- "+name+": "+repr(value)) |                 log("- "+name+": "+repr(value)) | ||||||
|         log("\n") |         log("\n") | ||||||
|  | @ -218,8 +216,6 @@ def enable_all_conv(): | ||||||
|         E.Invulnerable = 0 |         E.Invulnerable = 0 | ||||||
|         E.Life = 100 |         E.Life = 100 | ||||||
|         E = Scrap.GetEntity(E.NextInSlot) |         E = Scrap.GetEntity(E.NextInSlot) | ||||||
|     print(len(CharConversor.ConversionChars)) |  | ||||||
|     print "Done!" |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def goto(name=None): | def goto(name=None): | ||||||
|  | @ -249,8 +245,8 @@ def nuke(): | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def become(name): | def become(name): | ||||||
|     enable_all_conv() |  | ||||||
|     import CharConversor |     import CharConversor | ||||||
|  |     enable_all_conv() | ||||||
|     me = Scrap.UsrEntity(0) |     me = Scrap.UsrEntity(0) | ||||||
|     ent = Scrap.GetEntity(name) |     ent = Scrap.GetEntity(name) | ||||||
|     if ent: |     if ent: | ||||||
|  | @ -277,13 +273,8 @@ def movie(MovieName="Movie/Movie"): | ||||||
|     Scrap.AddScheduledFunc(NextTime, movie, (Speed, MovieName, NextTime)) |     Scrap.AddScheduledFunc(NextTime, movie, (Speed, MovieName, NextTime)) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def park(): |  | ||||||
|     me = Scrap.UsrEntity(0) |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def find(filt="*"): | def find(filt="*"): | ||||||
|     Scrap.StartDummySearch(filt, 1) |     dummy = Scrap.StartDummySearch(filt, 1) | ||||||
|     dummy = 1 |  | ||||||
|     while dummy: |     while dummy: | ||||||
|         dummy = Scrap.NextDummySearch() |         dummy = Scrap.NextDummySearch() | ||||||
|         print dummy |         print dummy | ||||||
|  | @ -300,12 +291,57 @@ def getall(): | ||||||
|         E = Scrap.GetEntity(E.NextInSlot) |         E = Scrap.GetEntity(E.NextInSlot) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def god(): | def god(e=None): | ||||||
|     e = Scrap.UsrEntity(0) |     if e == None: | ||||||
|     QC.godcall(None, (1, 1, 1, 1, 1, 1)) |         e = Scrap.UsrEntity(0) | ||||||
|     Scrap.AddScheduledFunc(Scrap.GetTime()+0.1, god, (), 'dbg.god') |     if e: | ||||||
|  |         if e.IsType("Car"): | ||||||
|  |             e.Ammo00 = SWeap.GetFAmmo(0, "Max") | ||||||
|  |             e.Ammo01 = SWeap.GetFAmmo(1, "Max") | ||||||
|  |             e.Ammo02 = SWeap.GetFAmmo(2, "Max") | ||||||
|  |             e.Ammo03 = SWeap.GetFAmmo(3, "Max") | ||||||
|  |             e.WeapList = "63,63,63,63,63,63,1" | ||||||
|  |             e.MaxLife = e.MinLife | ||||||
|  |             if e.Life > e.MaxLife: | ||||||
|  |                 e.Life = e.MaxLife | ||||||
|  |             e.CMStamp = 0 | ||||||
|  |             e.FireStamp = 0 | ||||||
|  |             e.BoostTime = 0 | ||||||
|  |         elif e.IsType("WalkChar"): | ||||||
|  |             e.Energy = 1 | ||||||
|  |         e.Invulnerable = 1 | ||||||
|  |     Scrap.DeleteScheduledFuncs("dbg.god") | ||||||
|  |     Scrap.DeleteScheduledFuncs("dbg.god") | ||||||
|  |     Scrap.AddScheduledFunc(Scrap.GetTime(), god, (e,), "dbg.god") | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | def ultranuke(): | ||||||
|  |     nuke() | ||||||
|  |     Scrap.DeleteScheduledFuncs("dbg.ultranuke") | ||||||
|  |     Scrap.DeleteScheduledFuncs("dbg.ultranuke") | ||||||
|  |     Scrap.AddScheduledFunc(Scrap.GetTime(), ultranuke, | ||||||
|  |                            (), "dbg.ultranuke") | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def brake(): | ||||||
|  |     if me: | ||||||
|  |         me.Vel = (0, 0, 0) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | for _ in range(1024): | ||||||
|  |     Scrap.DeleteScheduledFuncs("dbg.dbg_info") | ||||||
|  |     Scrap.DeleteScheduledFuncs("dbg.god") | ||||||
|  |     Scrap.DeleteScheduledFuncs("dbg_info") | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | for module in sys.builtin_module_names: | ||||||
|  |     if module[0] == "S": | ||||||
|  |         print "Loading "+module | ||||||
|  |     exec("import " + module) | ||||||
|  | 
 | ||||||
|  | sys.settrace(None) | ||||||
|  | 
 | ||||||
|  | me = Scrap.UsrEntity(0) | ||||||
| notrace() | notrace() | ||||||
| helplib() | helplib() | ||||||
| # settrace() | # settrace() | ||||||
|  | @ -314,5 +350,8 @@ enable_all_conv() | ||||||
| god() | god() | ||||||
| Scrap.Set("debug", 3) | Scrap.Set("debug", 3) | ||||||
| Scrap.Set("ShowConsoleLog", 1) | Scrap.Set("ShowConsoleLog", 1) | ||||||
|  | Scrap.Set("AlwaysFlushLog", 1) | ||||||
|  | Scrap.Set("PythonExecute", "import dbg") | ||||||
|  | exec("import QuickConsole;QuickConsole.debug=sys.modules['dbg']") | ||||||
| 
 | 
 | ||||||
| print "Debug Module loaded" | print "Debug Module loaded" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue