Skip to content

Commit 3a4928a

Browse files
committed
Hopefully made github ci work now
1 parent 5e48e8f commit 3a4928a

8 files changed

Lines changed: 46 additions & 33 deletions

File tree

.github/workflows/msbuild.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ jobs:
3333
- name: Add MSBuild to PATH
3434
uses: microsoft/setup-msbuild@v1.0.2
3535

36-
- name: Restore NuGet packages
37-
working-directory: ${{env.GITHUB_WORKSPACE}}
38-
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
36+
- name: Install vcpkg
37+
uses: lukka/run-vcpkg@v11
38+
39+
- name: Install dependencies from vcpkg.json
40+
run: vcpkg install
3941

4042
- name: Build
4143
working-directory: ${{env.GITHUB_WORKSPACE}}

PandaDLL/Panda.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ DWORD WINAPI Panda::attach(LPVOID lpParam)
3737
}
3838

3939
return 0;
40-
41-
return 1;
42-
}
43-
44-
void Panda::detach()
45-
{
46-
// I don't know what to put here
4740
}
4841

4942
char* Panda::detourFunction(void* self)
@@ -73,9 +66,7 @@ char* Panda::detourFunction(void* self)
7366

7467
int Panda::modifyResponse(char*& buffer)
7568
{
76-
7769
std::string modifiableString = std::string(_strdup(buffer));
78-
//debug(modifiableString);
7970

8071
if (strstr(buffer, "Group=\"\"")) // Ignore this response because we don't want to modify it
8172
{
@@ -93,11 +84,6 @@ int Panda::modifyResponse(char*& buffer)
9384
}
9485
newContent.append("</QueryEntitlementsResponse>");
9586

96-
/*debug(newContent.c_str());
97-
98-
char* replacementStart = strstr(modifiableString, "<QueryEntitlementsResponse>");
99-
char* replacementEnd = strstr(modifiableString, "</QueryEntitlementsResponse>");*/
100-
10187
size_t start = modifiableString.find("<QueryEntitlementsResponse>");
10288
size_t end = modifiableString.find("</QueryEntitlementsResponse>") + strlen("</QueryEntitlementsResponse>");
10389

@@ -186,9 +172,9 @@ int Panda::loadEntitlements()
186172
// Close the file when we're done
187173
entitlementsFile.close();
188174

189-
//std::for_each(entitlements.begin(), entitlements.end(), [](Entitlement* entitlement) { debug(entitlement->getEntitlementString(1000000000006).c_str()); });
190-
191175
debug(std::string(std::string("Loaded ") + std::to_string(entitlements.size()) + std::string(" entitlements from config")).c_str());
176+
177+
return 1;
192178
}
193179

194180
DWORD WINAPI Panda::freeBuffer(LPVOID lpParam)

PandaDLL/Panda.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#define REGEXPR_NUMBER ^0$|^[1-9][0-9]*$
66

77
#include <Windows.h>
8-
#include <detours.h>
8+
#include <detours/detours.h>
99
#include <shlobj.h>
1010

1111
#include <iostream>
@@ -24,7 +24,6 @@ class Panda
2424
{
2525
public:
2626
static DWORD WINAPI attach(LPVOID lpParam);
27-
static void detach();
2827

2928
static char* detourFunction(void* self);
3029
static FARPROC getProcessAddrFromDllFunction(LPCSTR dllName, LPCSTR functionName);

PandaDLL/PandaDLL.vcxproj

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,24 @@
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<TargetName>version</TargetName>
75-
<IncludePath>C:\Detours-main\include;$(IncludePath)</IncludePath>
75+
<IncludePath>$(IncludePath)</IncludePath>
7676
</PropertyGroup>
7777
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7878
<TargetName>version</TargetName>
79-
<IncludePath>C:\Detours-main\include;$(IncludePath)</IncludePath>
79+
<IncludePath>$(IncludePath)</IncludePath>
8080
</PropertyGroup>
8181
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8282
<TargetName>version</TargetName>
83-
<IncludePath>C:\Detours-main\include;$(IncludePath)</IncludePath>
83+
<IncludePath>$(IncludePath)</IncludePath>
8484
</PropertyGroup>
8585
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8686
<TargetName>version</TargetName>
87-
<IncludePath>C:\Detours-main\include;$(IncludePath)</IncludePath>
87+
<IncludePath>$(IncludePath)</IncludePath>
8888
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\intermediate\</IntDir>
8989
</PropertyGroup>
90+
<PropertyGroup Label="Vcpkg">
91+
<VcpkgEnableManifest>true</VcpkgEnableManifest>
92+
</PropertyGroup>
9093
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
9194
<ClCompile>
9295
<WarningLevel>Level3</WarningLevel>
@@ -101,7 +104,7 @@
101104
<SubSystem>Windows</SubSystem>
102105
<GenerateDebugInformation>true</GenerateDebugInformation>
103106
<EnableUAC>false</EnableUAC>
104-
<AdditionalDependencies>C:\Detours-main\lib.X64\detours.lib;%(AdditionalDependencies)</AdditionalDependencies>
107+
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
105108
</Link>
106109
</ItemDefinitionGroup>
107110
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -122,7 +125,7 @@
122125
<OptimizeReferences>true</OptimizeReferences>
123126
<GenerateDebugInformation>false</GenerateDebugInformation>
124127
<EnableUAC>false</EnableUAC>
125-
<AdditionalDependencies>C:\Detours-main\lib.X64\detours.lib;%(AdditionalDependencies)</AdditionalDependencies>
128+
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
126129
</Link>
127130
</ItemDefinitionGroup>
128131
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -139,7 +142,7 @@
139142
<SubSystem>Windows</SubSystem>
140143
<GenerateDebugInformation>true</GenerateDebugInformation>
141144
<EnableUAC>false</EnableUAC>
142-
<AdditionalDependencies>C:\Detours-main\lib.X64\detours.lib;%(AdditionalDependencies)</AdditionalDependencies>
145+
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
143146
</Link>
144147
</ItemDefinitionGroup>
145148
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -160,7 +163,7 @@
160163
<OptimizeReferences>true</OptimizeReferences>
161164
<GenerateDebugInformation>false</GenerateDebugInformation>
162165
<EnableUAC>false</EnableUAC>
163-
<AdditionalDependencies>C:\Detours-main\lib.X64\detours.lib;%(AdditionalDependencies)</AdditionalDependencies>
166+
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
164167
</Link>
165168
</ItemDefinitionGroup>
166169
<ItemGroup>

PandaDLL/PandaDLL.vcxproj.user

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup />
3+
<PropertyGroup>
4+
<ShowAllFiles>false</ShowAllFiles>
5+
</PropertyGroup>
46
</Project>

PandaDLL/dllmain.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ BOOL APIENTRY DllMain( HMODULE hModule, DWORD reason, LPVOID lpReserved )
77
{
88
if (reason == DLL_PROCESS_ATTACH)
99
{
10-
// attach
10+
char systemPath[MAX_PATH];
11+
UINT length = GetSystemDirectoryA(systemPath, MAX_PATH);
12+
13+
Panda::debug(systemPath);
14+
1115
originalDll = LoadLibraryA("C:\\Windows\\System32\\version.dll");
1216
GetModuleFileNameW(0, processName, sizeof(processName));
1317
if (wcsstr(processName, L"EADesktop.exe"))
@@ -17,8 +21,6 @@ BOOL APIENTRY DllMain( HMODULE hModule, DWORD reason, LPVOID lpReserved )
1721
}
1822
else if (reason == DLL_PROCESS_DETACH)
1923
{
20-
// detach
21-
Panda::detach();
2224
FreeLibrary(originalDll);
2325
}
2426

vcpkg-configuration.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"default-registry": {
3+
"kind": "git",
4+
"baseline": "4f8fe05871555c1798dbcb1957d0d595e94f7b57",
5+
"repository": "https://github.com/microsoft/vcpkg"
6+
},
7+
"registries": [
8+
{
9+
"kind": "artifact",
10+
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
11+
"name": "microsoft"
12+
}
13+
]
14+
}

vcpkg.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": [
3+
"detours"
4+
]
5+
}

0 commit comments

Comments
 (0)