mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-02-14 04:03:36 +00:00
Merge Bahke's Changes into the repository for him regarding mech control implementations for ProjectR3
This commit is contained in:
parent
8bc2e1c574
commit
ee3488fa4d
28 changed files with 189 additions and 8 deletions
2
CommonAPI/Common/Debug/Common.lastbuildstate
Normal file
2
CommonAPI/Common/Debug/Common.lastbuildstate
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#v4.0:v100
|
||||
Debug|Win32|C:\t2cpp\T2-CPP-master\|
|
||||
0
CommonAPI/Common/Debug/Common.unsuccessfulbuild
Normal file
0
CommonAPI/Common/Debug/Common.unsuccessfulbuild
Normal file
BIN
CommonAPI/Common/Debug/vc100.idb
Normal file
BIN
CommonAPI/Common/Debug/vc100.idb
Normal file
Binary file not shown.
2
CommonAPI/Common/Release/Common.lastbuildstate
Normal file
2
CommonAPI/Common/Release/Common.lastbuildstate
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#v4.0:v100
|
||||
Release|Win32|C:\t2cpp\T2-CPP-master\|
|
||||
|
|
@ -42,6 +42,9 @@ namespace DX
|
|||
|
||||
bool GetRelativePath(const char *filename, char *ret, int buffer_length);
|
||||
bool GetRunningMod(char *ret, int buffer_length);
|
||||
|
||||
bool memPatch(unsigned int addr, unsigned char * data, unsigned int size);
|
||||
bool memToHex(unsigned int addr, char * dst, int size, bool spaces);
|
||||
unsigned int memToUInt(unsigned int addr);
|
||||
float memToFloat(unsigned int addr);
|
||||
bool SanitizeFileName(char *ret, int buffer_length);
|
||||
} // End NameSpace DX
|
||||
|
|
@ -20,6 +20,8 @@ namespace DX
|
|||
const bool &is_jetting;
|
||||
//! Player Object Jumping State (readonly, writing it doesn't do anything)
|
||||
const bool &is_jumping;
|
||||
float &headRotationZ;
|
||||
float &mRotZ;
|
||||
//! Player Object Using Toggable Pack
|
||||
bool &is_using_toggledpack;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,12 +14,58 @@
|
|||
|
||||
#include <DXAPI/Point3F.h>
|
||||
#include <DXAPI/DXAPI.h>
|
||||
|
||||
#include <Windows.h>
|
||||
#include <LinkerAPI.h>
|
||||
|
||||
namespace DX
|
||||
{
|
||||
|
||||
bool memPatch(unsigned int addr, unsigned char * data, unsigned int size){
|
||||
DWORD oldprotect=0;
|
||||
DWORD oldnewprotect=0;
|
||||
VirtualProtect((void *)addr,size,PAGE_EXECUTE_READWRITE,&oldprotect);
|
||||
memcpy((void *)addr,(void*) data,size);
|
||||
VirtualProtect((void *)addr,size,oldprotect,&oldnewprotect);
|
||||
return true;
|
||||
}
|
||||
float memToFloat(unsigned int addr){
|
||||
DWORD oldprotect=0;
|
||||
DWORD oldnewprotect=0;
|
||||
VirtualProtect((void *)addr,4,PAGE_EXECUTE_READWRITE,&oldprotect);
|
||||
float * floatout=(float *)addr;
|
||||
float retfloat=0.0;
|
||||
retfloat = *floatout;
|
||||
VirtualProtect((void *)addr,4,oldprotect,&oldnewprotect);
|
||||
return true;
|
||||
}
|
||||
unsigned int memToUInt(unsigned int addr){
|
||||
DWORD oldprotect=0;
|
||||
DWORD oldnewprotect=0;
|
||||
VirtualProtect((void *)addr,4,PAGE_EXECUTE_READWRITE,&oldprotect);
|
||||
unsigned int * intout=(unsigned int *)addr;
|
||||
int retint=0;
|
||||
retint = *intout;
|
||||
VirtualProtect((void *)addr,4,oldprotect,&oldnewprotect);
|
||||
return true;
|
||||
}
|
||||
bool memToHex(unsigned int addr, char * dst, int size, bool spaces=false){
|
||||
DWORD oldprotect=0;
|
||||
DWORD oldnewprotect=0;
|
||||
char hexdigits[20]="";
|
||||
char outstr[256];
|
||||
VirtualProtect((void *)addr,size,PAGE_EXECUTE_READWRITE,&oldprotect);
|
||||
for (int i=0; i<size; i++) {
|
||||
if (spaces==true) {
|
||||
sprintf(hexdigits,"%02X ",*((unsigned char*)addr+i));
|
||||
} else {
|
||||
sprintf(hexdigits,"%02X",*((unsigned char*)addr+i));
|
||||
}
|
||||
strncat(outstr,hexdigits,254-strlen(hexdigits));
|
||||
|
||||
}
|
||||
VirtualProtect((void *)addr,size,oldprotect,&oldnewprotect);
|
||||
strncpy(dst,outstr,255);
|
||||
return true;
|
||||
}
|
||||
const char *GetModPaths(void)
|
||||
{
|
||||
int pointer = *(int*)0x9E8690;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ namespace DX
|
|||
name(0x00), id(*(unsigned int*)(obj + 32)),
|
||||
is_jetting(*(bool*)(obj + 735)),
|
||||
is_jumping(*(bool*)(obj + 734)),
|
||||
headRotationZ(*(float*)(obj + 2376)),
|
||||
mRotZ(*(float*)(obj + 2388)),
|
||||
is_using_toggledpack(*(bool*)(obj + 1172)),
|
||||
velocity(*(float*)(obj + 2392), *(float*)(obj + 2396), *(float*)(obj + 2400))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue