Big Update

Added more functions to DLL
Simplified Injector
Added Screenshot
Added some more functions to dbg.py module
This commit is contained in:
Daniel S. 2019-02-27 01:56:10 +01:00
parent 2a30b53cfb
commit 0461764566
8 changed files with 80 additions and 37 deletions

View file

@ -1,12 +1,10 @@
![Screenshot](img/Screenshot_1.png)
## Usage
`.\Injector.exe dll .\ScrapHack.dll <PATH_TO_SCRAP.exe>`
e.g:
`.\Injector.exe dll .\ScrapHack.dll "D:\Games\Deep Silver\Scrapland\Bin\Scrap.exe"`
or inject into a running instance of the game using your DLL-Injector of choise like so:
`.\Injector.exe dll .\ScrapHack.dll <PID>`
0. Build Project
1. Run Injector `.\Injector.exe`
2. Run Game
3. Wait ~10 Seconds for game to load and Injector to works its magic
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.

View file

@ -78,6 +78,8 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(SolutionDir)include;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
@ -126,6 +128,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -162,6 +165,5 @@
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<ImportGroup Label="ExtensionTargets" />
</Project>

View file

@ -1,2 +1,6 @@
#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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 KiB

View file

@ -4,10 +4,15 @@ import quickconsole
import MissionsFuncs
import SScorer
import Menu
import sys
QC = quickconsole
MF = MissionsFuncs
last_frame = None
sys.path.append(".\\pylib\\Lib")
sys.path.append(".\\pylib\\Libs")
sys.path.append(".\\pylib")
def reload():
sys.settrace(None)
@ -15,9 +20,10 @@ def reload():
def dgb_info():
txt =`last_frame`
SScorer.SetLabelText(txt, Scrap.GetTime()+0.1)
Scrap.AddScheduledFunc(Scrap.GetTime()+0.1, dgb_info, (), "dbg_info")
SScorer.SetLabelText(`last_frame`, Scrap.GetTime() + 0.1)
Scrap.DeleteScheduledFuncs("dbg.dbg_info")
Scrap.DeleteScheduledFuncs("dbg.dbg_info")
Scrap.AddScheduledFunc(Scrap.GetTime()+0.1, dgb_info, (), "dbg.dbg_info")
def crazy():
@ -117,14 +123,6 @@ def helpfunc(func):
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):
global last_frame
if event != "call":
@ -189,10 +187,10 @@ def helplib():
continue
if hasattr(value, "__doc__"):
if value.__doc__:
log("- "+name+":")
log("- "+name+":"+repr(value))
log(" "+value.__doc__)
else:
log("- "+name+": ???")
log("- "+name+":"+repr(value))
else:
log("- "+name+": "+repr(value))
log("\n")
@ -218,8 +216,6 @@ def enable_all_conv():
E.Invulnerable = 0
E.Life = 100
E = Scrap.GetEntity(E.NextInSlot)
print(len(CharConversor.ConversionChars))
print "Done!"
def goto(name=None):
@ -249,8 +245,8 @@ def nuke():
def become(name):
enable_all_conv()
import CharConversor
enable_all_conv()
me = Scrap.UsrEntity(0)
ent = Scrap.GetEntity(name)
if ent:
@ -277,13 +273,8 @@ def movie(MovieName="Movie/Movie"):
Scrap.AddScheduledFunc(NextTime, movie, (Speed, MovieName, NextTime))
def park():
me = Scrap.UsrEntity(0)
def find(filt="*"):
Scrap.StartDummySearch(filt, 1)
dummy = 1
dummy = Scrap.StartDummySearch(filt, 1)
while dummy:
dummy = Scrap.NextDummySearch()
print dummy
@ -300,12 +291,57 @@ def getall():
E = Scrap.GetEntity(E.NextInSlot)
def god():
e = Scrap.UsrEntity(0)
QC.godcall(None, (1, 1, 1, 1, 1, 1))
Scrap.AddScheduledFunc(Scrap.GetTime()+0.1, god, (), 'dbg.god')
def god(e=None):
if e == None:
e = Scrap.UsrEntity(0)
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()
helplib()
# settrace()
@ -314,5 +350,8 @@ enable_all_conv()
god()
Scrap.Set("debug", 3)
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"