Browse Source

Removed unused. Added lua

main
DangerKiddy 12 months ago
parent
commit
48d9eeab57
  1. 63
      .gitattributes
  2. 340
      .gitignore
  3. 9
      README.md
  4. 46
      diddlerInternal/Firespread.cpp
  5. 7
      diddlerInternal/Firespread.h
  6. 36
      diddlerInternal/Flamethrower.cpp
  7. 5
      diddlerInternal/Flamethrower.h
  8. 15
      diddlerInternal/Global.cpp
  9. 27
      diddlerInternal/Global.h
  10. 197
      diddlerInternal/Harop.cpp
  11. 8
      diddlerInternal/Harop.h
  12. 14
      diddlerInternal/Jetpack.cpp
  13. 5
      diddlerInternal/Jetpack.h
  14. 138
      diddlerInternal/Lua.cpp
  15. 19
      diddlerInternal/Lua.h
  16. 5
      diddlerInternal/Lua.hpp
  17. 68
      diddlerInternal/Mods.cpp
  18. 19
      diddlerInternal/Mods.h
  19. 57
      diddlerInternal/Script.h
  20. 416
      diddlerInternal/TDFuncs.cpp
  21. 141
      diddlerInternal/TDObjects.h
  22. 109
      diddlerInternal/balloons.cpp
  23. 7
      diddlerInternal/balloons.h
  24. 251
      diddlerInternal/c4.cpp
  25. 7
      diddlerInternal/c4.h
  26. 555
      diddlerInternal/camera.cpp
  27. 29
      diddlerInternal/camera.h
  28. 34
      diddlerInternal/cameraManager.cpp
  29. 6
      diddlerInternal/cameraManager.h
  30. 149
      diddlerInternal/console.cpp
  31. 9
      diddlerInternal/constClock.cpp
  32. 233
      diddlerInternal/crashHandler.cpp
  33. 8
      diddlerInternal/crashHandler.h
  34. 8
      diddlerInternal/cutter.cpp
  35. 4
      diddlerInternal/cutter.h
  36. 153
      diddlerInternal/diddlerInternal.vcxproj
  37. 402
      diddlerInternal/diddlerInternal.vcxproj.filters
  38. 15
      diddlerInternal/dllmain.cpp
  39. 103
      diddlerInternal/dotProjector.cpp
  40. 43
      diddlerInternal/envOptions.cpp
  41. 7
      diddlerInternal/envOptions.h
  42. 10
      diddlerInternal/focusHook.cpp
  43. 26
      diddlerInternal/godmode.cpp
  44. 8
      diddlerInternal/godmode.h
  45. 1
      diddlerInternal/hookTests.cpp
  46. 77
      diddlerInternal/lantern.cpp
  47. 26
      diddlerInternal/lantern.h
  48. 84
      diddlerInternal/lidar.cpp
  49. 12
      diddlerInternal/lidar.h
  50. 90
      diddlerInternal/mem.cpp
  51. 2
      diddlerInternal/mem.h
  52. 196
      diddlerInternal/missileLauncher.cpp
  53. 5
      diddlerInternal/missileLauncher.h
  54. 6
      diddlerInternal/movementLoop.cpp
  55. 108
      diddlerInternal/multiplayer/Client.cpp
  56. 8
      diddlerInternal/multiplayer/Client.h
  57. 41
      diddlerInternal/multiplayer/Compresser.h
  58. 8
      diddlerInternal/multiplayer/Main.cpp
  59. 2
      diddlerInternal/multiplayer/Main.h
  60. 62
      diddlerInternal/multiplayer/Messages.h
  61. 46
      diddlerInternal/multiplayer/Player.cpp
  62. 11
      diddlerInternal/multiplayer/Player.h
  63. 26
      diddlerInternal/multiplayer/Server.cpp
  64. 123
      diddlerInternal/noclip.cpp
  65. 14
      diddlerInternal/noclip.h
  66. 268
      diddlerInternal/objectSpawner.cpp
  67. 27
      diddlerInternal/objectSpawner.h
  68. 193
      diddlerInternal/objectTranslationTest.cpp
  69. 9
      diddlerInternal/objectTranslationTest.h
  70. 131
      diddlerInternal/physCamera.cpp
  71. 10
      diddlerInternal/physCamera.h
  72. 73
      diddlerInternal/physMonitor.cpp
  73. 5
      diddlerInternal/physMonitor.h
  74. 118
      diddlerInternal/snapPoints.cpp
  75. 23
      diddlerInternal/snapPoints.h
  76. 559
      diddlerInternal/swapBuffers.cpp
  77. 58
      diddlerInternal/tgtAttribute.cpp
  78. 15
      diddlerInternal/tgtAttribute.h
  79. 20
      diddlerInternal/tgtBalloon.cpp
  80. 10
      diddlerInternal/tgtBalloon.h
  81. 26
      diddlerInternal/tgtBase.h
  82. 38
      diddlerInternal/tgtCamera.cpp
  83. 13
      diddlerInternal/tgtCamera.h
  84. 40
      diddlerInternal/tgtDamage.cpp
  85. 15
      diddlerInternal/tgtDamage.h
  86. 10
      diddlerInternal/tgtDebug.cpp
  87. 7
      diddlerInternal/tgtDebug.h
  88. 17
      diddlerInternal/tgtDev.cpp
  89. 9
      diddlerInternal/tgtDev.h
  90. 53
      diddlerInternal/tgtExplode.cpp
  91. 13
      diddlerInternal/tgtExplode.h
  92. 39
      diddlerInternal/tgtFlamethrower.cpp
  93. 10
      diddlerInternal/tgtFlamethrower.h
  94. 17
      diddlerInternal/tgtIncludes.h
  95. 10
      diddlerInternal/tgtLeafblower.cpp
  96. 7
      diddlerInternal/tgtLeafblower.h
  97. 49
      diddlerInternal/tgtMinigun.cpp
  98. 12
      diddlerInternal/tgtMinigun.h
  99. 28
      diddlerInternal/tgtRemove.cpp
  100. 9
      diddlerInternal/tgtRemove.h
  101. Some files were not shown because too many files have changed in this diff Show More

63
.gitattributes vendored

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

340
.gitignore vendored

@ -0,0 +1,340 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# 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
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.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
# Visual Studio Trace Files
*.e2e
# 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
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# 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
# Note: 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
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable 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
*.appx
# 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
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# 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
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- Backup*.rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# 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 personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb

9
README.md

@ -0,0 +1,9 @@
# KnedMod - a sandbox oriented mod for teardown
The main purpose of KnedMod is to give you a spawn menu within teardown that can be used to dynamically add new objects to the world.
It also adds a toolgun with various functions and a noclip mode.
This is considered far from a complete project and has a lot of known bugs that can cause crashes, however i feel it is a good resource for anyone attempting to make their own mod.
Building requires MS Detours and GLEW. KnedMod is released under the GNU GPL v3 license.
Tons of thanks to [SK83RJOSH](https://github.com/SK83RJOSH), [Nahu](https://github.com/nxhu64) and [Xorberax](https://github.com/ss-gnalvesteffer)

46
diddlerInternal/Firespread.cpp

@ -1,46 +0,0 @@
#include "mem.h"
#include "Firespread.h"
#include <iostream>
namespace fireSpreadMod {
const byte ignorePlayerRules1[] = { 0x75, 0x59, 0x44, 0x0F, 0x2F, 0x44, 0x37, 0x14, 0x73, 0x51 }; //signature for NOP position 1
const byte ignorePlayerRules2[] = { 0x75, 0x5F, 0xF3, 0x0F, 0x10, 0x05, 0x91, 0xB7, 0x21, 0x00 }; //signature for NOP position 2
const byte ignorePlayerRules3[] = { 0x0F, 0x85, 0x05, 0x01, 0x00, 0x00, 0x66, 0xC7 }; //signature for NOP position 3
const byte normalByteCode1[] = { 0x75, 0x59, 0x44, 0x0F, 0x2F, 0x44, 0x37, 0x14, 0x73, 0x51 }; //default data for position 1
const byte normalByteCode2[] = { 0x75, 0x5F }; //default data for position 2
const byte normalByteCode3[] = { 0x0F, 0x85, 0x05, 0x01, 0x00, 0x00, 0x66, 0xC7 }; //default data for position 3
byte* ptr_playerRules1 = 0;
byte* ptr_playerRules2 = 0;
byte* ptr_playerRules3 = 0;
bool isFireModEnabled = false;
void enableEverythingBurns() {
byte* ptr_playerRules1 = (byte*)mem::FindPattern((byte*)ignorePlayerRules1, "xxxxxxxxxx", GetModuleHandle(NULL));
byte* ptr_playerRules2 = (byte*)mem::FindPattern((byte*)ignorePlayerRules2, "xxxxxxxxxx", GetModuleHandle(NULL));
byte* ptr_playerRules3 = (byte*)mem::FindPattern((byte*)ignorePlayerRules3, "xxxxxxxx", GetModuleHandle(NULL));
std::cout << ":ENABLE:" << (uintptr_t)ptr_playerRules1 << ":" << (uintptr_t)ptr_playerRules2 << ":" << (uintptr_t)ptr_playerRules3 << std::endl;
mem::Nop(ptr_playerRules1, 10);
mem::Nop(ptr_playerRules1, 2);
mem::Nop(ptr_playerRules1, 8);
}
void disableEverythingBurns() {
mem::Patch(ptr_playerRules1, (byte*)normalByteCode1, 10);
mem::Patch(ptr_playerRules1, (byte*)normalByteCode2, 2);
mem::Patch(ptr_playerRules1, (byte*)normalByteCode3, 8);
}
void toggleFireMod() {
if (isFireModEnabled) {
disableEverythingBurns();
}
else {
enableEverythingBurns();
}
}
}

7
diddlerInternal/Firespread.h

@ -1,7 +0,0 @@
#pragma once
namespace fireSpreadMod {
extern bool isFireModEnabled;
void toggleFireMod();
void enableEverythingBurns();
void disableEverythingBurns();
}

36
diddlerInternal/Flamethrower.cpp

@ -1,36 +0,0 @@
#include "Global.h"
#include "Raycaster.h"
#include "drawCube.h"
namespace flamethrower {
float flRadius = 1.5f;
void execFlamethrower() {
const char* name = "blowtorch";
if (memcmp(glb::player->heldItemName, name, 9) == 0) {
if (glb::player->isAttacking == true) {
raycaster::rayData rayDat = raycaster::castRayPlayer();
td::Color red{ 1.f, 0.f, 0.f, 1.f };
drawCube({ rayDat.worldPos.x, rayDat.worldPos.y, rayDat.worldPos.z }, flRadius, red);
for (float ty = (rayDat.worldPos.y - flRadius); ty < (rayDat.worldPos.y + flRadius); ty += 0.1f) {
for (float tx = (rayDat.worldPos.x - flRadius); tx < (rayDat.worldPos.x + flRadius); tx += 0.1f) {
for (float tz = (rayDat.worldPos.z - flRadius); tz < (rayDat.worldPos.z + flRadius); tz += 0.1f) {
if ((rand() % 100) == 0) {
td::Vec3 firepos = { tx, ty, tz };
glb::oSpawnFire(*(uintptr_t*)(glb::scene + 0xA8), &firepos);
}
}
}
}
}
else {
raycaster::rayData rayDat = raycaster::castRayPlayer();
td::Color green{ 0.f, 1.f, 0.f, 1.f };
drawCube({ rayDat.worldPos.x, rayDat.worldPos.y, rayDat.worldPos.z }, flRadius, green);
}
}
}
}

5
diddlerInternal/Flamethrower.h

@ -1,5 +0,0 @@
#pragma once
namespace flamethrower {
void execFlamethrower();
}

15
diddlerInternal/Global.cpp

@ -1,4 +1,4 @@
#include "Global.h"
#include "global.h"
#include "TDObjects.h"
#include "glm/gtx/quaternion.hpp"
@ -14,6 +14,8 @@ namespace glb {
glb::oSOA(shape, &p1, &p2);
}
bool isGameFocused = false;
loadTDBIN oLtDBin;
S140152540 o_S140152540;
S1400C4F70 o_S1400C4F70;
@ -59,6 +61,7 @@ namespace glb {
attachJoint tdAttachJoint;
updateJoint tdUpdateJoint;
funRuiner tdFunRuiner;
interestingUpdateFunc tdUpdateFunc;
highlightShape oHighlightShape;
outlineShape oOutlineShape;
@ -85,11 +88,17 @@ namespace glb {
SetDynamic oSetDynamic;
TMalloc oTMalloc;
TFree oTFree;
TRealloc oTRealloc;
frameDrawLine oFDL;
rayCast oRC;
spawnFire oSpawnFire;
createProjectile oPewpew;
TluaAlloc LuaAllocF;
tRegisterGameFunctions RegisterGameFunctions;
tRegisterLuaFunction tdRegisterLuaFunction;
tluaL_loadbuffer oluaL_loadbuffer;
createExplosion TDcreateExplosion;
spawnParticle TDspawnParticle;
@ -150,7 +159,7 @@ namespace math {
}
float randFloat(float min, float max) {
return min + static_cast <float> (rand()) / (static_cast <float> (float(RAND_MAX) / (max - min)));
return min + static_cast <float> (rand()) / (static_cast <float> (RAND_MAX / (max - min)));
}
}
@ -162,4 +171,4 @@ namespace utils {
shapePtr = shapePtr->pSibling;
}
}
}
}

27
diddlerInternal/Global.h

@ -9,13 +9,15 @@
#include <ctime>
#include "detours.h"
#include <mutex>
#include "Global.h"
#include "global.h"
#include <fstream>
#include <iostream>
#include <filesystem>
#include <random>
#include "TDObjects.h"
#include "glm/glm.hpp"
#include "crashHandler.h"
#include "Script.h"
struct RaycastFilter
{
@ -31,7 +33,7 @@ struct RaycastFilter
//world
typedef void(__fastcall* environmentUpdate)(uintptr_t env);
typedef void(__fastcall* rayCast)(TDScene* scene, td::Vec3* pos, td::Vec3* rot, float dist, RaycastFilter* filter, float* outDist, td::Vec3* out, uintptr_t* out_shape, uintptr_t* out_palette);
typedef bool(__fastcall* rayCast)(TDScene* scene, td::Vec3* pos, td::Vec3* rot, float dist, RaycastFilter* filter, float* outDist, td::Vec3* out, uintptr_t* out_shape, uintptr_t* out_palette);
typedef void(__fastcall* frameDrawLine)(TDRenderer* renderer, const td::Vec3& p1, const td::Vec3& p2, const td::Color& c1, const td::Color& c2, bool use_depth);
typedef void(__fastcall* highlightShape)(TDRenderer* renderer, TDShape* shape, float opacity);
typedef void(__fastcall* outlineShape)(TDRenderer* renderer, TDShape* shape, td::Color* colour, float opacity);
@ -51,7 +53,7 @@ typedef void(__fastcall* createLight)(TDRenderer* renderer, td::Vec3* a2, td::Ve
typedef void(__fastcall* spawnFire)(uintptr_t scene, td::Vec3* pos);
typedef void(__fastcall* CreateTexture) (uintptr_t ptr);
typedef void(__fastcall* CreatePhysics) (uintptr_t ptr);
typedef void(__fastcall* createProjectile)(TDScene* scene, td::Vec3* pos, td::Vec3* dir, INT32 type, float unkn);
typedef void(__fastcall* createProjectile)(TDScene* scene, td::Vec3* pos, td::Vec3* dir, INT32 type, float un1, int un2);
typedef void(__fastcall* deleteBody) (INT64 a1, INT64 a2, INT64 a3, INT64 a4, INT64 a5, INT64 a6, INT64 a7, INT64 a8);
typedef void(__fastcall* UpdateShapes) (uintptr_t ptr);
typedef void(__fastcall* B_Constructor) (uintptr_t ptr, uintptr_t parent);
@ -68,6 +70,12 @@ typedef __int64(__fastcall* constructScreen)(TDScreen* a1, uintptr_t a2);
typedef __int64(__fastcall* unknGraphicsInitFunction)(void* a1);
typedef void*(__fastcall* initScreenSecondary)(void* a1, void* a2, void* a3);
//lua
typedef void* (__fastcall* TluaAlloc)(void* userData, void* ptr, size_t oldSize, size_t newSize);
typedef void (*tRegisterGameFunctions) (CScriptCore* pScriptCore);
typedef void (*tRegisterLuaFunction) (CScriptCore_LuaState* pSCLS, td::small_string * sFunctionName, void* pFunction);
typedef int (*tluaL_loadbuffer) (lua_State* L, const char* buff, size_t size, const char* name);
//a1: GAME + 0xA8
//a2: small_string* containing path
//a3: small_string* containing path with "RAW:" at the start
@ -84,6 +92,7 @@ typedef void(__fastcall* attachJoint)(TDJoint* joint, TDShape* shape1, TDShape*
typedef void(__fastcall* updateJoint)(TDJoint* joint);
//misc
typedef void(__fastcall* funRuiner)(DWORD a1, DWORD a2, DWORD a3);
typedef void(__stdcall* damageObject)(uintptr_t a1, uintptr_t a2, td::Vec3* a3, float a4, float a5, uintptr_t a6, uintptr_t a7, uintptr_t a8);
typedef void(__stdcall* createExplosionWrapped)(double unkn, td::Vec3* pos, float power);
typedef void(__fastcall* spawnParticleWrapped)(double a1, __int64 a2);
@ -98,6 +107,7 @@ typedef char(__fastcall* idfk) (__int64 a1, __int64 a2, signed int* a3, signed i
typedef void(__fastcall* damagePlayer) (TDPlayer* player, float damage);
typedef uintptr_t(__fastcall* TMalloc)(size_t);
typedef void(__fastcall* TFree)(uintptr_t mem);
typedef void*(__cdecl* TRealloc)(void* mem, size_t _Size);
typedef void(__fastcall* spreadFire)(__int64 a1, float v2);
typedef void(__fastcall* addContextItem)(char* a1, int a2, int a3, float* a4);
typedef bool(__fastcall* isActiveWindow)(void* a1);
@ -125,6 +135,8 @@ typedef void*(__fastcall* S140152740)(void* a1);
namespace glb {
void setObjectAttribute(TDShape* shape, const char* a1, const char* a2);
extern bool isGameFocused;
extern loadTDBIN oLtDBin;
extern S140152540 o_S140152540;
extern S1400C4F70 o_S1400C4F70;
@ -156,6 +168,7 @@ namespace glb {
extern unknReadVoxData oIUnReadVox;
extern isActiveWindow oIsActive;
extern funRuiner tdFunRuiner;
extern joinConstructor tdConstructJoint;
extern initBall tdInitBall;
extern initHinge tdInitHinge;
@ -194,10 +207,16 @@ namespace glb {
extern SetDynamic oSetDynamic;
extern TMalloc oTMalloc;
extern TFree oTFree;
extern TRealloc oTRealloc;
extern frameDrawLine oFDL;
extern rayCast oRC;
extern spawnFire oSpawnFire;
extern createProjectile oPewpew;
extern TluaAlloc LuaAllocF;
extern tRegisterGameFunctions RegisterGameFunctions;
extern tRegisterLuaFunction tdRegisterLuaFunction;
extern tluaL_loadbuffer oluaL_loadbuffer;
extern createExplosion TDcreateExplosion;
extern spawnParticle TDspawnParticle;
@ -242,4 +261,4 @@ namespace math {
namespace utils {
void highlightBody(TDBody* body, float opacity);
}
}

197
diddlerInternal/Harop.cpp

@ -1,197 +0,0 @@
//#include "Raycaster.h"
//#include "objectSpawner.h"
//#include "maths.h"
//#include <glm/glm.hpp>
//#include <glm/gtc/quaternion.hpp>
//#include "drawCube.h"
//#include "toolgun.h"
//
//#include "imgui/imgui.h"
//#include "imgui/imgui_impl_opengl3.h"
//#include "imgui/imgui_impl_win32.h"
//#include "camera.h"
//
//namespace HaropDrone {
// spawner::KMSpawnedObject camera = {};
// RaycastFilter rcf = {};
// const float pi = 3.1415926535f;
// bool genFilter = true;
// float minDist = 1000.f;
// float maxDist = 0.f;
// int deadCameraframes = 0;
//
// byte* pixelsColor = nullptr;
// float* pixels = nullptr;
//
// void spawnHarop() {
// spawner::objectSpawnerParams osp = {};
// //osp.unbreakable = true;
// osp.nocull = true;
// camera = spawner::spawnObjectProxy("KM_Vox/Default/harop/object.vox", osp);
// glb::setObjectAttribute(camera.shape, "explosive", "10");
//
// rcf.m_IgnoredBodies.push_back(camera.body);
// rcf.m_IgnoredShapes.push_back(camera.shape);
// }
//
// void destroyHarop() {
// camera.body->Destroy(camera.body, true);
// camera.shape->Destroy(camera.shape, true);
// camera = {};
// }
//
// float randFloat(float min, float max) {
// return min + static_cast <float> (rand()) / (static_cast <float> (RAND_MAX / (max - min)));
// }
//
// void updateHaropCamera() {
// int res = toolgun::cameraResolution;
// float fov = toolgun::cameraFov;
// int pixelOffset = 0;
//
// if (!camera.body || !camera.shape) {
//
// return;
// }
//
// if (camera.shape->isBroken) {
// if (deadCameraframes > 0) {
// free(pixelsColor);
// pixelsColor = new byte[(res * res) * 4];
//
// for (int y = res; y > 0; y--) {
// for (int x = 0; x < res; x++) {
// int shade = rand() % 255;
// pixelsColor[pixelOffset] = (byte)(shade);
// pixelsColor[pixelOffset + 1] = (byte)(shade);
// pixelsColor[pixelOffset + 2] = (byte)(shade);
// pixelsColor[pixelOffset + 3] = (byte)(255);
// pixelOffset += 4;
// }
// }
// //camera::updateCameraFrameColor(pixelsColor, res, 0, 0, false);
// camera::drawCameraWindow(0.f);
// deadCameraframes--;
// }
// else {
// destroyHarop();
// }
//
// return;
// }
//
// td::Vec3 objectMin = camera.shape->posMin;
// td::Vec3 objectMax = camera.shape->posMax;
// td::Vec3 centerpoint = { objectMax.x - ((objectMax.x - objectMin.x) / 2), objectMax.y - ((objectMax.y - objectMin.y) / 2), objectMax.z - ((objectMax.z - objectMin.z) / 2) };
// deadCameraframes = 30;
//
// minDist = 1000.f;
// maxDist = 0.f;
//
// if (camera::colourMode) {
// free(pixelsColor);
// pixelsColor = new byte[(res * res) * 4];
// }
// else {
// free(pixels);
// pixels = new float[(res * res)];
// }
//
// camera::drawCameraWindow(0.f);
//
// td::Color red{ 1.f, 0.f, 0.f, 1.f };
// td::Color green{ 0.f, 1.f, 0.f, 1.f };
// td::Color blue{ 0.f, 0.f, 1.f, 1.f };
// td::Color white{ 1.f, 1.f, 1.f, 1.f };
//
// RaycastFilter filter{ 0 };
// filter.m_Mask = -1;
// filter.m_RejectTransparent = true;
// filter.m_IgnoredBodies.push_back(camera.body);
//
// glm::quat camera_rotation_bl = *(glm::quat*)(&camera.body->Rotation);
// glm::vec3 raycast_dir_bl = camera_rotation_bl * glm::vec3(1, 0, 0);
// glm::vec3 raycasterUp = camera_rotation_bl * glm::vec3(0, 0, 1);
//
// raycaster::rayData rd = raycaster::castRayManual(centerpoint, { raycast_dir_bl.x, raycast_dir_bl.y, raycast_dir_bl.z }, &filter);
//
// glm::vec3 glCameraPos = glm::vec3(centerpoint.x, centerpoint.y, centerpoint.z);
// glm::vec3 glTarget = glm::vec3(rd.worldPos.x, rd.worldPos.y, rd.worldPos.z);
// glm::mat4x4 vmatrix = glm::lookAt(glCameraPos, glTarget, raycasterUp);
// glm::mat4x4 pmatrix = glm::perspective(50.f, 1.f, 1.f, 150.f);
//
// glm::mat4 invProjMat = glm::inverse(pmatrix);
// glm::mat4 invViewMat = glm::inverse(vmatrix);
//
// for (int y = res; y > 0; y--) {
// for (int x = 0; x < res; x++) {
// float pxSize = (fov / res);
// float comX = (fov / 2.f) - (x * pxSize) + randFloat(-(pxSize / 3.f), (pxSize / 3.f));
// float comY = (fov / 2.f) - (y * pxSize) + randFloat(-(pxSize / 3.f), (pxSize / 3.f));
//
// glm::vec2 ray_nds = glm::vec2(comX, comY);
// glm::vec4 ray_clip = glm::vec4(ray_nds.x, ray_nds.y, -1.0f, 1.0f);
//
// glm::vec4 eyeCoords = invProjMat * ray_clip;
// eyeCoords = glm::vec4(eyeCoords.x, eyeCoords.y, -1.0f, 0.0f);
//
// glm::vec4 rayWorld = invViewMat * eyeCoords;
// glm::vec3 rayDirection = glm::normalize(glm::vec3(rayWorld));
//
// rd = raycaster::castRayManual(centerpoint, { rayDirection.x, rayDirection.y, rayDirection.z }, &filter);
//
// float thisDist = rd.distance;
// if (thisDist < minDist) {
// minDist = thisDist;
// }
// if (thisDist > maxDist && thisDist < 1000.f) {
// maxDist = thisDist;
// }
//
// if (camera::colourMode) {
// if (thisDist >= 1000.f) {
// pixelsColor[pixelOffset] = (byte)(0);
// pixelsColor[pixelOffset + 1] = (byte)(77);
// pixelsColor[pixelOffset + 2] = (byte)(77);
// pixelsColor[pixelOffset + 3] = (byte)(255);
// }
// else {
// int iThisDist = ((int)thisDist) / 2;
//
// int iColourR = ((rd.palette.m_Color.m_R * 255) - iThisDist);
// if (iColourR < 0) { iColourR = 0; }
// int iColourG = ((rd.palette.m_Color.m_G * 255) - iThisDist);
// if (iColourG < 0) { iColourG = 0; }
// int iColourB = ((rd.palette.m_Color.m_B * 255) - iThisDist);
// if (iColourB < 0) { iColourB = 0; }
//
// pixelsColor[pixelOffset] = (byte)iColourR;
// pixelsColor[pixelOffset + 1] = (byte)iColourG;
// pixelsColor[pixelOffset + 2] = (byte)iColourB;
// pixelsColor[pixelOffset + 3] = (byte)(rd.palette.m_Color.m_A * 255);
// }
// pixelOffset += 4;
// }
// else {
// if (thisDist >= 1000.f) {
// pixels[pixelOffset] = -1.f;
//
// }
// else {
// pixels[pixelOffset] = thisDist;
//
// }
// pixelOffset++;
// }
// }
// }
//
// if (camera::colourMode) {
// //camera::updateCameraFrameColor(pixelsColor, res, minDist, maxDist, toolgun::takeSnapshot);
// }
// else {
// //camera::updateCameraFrame(pixels, res, minDist, maxDist, toolgun::takeSnapshot);
// }
// }
//
//}

8
diddlerInternal/Harop.h

@ -1,8 +0,0 @@
//#pragma once
//
//namespace HaropDrone {
// void spawnHarop();
// void destroyHarop();
// void updateHaropCamera();
//
//}

14
diddlerInternal/Jetpack.cpp

@ -1,14 +0,0 @@
#include "Global.h"
#include "Raycaster.h"
#include "objectSpawner.h"
namespace jetpack {
void executeJetpack() {
if ((((GetAsyncKeyState(VK_SPACE) >> 15) & 0x0001) == 0x0001)) {
if (glb::player->velocity.y < 15.f) {
glb::player->velocity.y += 1.f;
}
}
}
}

5
diddlerInternal/Jetpack.h

@ -1,5 +0,0 @@
#pragma once
namespace jetpack {
void executeJetpack();
}

138
diddlerInternal/Lua.cpp

@ -0,0 +1,138 @@
#include "Global.h"
#include "Script.h"
#include "Lua.h"
#include "Lua.hpp"
#include "multiplayer/Main.h"
#include <vector>
void Tick(CScriptCore* pSC, lua_State* L, CRetInfo* ret)
{
TDMP::LuaTick();
}
std::vector<LUA::Callback> callbacks;
void RegisterCallback(CScriptCore* pSC, lua_State* L, CRetInfo* ret)
{
TDMP::Debug::print(L);
int top = lua_gettop(L);
const char* callbackName = luaL_checkstring(L, 1);
if (lua_isfunction(L, 2))
{
LUA::Callback callback;
callback.L = L;
callback.name = callbackName;
callback.ref = luaL_ref(L, LUA_REGISTRYINDEX);
callbacks.push_back(callback);
TDMP::Debug::print("Callback \"" + std::string(callbackName) + "\" was registered");
}
lua_pop(L, top);
}
void CallCallback(CScriptCore* pSC, lua_State* L, CRetInfo* ret)
{
int top = lua_gettop(L);
const char* callbackName = luaL_checkstring(L, 1);
for (size_t i = 0; i < callbacks.size(); i++)
{
if (callbacks[i].name == callbackName)
{
lua_rawgeti(callbacks[i].L, LUA_REGISTRYINDEX, callbacks[i].ref);
lua_pushvalue(callbacks[i].L, 2);
if (lua_pcall(callbacks[i].L, 1, 0, 0))
{
const char* err = lua_tolstring(callbacks[i].L, -1, NULL);
TDMP::Debug::error(err);
lua_pop(callbacks[i].L, 1);
}
lua_pop(callbacks[i].L, lua_gettop(callbacks[i].L));
break;
}
}
lua_pop(L, top);
}
void LUA::RegisterLuaCFunctions(CScriptCore_LuaState* pSCLS)
{
RegisterLuaFunction(pSCLS, "TDMP_Tick", Tick);
RegisterLuaFunction(pSCLS, "TDMP_RegisterCallback", RegisterCallback);
RegisterLuaFunction(pSCLS, "TDMP_CallCallback", CallCallback);
}
void* luaAlloc(void* userData, void* ptr, size_t oldSize, size_t newSize)
{
if (newSize == 0)
{
if (ptr != nullptr)
glb::oTFree((uintptr_t)ptr);
return NULL;
}
else
return glb::oTRealloc(ptr, newSize);
}
void hRegisterGameFunctions(CScriptCore* pSC)
{
void* ud;
lua_Alloc a = lua_getallocf(*pSC->m_SCLuaState.m_LuaState, &ud);
TDMP::Debug::print(a);
lua_setallocf(*pSC->m_SCLuaState.m_LuaState, a, ud);
glb::RegisterGameFunctions(pSC);
TDMP::Debug::print("Registering lua functions");
LUA::RegisterLuaCFunctions(&pSC->m_SCLuaState);
}
int hluaL_loadbuffer(lua_State* L, const char* buff, size_t size, const char* name)
{
return glb::oluaL_loadbuffer(L, buff, size, name);
}
void LUA::HookRegisterGameFunctions()
{
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&)glb::RegisterGameFunctions, hRegisterGameFunctions);
DetourTransactionCommit();
}
int CallLuaFunction(lua_State* L) {
int iRetCount = 0;
LUA::tLuaFunction pFunction = reinterpret_cast<LUA::tLuaFunction>(lua_topointer(L, lua_upvalueindex(1)));
const void* pScriptCore = lua_topointer(L, lua_upvalueindex(2));
pFunction(reinterpret_cast<const CScriptCore*>(pScriptCore), L, &iRetCount);
return iRetCount;
}
void LUA::RegisterLuaFunction(CScriptCore_LuaState* pSCLS, const char* cFunctionName, void* pFunction)
{
TDMP::Debug::print("Registering " + std::string(cFunctionName));
lua_pushlightuserdata(*pSCLS->m_LuaState, pFunction);
lua_pushlightuserdata(*pSCLS->m_LuaState, pSCLS);
lua_pushcclosure(*pSCLS->m_LuaState, CallLuaFunction, 2);
lua_setglobal(*pSCLS->m_LuaState, cFunctionName);
//glb::tdRegisterLuaFunction(pSCLS, cFunctionName, pFunction);
}

19
diddlerInternal/Lua.h

@ -0,0 +1,19 @@
#pragma once
#include "Script.h"
namespace LUA
{
void RegisterLuaCFunctions(CScriptCore_LuaState* pSCLS);
void HookRegisterGameFunctions();
typedef void (*tLuaFunction)(const CScriptCore* pSC, lua_State* L, int* iRetCount);
void RegisterLuaFunction(CScriptCore_LuaState* pSCLS, const char* cFunctionName, void* pFunction);
struct Callback
{
lua_State* L;
const char* name;
int ref;
};
}

5
diddlerInternal/Lua.hpp

@ -0,0 +1,5 @@
extern "C" {
#include "../lua-5.1.4/lua.h"
#include "../lua-5.1.4/lualib.h"
#include "../lua-5.1.4/lauxlib.h"
}

68
diddlerInternal/Mods.cpp

@ -1,68 +0,0 @@
#include "Jetpack.h"
#include "Flamethrower.h"
#include "Global.h"
#include "cutter.h"
#include "objectSpawner.h"
#include "noclip.h"
#include "c4.h"
#include "camera.h"
#include "toolgun.h"
#include "lantern.h"
#include "missileLauncher.h"
#include "physCamera.h"
#include "Harop.h"
#include "objectTranslationTest.h"
#include "balloons.h"
#include "wireObjectKernel.h"
namespace mods {
char jetpackKey = VK_SPACE;
char noclipKey = 0x56;
bool jetpack = false;
bool flamethrower = true;
bool godmode = true;
bool c4_global_detonation = false;
bool removeWalls = false;
bool dontLockWhenOutOfFocus = true;
bool isGameFocused = false;
void execMods() {
spawner::processMostRecentObject();
nToolgun::runToolgun();
wireObjects::updateExistingWireObjects();
wireObjects::highlightTarget();
c4::runC4();
noclip::update();
balloons::updateAllBalloons();
if (jetpack) {
jetpack::executeJetpack();
}
if (removeWalls) {
int count = 0;
if (*(byte*)&(glb::scene->m_Boundaries) != 0x00) {
for (td::Vec2* pt : glb::scene->m_Boundaries) {
count++;
}
mem::Null((byte*)&(glb::scene->m_Boundaries), 8 * count);
}
}
physCamera::updateCamera();
//HaropDrone::updateHaropCamera();
objectTesting::updateDebugObject();
//camera::quatCameraOutline();
//if (flamethrower) {
// flamethrower::execFlamethrower();
//}
//spawner::handleSpawnerWeapon();
//camera::runCamera();
}
}

19
diddlerInternal/Mods.h

@ -1,19 +0,0 @@
#pragma once
#include "Jetpack.h"
#include "godmode.h"
#include "objectSpawner.h"
namespace mods {
extern char jetpackKey;
extern char noclipKey;
extern bool jetpack;
extern bool flamethrower;
extern bool godmode;
extern bool c4_global_detonation;
extern bool removeWalls;
extern bool dontLockWhenOutOfFocus;
extern bool isGameFocused;
void execMods();
}

57
diddlerInternal/Script.h

@ -0,0 +1,57 @@
#pragma once
#include "types.h"
struct lua_State;
class CRetInfo
{
public:
lua_State* L;
int retCount;
int maxRet;
};
class CScriptCore_LuaState
{
public:
char pad_0000[56]; //0x0000
lua_State** m_LuaState;
};
class CScriptCore
{
public:
float m_RunTime;
float m_UpdateTimeStep;
td::small_string m_ScriptPath;
td::small_string m_ScriptLocation;
CScriptCore_LuaState m_SCLuaState;
bool m_HasCallbacks;
bool m_HasInit;
bool m_HasTick;
bool m_HasUpdate;
bool m_HasDraw;
char pad_0075[3];
float m_TickProcessed;
float m_UpdateProcessed;
char pad_0080[3032];
virtual void Destroy(CScriptCore* pScriptCore, bool freeMemory);
virtual void RegisterGameFunctions(CScriptCore* pScriptCore);
virtual void LoadScript(CScriptCore* pScriptCore, td::small_string* ssScriptPath);
virtual void Function3();
virtual void Init(CScriptCore* pScriptCore);
virtual void Tick(CScriptCore* pScriptCore, float fTimeStep, void* pUnknown);
virtual void Update(CScriptCore* pScriptCore, float fTimeStep);
virtual void Function7();
virtual void Function8();
};
class Script : public Entity
{
public:
char* m_ScriptName; //0x0028
char pad_0030[8]; //0x0030
CScriptCore m_ScriptCore; //0x0038
}; //Size: 0xBE0

416
diddlerInternal/TDFuncs.cpp

@ -1,82 +1,59 @@
#include "TDFuncs.h"
#include "Global.h"
#include "global.h"
void printIntegPercentage(float p) {
int cCode = 10;
if (p < 100.f) {
cCode = 14;
}
if (p < 75.f) {
cCode = 12;
}
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, cCode);
printf_s(" (%0.1f%%)\n", p);
SetConsoleTextAttribute(hConsole, 15);
}
void sigscanItems() {
glb::oPaint = (tPaint)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x55\x41\x55\x41\x56\x48\x8D\x68\xD8\x48\x81\xEC\x00\x00\x00\x00\x48\xC7\x45\x00\x00\x00\x00\x00", "xxxxxxxxxxxxxxx????xxx?????", GetModuleHandle(NULL));
glb::oFDL = (frameDrawLine)mem::FindPattern((PBYTE)"\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x10\x48\x89\x74\x24\x18\x57\x41\x56\x41\x57\x48\x83\xEC\x20\x44\x8B\xB9\x10\x89\x00\x00\x48", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oRC = (rayCast)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x4C\x89\x40\x18\x48\x89\x50\x10\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xA8\x18\xF4\xFF\xFF\x48\x81\xEC", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::TDcreateExplosion = (createExplosion)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x55\x41\x56\x41\x57\x48\x8D\xA8\x18\xFE\xFF\xFF\x48\x81\xEC\xD0\x02\x00\x00\x48\xC7\x45\x18\xFE\xFF\xFF\xFF\x48\x89", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oSpawnVox = (tSpawnVox)mem::FindPattern((PBYTE)"\x4C\x8B\xDC\x57\x48\x81\xEC\xF0\x00\x00\x00\x48\xC7\x44\x24\x60", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oTdDelBdy = (deleteBody)mem::FindPattern((PBYTE)"\x48\x83\xEC\x28\x48\x8B\xCA\x33\xD2\xE8\x82\x16\x0F\x00\x48\x8B", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oMakeHole = (makeHole)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x53\x48\x81\xEC\x90\x00\x00\x00\x0F\x29\x70\xE8\x4C\x8D\x40\xA8\x48\x8B\xDA\x0F\x29\x78\xD8\x44\x0F\x29\x40\xC8\x48", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oCreateTexture = (CreateTexture)mem::FindPattern((PBYTE)"\x48\x89\x4C\x24\x08\x57\x41\x54\x41\x55\x41\x57", "xxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oCreatePhysics = (CreatePhysics)mem::FindPattern((PBYTE)"\x40\x53\x48\x81\xEC\x50\x04\x00\x00\x48\x8B\xD9\xE8\x7F\x5C\x00\x00\x48\x8B\x4B\x18\xC7\x43\x5C\x00\x00\x00\x00\xE8\x0F\x87\x06", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oUpdateShapes = (UpdateShapes)mem::FindPattern((PBYTE)"\x40\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xAC\x24\x10\xEB\xFF\xFF\xB8\xF0\x15\x00\x00\xE8\x54\x91\x25\x00\x48\x2B\xE0\x48", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oB_Constructor = (B_Constructor)mem::FindPattern((PBYTE)"\x40\x53\x48\x83\xEC\x20\x4C\x8B\xC2\x48\x8B\xD9\xBA\x01\x00\x00\x00", "xxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oS_Constructor = (S_Constructor)mem::FindPattern((PBYTE)"\x40\x53\x48\x83\xEC\x20\x4C\x8B\xC2\x48\x8B\xD9\xBA\x02\x00\x00\x00", "xxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oSetDynamic = (SetDynamic)mem::FindPattern((PBYTE)"\x88\x91\xDC\x00\x00\x00\x4C\x8B\xC1\x84\xD2\x74\x29\x0F\xB6\x81\xE4\x00\x00\x00\xC6\x81\xE4\x00\x00\x00\x3C\x84\xC0\x75\x17\x48", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oTMalloc = (TMalloc)mem::FindPattern((PBYTE)"\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\x48\x83\xF9\xE0\x77\x3C\x48\x85\xC9\xB8\x2A\x2A\x2A\x2A\x48\x0F\x44\xD8\xEB\x15\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x25\x48\x8B\xCB\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x19\x48\x8B\x0D\x2A\x2A\x2A\x2A\x4C\x8B\xC3\x33\xD2\xFF\x15\x2A\x2A\x2A\x2A\x48\x85\xC0\x74\xD4\xEB\x0D\xE8\x2A\x2A\x2A\x2A\xC7\x00\x2A\x2A\x2A\x2A\x33\xC0\x48\x83\xC4\x20\x5B\xC3", "xxxxxxxxxxxxxxxxxxx????xxxxxxx????xxxxxxxx????xxxxxxx????xxxxxxx????xxxxxxxx????xx????xxxxxxxx", GetModuleHandle(NULL));
glb::oTFree = (TFree)mem::FindPattern((PBYTE)"\x48\x85\xC9\x74\x37\x53\x48\x83\xEC\x20\x4C\x8B\xC1\x33\xD2\x48\x8B\x0D\x2A\x2A\x2A\x2A\xFF\x15\x2A\x2A\x2A\x2A\x85\xC0\x75\x17\xE8\x2A\x2A\x2A\x2A\x48\x8B\xD8\xFF\x15\x2A\x2A\x2A\x2A\x8B\xC8\xE8\x2A\x2A\x2A\x2A", "xxxxxxxxxxxxxxxxxx????xx????xxxxx????xxxxx????xxx????", GetModuleHandle(NULL));
glb::oSpawnFire = (spawnFire)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x55\x48\x8D\x68\xB8\x48\x81\xEC\x40\x01\x00\x00\x48\xC7\x45\x20\xFE\xFF\xFF\xFF\x48\x89\x58\x08\x48\x89\x70\x10\x48", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL)); //td.exe+B94C0
glb::oPewpew = (createProjectile)mem::FindPattern((PBYTE)"\x48\x89\x5C\x24\x08\x57\x48\x81\xEC\x80\x00\x00\x00", "xxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::TDspawnParticle = (spawnParticle)mem::FindPattern((PBYTE)"\x48\x89\x5C\x24\x08\x48\x89\x6C\x24\x10\x48\x89\x74\x24\x18\x57\x48\x83\xEC\x20\x48\x8D\x99\x80\x00\x00\x00\x49\x8B\xF1\x81\x3B", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oDamagePlayer = (damagePlayer)mem::FindPattern((PBYTE)"\x40\x53\x48\x83\xEC\x40\x0F\x29\x74\x24\x30\x48\x8B\xD9\x0F\x29", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oMAL = (modApiLinker)mem::FindPattern((PBYTE)"\x40\x55\x48\x8D\xAC\x24\x80\xFA\xFF\xFF\x48\x81\xEC\x80\x06\x00", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oDamageObject = (damageObject)mem::FindPattern((PBYTE)"\x48\x81\xEC\xC8\x00\x00\x00\x48\xC7\x44\x24\x48\xFE\xFF\xFF\xFF\x48\x8D\x44\x24\x60\x48\x89\x44\x24\x58\xC7\x44\x24\x54\x04\x00", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oCamPos = (cameraPositioning)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x55\x48\x8D\x6C\x24\x80\x48\x81\xEC\x80\x01\x00\x00\x48\xC7\x45\x10\xFE\xFF\xFF\xFF\x48\x89\x58\x08\x48\x89\x70\x18", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oTDmain = (tdMain)mem::FindPattern((PBYTE)"\xE8\x00\x00\x00\x00\x48\x8D\x4D\xA7\xE8\x00\x00\x00\x00\xEB\x1D", "x????xxxxx????xx", GetModuleHandle(NULL));
glb::oCreateLight = (createLight)mem::FindPattern((PBYTE)"\x48\x83\xEC\x58\x48\x8B\x05\x95\x25\x3F\x00\x80\xB8\x10\x01\x00\x00\x00\x0F\x85\xA6\x00\x00\x00\xF2\x0F\x10\x02\x8B\x42\x08\xF3", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oEnvUpdate = (environmentUpdate)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x55\x53\x56\x57\x41\x56\x48\x8D\xA8\x38\xFE\xFF\xFF\x48\x81\xEC\xA0\x02\x00\x00\x48\xC7\x45\x80\xFE\xFF\xFF\xFF\x0F", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oSpreadFire = (spreadFire)mem::FindPattern((PBYTE)"\x48\x8B\xC4\xF3\x0F\x11\x48\x10\x48\x89\x48\x08\x55\x53\x56\x57", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oSOA = (SetObjectAttribute)mem::FindPattern((PBYTE)"\x4C\x89\x44\x24\x18\x57\x41\x56\x41\x57\x48\x83\xEC\x30\x48\xC7", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oHighlightShape = (highlightShape)mem::FindPattern((PBYTE)"\x48\x83\xEC\x48\x48\x8B\x05\x65\x68\x3F\x00\x0F\x29\x74\x24\x30\x0F\x28\xF2\x80\xB8\x18\x04\x00\x00\x00\x75\x20\x48\x89\x54\x24", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oOutlineShape = (outlineShape)mem::FindPattern((PBYTE)"\x40\x53\x48\x83\xEC\x40\x48\x8B\x05\x13\x68\x3F\x00\x49\x8B\xD8", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oOutlineBody = (outlineBody)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x57\x48\x81\xEC\x00\x01\x00\x00\x48\xC7\x44\x24\x30\xFE\xFF\xFF\xFF\x48\x89\x58\x08\x0F\x29\x70\xE8\x0F\x29\x78\xD8", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::plankPatchFunction = (uintptr_t)mem::FindPattern((PBYTE)"\x40\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xAC\x24\x50\xCF\xFF\xFF\xB8\xB0\x31\x00\x00\xE8\xF2\xE8\x19\x00\x48\x2B", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oQuatEul = (apiQuatEuler)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x48\x89\x58\x08\x57\x48\x81\xEC\x80\x00\x00\x00\x0F\x29\x70\xE8\x48\x8B\xDA\xF3\x0F\x10\x72\x04\x48\x8B\xF9\x0F\x29", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oSetBody = (setBodySomething)mem::FindPattern((PBYTE)"\x48\x89\x5C\x24\x08\x48\x89\x74\x24\x10\x57\x48\x83\xEC\x20\x48\x8B\x59\x20\x41\x0F\xB6\xF8\x0F\xB6\xF2\x48\x85\xDB\x74\x20\x90", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oWrappedDamage = (wrappedDoDamage)mem::FindPattern((PBYTE)"\x48\x83\xEC\x48\x48\x8B\x44\x24\x78\x4C\x8B\xC2\xF3\x0F\x10\x44", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oSOAS = (SetObjectAttributeSingle)mem::FindPattern((PBYTE)"\x40\x57\x41\x57\x48\x83\xEC\x58\xF6\x41\x09\x01\x4C\x8B\xFA\x48\x8B\xF9\x0F\x84\x21\x01\x00\x00\x48\x89\x5C\x24\x70\x48\x8D\x15", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oHandleBombObjs = (handleBombObjs)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x55\x57\x41\x56\x48\x8D\xA8\x18\xFF\xFF\xFF\x48\x81", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oSetShapeParentBody = (setShapeParentBody)mem::FindPattern((PBYTE)"\x40\x53\x48\x83\xEC\x20\x48\x8D\x05\x93\x51\x24\x00\x88\x51\x08", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oAddCItem = (addContextItem)mem::FindPattern((PBYTE)"\x44\x89\x44\x24\x18\x88\x54\x24\x10\x55\x56\x57\x41\x56\x48\x8D\x6C\x24\xF8\x48\x81\xEC\x08\x01\x00\x00\x4C\x8B\x15\x5F\xE5\x3B", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::TDreadSubobjects = (ReadSubobjectsFromVox)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x55\x57\x41\x56\x48\x8D\x68\xA1\x48\x81\xEC\xB0\x00\x00\x00\x48\xC7\x45\x3F\xFE\xFF\xFF\xFF\x48\x89\x58\x10\x48\x89", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oIUnReadVox = (unknReadVoxData)mem::FindPattern((PBYTE)"\x48\x89\x4C\x24\x08\x55\x53\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xAC\x24\x88\xD9\xFF\xFF\xB8\x78\x27\x00\x00\xE8\x6D", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oIsActive = (isActiveWindow)mem::FindPattern((PBYTE)"\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\xFF\x15\x11\xFF\x1C\x00\x48", "xxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oLtDBin = (loadTDBIN)mem::FindPattern((PBYTE)"\x48\x8B\xC4\x55\x48\x8D\xA8\x58\xFF\xFF\xFF\x48\x81\xEC\xA0\x01\x00\x00\x48\xC7\x44\x24\x68\xFE\xFF\xFF\xFF\x48\x89\x58\x08\x48", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::o_S140152540 = (S140152540)mem::FindPattern((PBYTE)"\x48\x89\x4C\x24\x08\x57\x48\x83\xEC\x30\x48\xC7\x44\x24\x20\xFE\xFF\xFF\xFF\x48\x89\x5C\x24\x48\x48\x89\x6C\x24\x50\x48\x89\x74\x24\x58\x41\x8B\xF0\x48\x8B\xEA\x48\x8B\xD9\xBA\x01\x00\x00\x00", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::o_S1400C4F70 = (S1400C4F70)mem::FindPattern((PBYTE)"\x40\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\x6C\x24\xD9\x48\x81\xEC\xB0\x00\x00\x00\x48\xC7\x45\x1F\xFE\xFF\xFF\xFF", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::o_S140152740 = (S140152740)mem::FindPattern((PBYTE)"\x40\x57\x48\x83\xEC\x30\x48\xC7\x44\x24\x20\xFE\xFF\xFF\xFF\x48\x89\x5C\x24\x40\x48\x8B\xF9\x48\x8D\x05\x92\xFD\x1F\x00\x48\x89", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oValidate = (validateFileExistance)mem::FindPattern((PBYTE)"\x40\x57\x48\x83\xEC\x60\x48\xC7\x44\x24\x28\xFE\xFF\xFF\xFF\x48\x89\x5C\x24\x70\x49\x8B\xF8\x48\x8B\xDA\xC7\x44\x24\x20\x00\x00\x00\x00\x48\x8D\x4C\x24\x50\xE8\xF4\xFA\x02\x00\x90\x48\x8B\xD0", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oDoQuicksave = (doQuicksave)mem::FindPattern((PBYTE)"\x40\x53\x48\x81\xEC\x90\x00\x00\x00\x48\xC7\x44\x24\x20\xFE\xFF\xFF\xFF\x48\x8B\xD9\x48\x8B\x0D\xE4\xB3\x36\x00\x48\x8B\x89\xA0", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", GetModuleHandle(NULL));
glb::oDoQuickload = (doQuickload)mem::FindPattern(