Skip to content

Commit

Permalink
update detours to make windows defender happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Lapig committed Jun 29, 2020
1 parent 6875911 commit 6faf152
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
5 changes: 3 additions & 2 deletions PigPSO2Cam/PSO2CameraTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <detours.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <D3dx9core.h>
#include "Asm.h"
#include "imgui/settings_form.h"

Expand Down Expand Up @@ -132,6 +132,7 @@ bool CreateDeviceD3D(HWND hWnd)
g_d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
g_d3dpp.EnableAutoDepthStencil = TRUE;
g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
g_d3dpp.hDeviceWindow = game_hwnd;
g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; // Present with vsync
//g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; // Present without vsync, maximum unthrottled framerate
if (g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &g_d3dpp, &g_pd3dDevice) < 0)
Expand Down Expand Up @@ -184,7 +185,7 @@ int Initialize() {
Sleep(100);
hmRendDx9Base = GetModuleHandleA("d3d9.dll");
}
Sleep(5000); //meme to allow tweaker to load dll
//Sleep(5000); //meme to allow tweaker to load dll
EnumWindows(find_game_hwnd, GetCurrentProcessId());
// ShowDebugConsole();

Expand Down
14 changes: 12 additions & 2 deletions PigPSO2Cam/PigPSO2Cam.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>D:\Lapig\Documents\Visual Studio 2019\Projects\PigPSO2Cam\PigPSO2Cam\DXSDK;$(IncludePath)</IncludePath>
<LibraryPath>D:\Lapig\Documents\Visual Studio 2019\Projects\PigPSO2Cam\PigPSO2Cam\DXSDK;$(LibraryPath)</LibraryPath>
<IncludePath>G:\Program Files\DirectX9SDK\Include;$(IncludePath)</IncludePath>
<LibraryPath>G:\Program Files\DirectX9SDK\Lib\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
Expand Down Expand Up @@ -181,7 +181,17 @@
<ClInclude Include="imgui\settings_form.h" />
<ClInclude Include="PSO2CameraTool.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Detours.4.0.1\build\native\Detours.targets" Condition="Exists('..\packages\Detours.4.0.1\build\native\Detours.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Detours.4.0.1\build\native\Detours.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Detours.4.0.1\build\native\Detours.targets'))" />
</Target>
</Project>
3 changes: 2 additions & 1 deletion PigPSO2Cam/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ BOOL APIENTRY DllMain(HMODULE hModule,
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hModule);

CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&Initialize, 0, 0, 0);
//CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&Initialize, 0, 0, 0);
Initialize();
break;
}
return TRUE;
Expand Down
4 changes: 4 additions & 0 deletions PigPSO2Cam/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Detours" version="4.0.1" targetFramework="native" developmentDependency="true" />
</packages>
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ Allows you to do some moderately useful things with your camera in PSO2

#### Usage

+ Download the latest release and put it in your plugins folder if you use tweaker or just manually map inject it if you do not use tweaker
Download the latest release and inject with Xenos or your preferred injector

```
Xenos Settings
Type: Manual Map
No Exception Support
Ignore TLS
Close after Injection
```
+ Press INS to bring up the menu

#### Build Requirements
Expand Down

0 comments on commit 6faf152

Please sign in to comment.