Store for temporary modification.

Signed-off-by: Michael Fabian Dirks <michael.dirks@realitybends.de>
This commit is contained in:
Michael Fabian Dirks
2015-05-10 23:34:51 +02:00
parent b641313a75
commit c909aeb102
29 changed files with 2891 additions and 1951 deletions
+4
View File
@@ -0,0 +1,4 @@
/Build
/Intermediate
*.sdf
*.opensdf
Binary file not shown.
View File
+180
View File
@@ -0,0 +1,180 @@
// Original Code by Noodoby<http://www.blitzforum.de/forum/viewtopic.php?t=31651>
// Modified Code by Xaymar<http://project-kube.de>
#include "BlitzPointer.h"
DLL_EXPORT uint32_t BlitzPointer_GetReturnAddress() {
unsigned int StackPointer, ReturnAddress;
__asm { //ASM. Do touch if suicidal.
mov StackPointer, esp // Store current Stack Pointer
mov esp, ebp // On X86, EBP[0] is our own function and EBP[1] is the return address.
add esp, 4 // Which means that we can just take it from there into our own variable.
pop ReturnAddress // Just like this.
mov esp, [StackPointer] // And then reset the Stack Pointer.
}
return ReturnAddress;
}
DLL_EXPORT uint32_t BlitzPointer_GetFunctionPointer() {
unsigned int StackPointer, ReturnAddress;
__asm { //ASM. Do touch if suicidal.
mov StackPointer, esp // Store current Stack Pointer
mov esp, ebp // On X86, EBP[0] is our own function and EBP[1] is the return address.
add esp, 4 // Which means that we can just take it from there into our own variable.
pop ReturnAddress // Just like this.
mov esp, [StackPointer] // And then reset the Stack Pointer.
}
// let's look backwards in memory for the function signature (0x53 0x56 0x57 0x55 0x89 0xE5) for at most one megabyte.
uint8_t* startPtr = (uint8_t*)ReturnAddress;
uint8_t* endPtr = (uint8_t*)(ReturnAddress - 1048576);
for (uint8_t* curPtr = startPtr; curPtr != endPtr; curPtr--) {
if (*(curPtr) == 0x53) // push ebx
if (*(curPtr + 1) == 0x56) // push esi
if (*(curPtr + 2) == 0x57) // push edi
if (*(curPtr + 3) == 0x55) // push ebp
if (*(curPtr + 4) == 0x89 && *(curPtr + 5) == 0xE5) // mov ebp,esp
return (uint32_t)curPtr;
}
return 0;
}
uint32_t __declspec(naked) BlitzPointer_CallFunction() {
__asm {
jmp eax
}
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction0(uint32_t fpFunctionPointer) {
uint32_t returnvalue;
__asm {
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction1(uint32_t fpFunctionPointer, uint32_t p1) {
uint32_t returnvalue;
__asm {
sub esp, 0x4;
mov eax, [p1];
mov[esp], eax;
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction2(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2) {
uint32_t returnvalue;
__asm {
sub esp, 0x8
mov eax, [p2];
mov[esp + 4], eax;
mov eax, [p1];
mov[esp], eax;
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction3(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3) {
uint32_t returnvalue;
__asm {
sub esp, 0xC;
mov eax, [p3];
mov[esp + 8], eax;
mov eax, [p2];
mov[esp + 4], eax;
mov eax, [p1];
mov[esp], eax;
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction4(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) {
uint32_t returnvalue;
__asm {
sub esp, 0x10;
mov eax, [p4];
mov[esp + 12], eax;
mov eax, [p3];
mov[esp + 8], eax;
mov eax, [p2];
mov[esp + 4], eax;
mov eax, [p1];
mov[esp], eax;
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS0(uint32_t fpFunctionPointer) {
uint32_t returnvalue;
__asm {
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return *((uint32_t*)(returnvalue + 4));
}
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS1(uint32_t fpFunctionPointer, uint32_t p1) {
uint32_t returnvalue;
__asm {
sub esp, 0x4;
mov eax, [p1];
mov[esp], eax;
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return *((uint32_t*)(returnvalue + 4));
}
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS2(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2) {
uint32_t returnvalue;
__asm {
sub esp, 0x8;
mov eax, [p2];
mov[esp + 4], eax;
mov eax, [p1];
mov[esp], eax;
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return *((uint32_t*)(returnvalue + 4));
}
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS3(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3) {
uint32_t returnvalue;
__asm {
sub esp, 0xC;
mov eax, [p3];
mov[esp + 8], eax;
mov eax, [p2];
mov[esp + 4], eax;
mov eax, [p1];
mov[esp], eax;
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return *((uint32_t*)(returnvalue + 4));
}
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS4(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) {
uint32_t returnvalue;
__asm {
sub esp, 0x10;
mov eax, [p4];
mov[esp + 12], eax;
mov eax, [p3];
mov[esp + 8], eax;
mov eax, [p2];
mov[esp + 4], eax;
mov eax, [p1];
mov[esp], eax;
call dword ptr[fpFunctionPointer];
mov[returnvalue], eax;
}
return *((uint32_t*)(returnvalue + 4));
}
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
#include "dllmain.h"
DLL_EXPORT uint32_t BlitzPointer_GetReturnAddress();
DLL_EXPORT uint32_t BlitzPointer_GetFunctionPointer();
DLL_EXPORT uint32_t BlitzPointer_CallFunction0(uint32_t fpFunctionPointer);
DLL_EXPORT uint32_t BlitzPointer_CallFunction1(uint32_t fpFunctionPointer, uint32_t p1);
DLL_EXPORT uint32_t BlitzPointer_CallFunction2(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2);
DLL_EXPORT uint32_t BlitzPointer_CallFunction3(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3);
DLL_EXPORT uint32_t BlitzPointer_CallFunction4(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4);
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS0(uint32_t fpFunctionPointer);
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS1(uint32_t fpFunctionPointer, uint32_t p1);
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS2(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2);
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS3(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3);
DLL_EXPORT uint32_t BlitzPointer_CallFunctionS4(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4);
+28 -14
View File
@@ -57,21 +57,22 @@
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir);$(ProjectDir)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>false</FunctionLevelLinking>
<FunctionLevelLinking>true</FunctionLevelLinking>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<FloatingPointExceptions>
</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<CreateHotpatchableImage>true</CreateHotpatchableImage>
<RuntimeTypeInfo>
</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<ForcedIncludeFiles>dllmain.h</ForcedIncludeFiles>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -84,12 +85,12 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
<FunctionLevelLinking>false</FunctionLevelLinking>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir);$(ProjectDir)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -97,13 +98,14 @@
<CompileAsWinRT>false</CompileAsWinRT>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<FloatingPointExceptions>
</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<CreateHotpatchableImage>true</CreateHotpatchableImage>
<RuntimeTypeInfo>
</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<ForcedIncludeFiles>dllmain.h</ForcedIncludeFiles>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<MinimalRebuild>true</MinimalRebuild>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
@@ -115,11 +117,23 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="BlitzPointer.cpp" />
<ClCompile Include="dllmain.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="BlitzPointer.h" />
<ClInclude Include="dllmain.h" />
</ItemGroup>
<ItemGroup>
<None Include="BlitzPointer.bb">
<Link>BlitzPointer.bb</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="BlitzPointer.decls">
<Link>BlitzPointer.decls</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
+17
View File
@@ -5,15 +5,32 @@
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Blitz Files">
<UniqueIdentifier>{53eae672-7e3f-4de4-af1f-79e46e407a39}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BlitzPointer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="dllmain.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="BlitzPointer.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="BlitzPointer.decls">
<Filter>Blitz Files</Filter>
</None>
<None Include="BlitzPointer.bb">
<Filter>Blitz Files</Filter>
</None>
</ItemGroup>
</Project>
-109
View File
@@ -1,109 +0,0 @@
// Original Code by Noodoby<http://www.blitzforum.de/forum/viewtopic.php?t=31651>
// Modified Code by Xaymar<http://project-kube.de>
#include "BlitzPointer.h"
DLL_EXPORT uint32_t BlitzPointer_GetReturnAddress() {
unsigned int StackPointer, ReturnAddress;
__asm { //ASM. Do touch if suicidal.
mov StackPointer, esp // Store current Stack Pointer
mov esp, ebp // On X86, EBP[0] is our own function and EBP[1] is the return address.
add esp, 4 // Which means that we can just take it from there into our own variable.
pop ReturnAddress // Just like this.
mov esp, [StackPointer] // And then reset the Stack Pointer.
}
return ReturnAddress;
}
DLL_EXPORT uint32_t BlitzPointer_GetFunctionPointer() {
unsigned int StackPointer, ReturnAddress;
__asm { //ASM. Do touch if suicidal.
mov StackPointer, esp // Store current Stack Pointer
mov esp, ebp // On X86, EBP[0] is our own function and EBP[1] is the return address.
add esp, 4 // Which means that we can just take it from there into our own variable.
pop ReturnAddress // Just like this.
mov esp, [StackPointer] // And then reset the Stack Pointer.
}
// let's look backwards in memory for the function signature (0x53 0x56 0x57 0x55 0x89 0xE5) for at most one megabyte.
uint8_t* startPtr = (uint8_t*)ReturnAddress;
uint8_t* endPtr = (uint8_t*)(ReturnAddress - 1048576);
for (uint8_t* curPtr = startPtr; curPtr != endPtr; curPtr--) {
if (*(curPtr) == 0x53) // push ebx
if (*(curPtr+1) == 0x56) // push esi
if (*(curPtr+2) == 0x57) // push edi
if (*(curPtr+3) == 0x55) // push ebp
if (*(curPtr + 4) == 0x89 && *(curPtr +5) == 0xE5) // mov ebp,esp
return (uint32_t)curPtr;
}
return 0;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction0(uint32_t fpFunctionPointer) {
uint32_t returnvalue;
__asm {
call dword ptr[fpFunctionPointer]
mov[returnvalue], eax
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction1(uint32_t fpFunctionPointer, uint32_t p1) {
uint32_t returnvalue;
__asm {
sub esp, 0x4
mov eax, [p1]
mov[esp], eax
call dword ptr[fpFunctionPointer]
mov[returnvalue], eax
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction2(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2) {
uint32_t returnvalue;
__asm {
sub esp, 0x8
mov eax, [p2]
mov[esp+4], eax
mov eax, [p1]
mov[esp], eax
call dword ptr[fpFunctionPointer]
mov[returnvalue], eax
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction3(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3) {
uint32_t returnvalue;
__asm {
sub esp, 0xC
mov eax, [p3]
mov[esp + 8], eax
mov eax, [p2]
mov[esp + 4], eax
mov eax, [p1]
mov[esp], eax
call dword ptr[fpFunctionPointer]
mov[returnvalue], eax
}
return returnvalue;
}
DLL_EXPORT uint32_t BlitzPointer_CallFunction4(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4) {
uint32_t returnvalue;
__asm {
sub esp, 0x10
mov eax, [p4]
mov[esp + 12], eax
mov eax, [p3]
mov[esp + 8], eax
mov eax, [p2]
mov[esp + 4], eax
mov eax, [p1]
mov[esp], eax
call dword ptr[fpFunctionPointer]
mov[returnvalue], eax
}
return returnvalue;
}
-9
View File
@@ -1,9 +0,0 @@
#include "dllmain.h"
DLL_EXPORT uint32_t BlitzPointer_GetReturnAddress();
DLL_EXPORT uint32_t BlitzPointer_GetFunctionPointer();
DLL_EXPORT uint32_t BlitzPointer_CallFunction0(uint32_t fpFunctionPointer);
DLL_EXPORT uint32_t BlitzPointer_CallFunction1(uint32_t fpFunctionPointer, uint32_t p1);
DLL_EXPORT uint32_t BlitzPointer_CallFunction2(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2);
DLL_EXPORT uint32_t BlitzPointer_CallFunction3(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3);
DLL_EXPORT uint32_t BlitzPointer_CallFunction4(uint32_t fpFunctionPointer, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4);
+5
View File
@@ -0,0 +1,5 @@
#include "BlitzPointer.h"
uint32_t BlitzPointer_CallFunction0(uint32_t fpFunctionPointer) {
}
File diff suppressed because it is too large Load Diff
+22 -20
View File
@@ -62,21 +62,22 @@
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>$(SolutionDir);$(ProjectDir);D:\Projects\Cpp\#Libraries\Steamworks SDK\public</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<BufferSecurityCheck>false</BufferSecurityCheck>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<FunctionLevelLinking>false</FunctionLevelLinking>
<FloatingPointExceptions>
</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<FunctionLevelLinking>true</FunctionLevelLinking>
<CreateHotpatchableImage>true</CreateHotpatchableImage>
<RuntimeTypeInfo>
</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<ForcedIncludeFiles>dllmain.h</ForcedIncludeFiles>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -95,7 +96,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
<FunctionLevelLinking>false</FunctionLevelLinking>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
@@ -108,14 +109,15 @@
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<FloatingPointExceptions>
</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<CreateHotpatchableImage>true</CreateHotpatchableImage>
<RuntimeTypeInfo>
</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<ForcedIncludeFiles>dllmain.h</ForcedIncludeFiles>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<MinimalRebuild>true</MinimalRebuild>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
@@ -130,15 +132,15 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="BlitzPointer.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="Steam.cpp" />
<ClCompile Include="SteamClient.cpp" />
<ClCompile Include="SteamUser.cpp" />
<ClCompile Include="Libraries\BlitzPointer.cpp" />
<ClCompile Include="Wrapper\Steam.cpp" />
<ClCompile Include="Wrapper\SteamClient.cpp" />
<ClCompile Include="Wrapper\SteamUser.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="BlitzPointer.h" />
<ClInclude Include="dllmain.h" />
<ClInclude Include="Libraries\BlitzPointer.h" />
</ItemGroup>
<ItemGroup>
<None Include="BlitzSteam.bb">
+26 -19
View File
@@ -1,44 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source">
<UniqueIdentifier>{5016ba8f-d781-40f4-9904-56cc2ce9a588}</UniqueIdentifier>
<Filter Include="Blitz Files">
<UniqueIdentifier>{3072c53c-2be5-4712-b853-1bc1438cdc6e}</UniqueIdentifier>
</Filter>
<Filter Include="Source\Wrapper">
<Filter Include="Source Files">
<UniqueIdentifier>{5016ba8f-d781-40f4-9904-56cc2ce9a588}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Source Files\Wrapper">
<UniqueIdentifier>{8f00e86e-e1bc-499e-8b2c-da93e9e8f287}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Libraries">
<UniqueIdentifier>{1b813d7f-3558-4f10-b237-1bcf7d5f0b60}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>Source</Filter>
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Steam.cpp">
<Filter>Source</Filter>
<ClCompile Include="Wrapper\Steam.cpp">
<Filter>Source Files\Wrapper</Filter>
</ClCompile>
<ClCompile Include="SteamClient.cpp">
<Filter>Source</Filter>
<ClCompile Include="Wrapper\SteamClient.cpp">
<Filter>Source Files\Wrapper</Filter>
</ClCompile>
<ClCompile Include="SteamUser.cpp">
<Filter>Source</Filter>
<ClCompile Include="Wrapper\SteamUser.cpp">
<Filter>Source Files\Wrapper</Filter>
</ClCompile>
<ClCompile Include="BlitzPointer.cpp">
<Filter>Source</Filter>
<ClCompile Include="Libraries\BlitzPointer.cpp">
<Filter>Source Files\Libraries</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="dllmain.h">
<Filter>Source</Filter>
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="BlitzPointer.h">
<Filter>Source</Filter>
<ClInclude Include="Libraries\BlitzPointer.h">
<Filter>Source Files\Libraries</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="BlitzSteam.decls">
<Filter>Source</Filter>
</None>
<None Include="BlitzSteam.bb">
<Filter>Source</Filter>
<Filter>Blitz Files</Filter>
</None>
<None Include="BlitzSteam.decls">
<Filter>Blitz Files</Filter>
</None>
</ItemGroup>
</Project>
+30
View File
@@ -0,0 +1,30 @@
#pragma once
#include "BlitzPointer.h"
BlitzPointer_CallFunction0_t BlitzPointer_CallFunction0 = 0;
BlitzPointer_CallFunction1_t BlitzPointer_CallFunction1 = 0;
BlitzPointer_CallFunction2_t BlitzPointer_CallFunction2 = 0;
BlitzPointer_CallFunction3_t BlitzPointer_CallFunction3 = 0;
BlitzPointer_CallFunction4_t BlitzPointer_CallFunction4 = 0;
HMODULE hmBlitzPointerDLL;
void BlitzPointer_Initialize() {
hmBlitzPointerDLL = LoadLibrary(TEXT("BlitzPointer.dll"));
if (hmBlitzPointerDLL != nullptr) {
BlitzPointer_CallFunction0 = (BlitzPointer_CallFunction0_t)GetProcAddress(hmBlitzPointerDLL, "BlitzPointer_CallFunction0");
BlitzPointer_CallFunction1 = (BlitzPointer_CallFunction1_t)GetProcAddress(hmBlitzPointerDLL, "BlitzPointer_CallFunction1");
BlitzPointer_CallFunction2 = (BlitzPointer_CallFunction2_t)GetProcAddress(hmBlitzPointerDLL, "BlitzPointer_CallFunction2");
BlitzPointer_CallFunction3 = (BlitzPointer_CallFunction3_t)GetProcAddress(hmBlitzPointerDLL, "BlitzPointer_CallFunction3");
BlitzPointer_CallFunction4 = (BlitzPointer_CallFunction4_t)GetProcAddress(hmBlitzPointerDLL, "BlitzPointer_CallFunction4");
if (BlitzPointer_CallFunction0 == nullptr
|| BlitzPointer_CallFunction1 == nullptr
|| BlitzPointer_CallFunction2 == nullptr
|| BlitzPointer_CallFunction3 == nullptr
|| BlitzPointer_CallFunction4 == nullptr) {
MessageBox(0, ERROR_TEXT_001, ERROR_TITLE_001, 0);
}
} else {
MessageBox(0, ERROR_TEXT_001, ERROR_TITLE_001, 0);
}
}
+15
View File
@@ -0,0 +1,15 @@
#include "dllmain.h"
typedef uint32_t(__cdecl *BlitzPointer_CallFunction0_t)(uint32_t);
typedef uint32_t(__cdecl *BlitzPointer_CallFunction1_t)(uint32_t, uint32_t);
typedef uint32_t(__cdecl *BlitzPointer_CallFunction2_t)(uint32_t, uint32_t, uint32_t);
typedef uint32_t(__cdecl *BlitzPointer_CallFunction3_t)(uint32_t, uint32_t, uint32_t, uint32_t);
typedef uint32_t(__cdecl *BlitzPointer_CallFunction4_t)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
extern BlitzPointer_CallFunction0_t BlitzPointer_CallFunction0;
extern BlitzPointer_CallFunction1_t BlitzPointer_CallFunction1;
extern BlitzPointer_CallFunction2_t BlitzPointer_CallFunction2;
extern BlitzPointer_CallFunction3_t BlitzPointer_CallFunction3;
extern BlitzPointer_CallFunction4_t BlitzPointer_CallFunction4;
void BlitzPointer_Initialize();
+1 -1
View File
@@ -1,5 +1,5 @@
#include "dllmain.h"
#include "BlitzPointer.h"
#include "BlitzPointerLink.cpp"
class BlitzSteamCallback : CCallbackBase {
public:
+32
View File
@@ -0,0 +1,32 @@
#include "dllmain.h"
#include "Libraries\BlitzPointer.h"
class BlitzSteamCallback : CCallbackBase {
public:
uint32_t blitzFunctionPointer;
virtual void Run(void *pvParam) {
BlitzPointer_CallFunction1((uint32_t)blitzFunctionPointer, (uint32_t)pvParam);
}
virtual void Run(void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall) {
BlitzPointer_CallFunction4((uint32_t)blitzFunctionPointer, (uint32_t)pvParam, bIOFailure, (uint32_t)(hSteamAPICall & 0xFFFFFFFF), (uint32_t)(hSteamAPICall >> 32));
}
virtual int GetCallbackSizeBytes() {
return sizeof(BlitzSteamCallback);
}
};
DLL_EXPORT void* BlitzSteam_CreateCallback(uint32_t fpFunctionPointer) {
BlitzSteamCallback* lpBSCallback = new BlitzSteamCallback();
lpBSCallback->blitzFunctionPointer = fpFunctionPointer;
return lpBSCallback;
}
DLL_EXPORT void BlitzSteam_DestroyCallback(uint32_t lpCallback) {
BlitzSteamCallback* lpBSCallback = (BlitzSteamCallback*)lpCallback;
if (lpBSCallback != nullptr) {
delete lpBSCallback;
}
}
+2
View File
@@ -1,8 +1,10 @@
#include "dllmain.h"
#include "Libraries\BlitzPointer.h"
bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
BlitzPointer_Initialize();
break;
case DLL_PROCESS_DETACH:
break;
+7 -1
View File
@@ -12,4 +12,10 @@
#define DLL_EXPORT extern "C" __declspec(dllexport)
// Steam
#include "steam/steam_api.h"
#include "steam/steam_api.h"
// Error Messages
#define ERROR_TITLE_001 TEXT("Error 001")
#define ERROR_TEXT_001 TEXT("E001: Could not load 'BlitzPointer.dll'.")
#define ERROR_TITLE_002 TEXT("Error 002")
#define ERROR_TEXT_002 TEXT("E002: Unable to find one or multiple function addresses in 'BlitzPointer.dll'.")
+6 -2
View File
@@ -209,9 +209,13 @@ Function BlitzUtility_BorderlessWindowmode(hwnd=0, MonitorId=0, Width=0, Height=
Local rct.BlitzUtility_Rectangle = New BlitzUtility_Rectangle
BlitzUtility_GetDisplay(MonitorId, rct)
Local rctW, rctH
rctW = (rct\X2 - rct\X)
rctH = (rct\Y2 - rct\Y)
rct\X = rct\X + (rct\X2 / 2.0) - Width / 2.0
rct\Y = rct\Y + (rct\Y2 / 2.0) - Height / 2.0
rct\X = rct\X + (rctW / 2.0) - Width / 2.0
rct\Y = rct\Y + (rctH / 2.0) - Height / 2.0
rct\X2 = Width
rct\Y2 = Height
BlitzUtility_User32_SetWindowLong hwnd, -16, $01000000
+24 -41
View File
@@ -19,16 +19,12 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -59,20 +55,20 @@
<AdditionalIncludeDirectories>$(SolutionDir);$(ProjectDir)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>SQLITE_ENABLE_FTS4;SQLITE_ENABLE_RTREE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>false</FunctionLevelLinking>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<FloatingPointExceptions>
</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
<OpenMPSupport>false</OpenMPSupport>
<ForcedIncludeFiles>dllmain.h</ForcedIncludeFiles>
<RuntimeTypeInfo>
</RuntimeTypeInfo>
<CreateHotpatchableImage>true</CreateHotpatchableImage>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<CompileAsManaged>false</CompileAsManaged>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -88,27 +84,26 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Full</Optimization>
<FunctionLevelLinking>false</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir);$(ProjectDir)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PreprocessorDefinitions>SQLITE_ENABLE_FTS4;SQLITE_ENABLE_RTREE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<CompileAsManaged>false</CompileAsManaged>
<CompileAsWinRT>false</CompileAsWinRT>
<MultiProcessorCompilation>false</MultiProcessorCompilation>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<StructMemberAlignment>4Bytes</StructMemberAlignment>
<BufferSecurityCheck>false</BufferSecurityCheck>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<FloatingPointExceptions>
</FloatingPointExceptions>
<CreateHotpatchableImage>false</CreateHotpatchableImage>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<OpenMPSupport>false</OpenMPSupport>
<ForcedIncludeFiles>dllmain.h</ForcedIncludeFiles>
<ForcedIncludeFiles>
</ForcedIncludeFiles>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<OpenMPSupport>false</OpenMPSupport>
<RuntimeTypeInfo>
</RuntimeTypeInfo>
<CreateHotpatchableImage>true</CreateHotpatchableImage>
<MinimalRebuild>true</MinimalRebuild>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<GenerateDebugInformation>false</GenerateDebugInformation>
@@ -126,14 +121,8 @@
<ClInclude Include="dllmain.h" />
<ClInclude Include="Containers\BlitzList.h" />
<ClInclude Include="Utility\Indexer.h" />
<ClInclude Include="Database\SQLite\SQLite.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="Database\SQLite\sqlite3.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="Database\SQLite\SQLite.h" />
<ClInclude Include="Database\SQLite\sqlite3.h" />
<ClInclude Include="Math\Matrix3.h" />
<ClInclude Include="Math\Vector2.h" />
<ClInclude Include="Math\Vector3.h" />
@@ -143,14 +132,8 @@
<ItemGroup>
<ClCompile Include="Containers\BlitzList.cpp" />
<ClCompile Include="Utility\Indexer.cpp" />
<ClCompile Include="Database\SQLite\SQLite.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Database\SQLite\sqlite3.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Database\SQLite\SQLite.cpp" />
<ClCompile Include="Database\SQLite\sqlite3.c" />
<ClCompile Include="Math\Matrix3.cpp" />
<ClCompile Include="Math\Vector3.cpp" />
<ClCompile Include="Math\Vector2.cpp" />
+2 -6
View File
@@ -86,11 +86,7 @@
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="BlitzUtility.decls">
<Filter>Source Files</Filter>
</None>
<None Include="BlitzUtility.bb">
<Filter>Source Files</Filter>
</None>
<None Include="BlitzUtility.decls" />
<None Include="BlitzUtility.bb" />
</ItemGroup>
</Project>
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -46,16 +46,16 @@ extern "C" {
** Provide the ability to override linkage features of the interface.
*/
#ifndef SQLITE_EXTERN
# define SQLITE_EXTERN extern
# define SQLITE_EXTERN extern "C" __declspec(dllexport)
#endif
#ifndef SQLITE_API
# define SQLITE_API __declspec(dllexport)
# define SQLITE_API
#endif
#ifndef SQLITE_CDECL
# define SQLITE_CDECL __cdecl
# define SQLITE_CDECL
#endif
#ifndef SQLITE_STDCALL
# define SQLITE_STDCALL SQLITE_CDECL
# define SQLITE_STDCALL
#endif
/*
@@ -111,9 +111,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.8.10"
#define SQLITE_VERSION "3.8.10.1"
#define SQLITE_VERSION_NUMBER 3008010
#define SQLITE_SOURCE_ID "2015-04-19 23:11:10 c83052e48bbae0f45db2a44155b4e5482ee4a901"
#define SQLITE_SOURCE_ID "2015-05-09 12:14:55 05b4b1f2a937c06c90db70c09890038f6c98ec40"
/*
** CAPI3REF: Run-Time Library Version Numbers
+6 -6
View File
@@ -172,30 +172,30 @@ void Vector3::rotateAround(Vector3 &o, float &pitch, float &yaw, float &roll)
this->add(o);
}
float Vector3::deltaPitch() {
return (float)atan(this->X / -this->Y) * (180.0 / M_PI);
return (float)(atan(this->X / -this->Y) * (180.0 / M_PI));
}
float Vector3::deltaPitch(const float &x, const float &y, const float &z)
{
return (float)atan((this->X - x) / (-(this->Y - y))) * (180.0 / M_PI);
return (float)(atan((this->X - x) / (-(this->Y - y))) * (180.0 / M_PI));
}
float Vector3::deltaPitch(Vector3 &o)
{
return (float)atan((this->X - o.X) / (-(this->Y - o.Y))) * (180.0 / M_PI);
return (float)(atan((this->X - o.X) / (-(this->Y - o.Y))) * (180.0 / M_PI));
}
float Vector3::deltaYaw() {
return (float)atan(sqrt((this->X * this->X) + (this->Y * this->Y)) / this->Z) * (180.0 / M_PI);
return (float)(atan(sqrt((this->X * this->X) + (this->Y * this->Y)) / this->Z) * (180.0 / M_PI));
}
float Vector3::deltaYaw(const float &x, const float &y, const float &z)
{
float X = (this->X - x);
float Y = (this->Y - y);
return (float)atan(sqrt((X * X) + (Y * Y)) / (this->Z - z)) * (180.0 / M_PI);
return (float)(atan(sqrt((X * X) + (Y * Y)) / (this->Z - z)) * (180.0 / M_PI));
}
float Vector3::deltaYaw(Vector3 &o)
{
float X = (this->X - o.X);
float Y = (this->Y - o.Y);
return (float)atan(sqrt((X * X) + (Y * Y)) / (this->Z - o.Z)) * (180.0 / M_PI);
return (float)(atan(sqrt((X * X) + (Y * Y)) / (this->Z - o.Z)) * (180.0 / M_PI));
}
char* Vector3::serialize()
+3 -3
View File
@@ -3,7 +3,7 @@
#include <list>
#include "Containers\BlitzList.h"
//#include "Database\SQLite\SQLite.h"
#include "Database\SQLite\SQLite.h"
#include "Math\Vector2.h"
#include "Math\Vector3.h"
#include "Math\Matrix3.h"
@@ -20,7 +20,7 @@ bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
// Math
// Database
//SQLite3_OnProcessAttach();
SQLite3_OnProcessAttach();
// Utility
Display_OnProcessAttach();
@@ -34,7 +34,7 @@ bool WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
// Math
// Database
//SQLite3_OnProcessDetach();
SQLite3_OnProcessDetach();
// Utility
Display_OnProcessDetach();