Skip to content

Commit

Permalink
Minor fixes - zoom v5.0
Browse files Browse the repository at this point in the history
removed legacy shit, should work now. (even though it did for me but some ppl said otherwise)

i think fixed [Issue #2](#2)

IF YOU STILL ARE CRASHING:
Create an issue
Let me know of the circumstances (zoom version, os, etc)
  • Loading branch information
vaxerski committed May 13, 2020
1 parent a4eaf7c commit 437ed12
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 21 deletions.
66 changes: 64 additions & 2 deletions ZoomPatcher/ZoomPatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <string>
#include <fstream>
#include <time.h>
#include <filesystem>

DWORD pids[16];
int lastPID = 0;
Expand Down Expand Up @@ -62,6 +63,12 @@ DWORD getProcess(char* processName) {
return NULL;
}

std::string getexepath()
{
char result[MAX_PATH];
return std::string(result, GetModuleFileName(NULL, result, MAX_PATH));
}

bool ZoomRunning() {
HANDLE hPID = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
PROCESSENTRY32 procEntry;
Expand Down Expand Up @@ -109,7 +116,7 @@ int main() {

// declare variables
const char* process = "Zoom.exe";
const char* maindll = "ZoomWebcamPatch.dll";
const char* maindll = "ZoomHeadDLL.dll";
bool found = false;
bool backup = true;

Expand All @@ -126,6 +133,61 @@ int main() {

//removed file patch due to it breaking the screensharing

if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, path))) {
s_patha = path;
s_patha += "\\Zoom";



for (int i = -1; i < 50; i++) {
std::string test = s_patha + "\\bin";

if (i >= 0) {
test += "_";
if (i >= 10) {
test += std::to_string(i);
}
else {
test += "0" + std::to_string(i);
}
}

bin = test;

test = test + "\\DllSafeCheck.dll";
std::ifstream f(test.c_str());

if (f.good()) {
s_patha = test;
found = true;
break;
}
}

if (!found) {
MessageBox(NULL, "Local Zoom bin folder not found.", ":(", NULL);
return ERROR;
}
}
else {
MessageBox(NULL, "Local Zoom bin folder not found.", ":(", NULL);
return ERROR;
}

//copy the patch to zoom bin for later injections

s_patha += "\\ZoomWebcamPatch.dll";
const char* cpath = s_patha.c_str();

std::string workingDir = getexepath();



std::ifstream srce("ZoomWebcamPatch.dll", std::ios::binary);
std::ofstream dest(cpath, std::ios::binary);
dest << srce.rdbuf();


std::string titles[12] = { "ZoomWebcamFix - We're over China.",
"ZoomWebcamFix - Made with <3 by Vaxer",
"ZoomWebcamFix - So you can go and troll people with your green screen online :)",
Expand Down Expand Up @@ -172,7 +234,7 @@ int main() {

addr = inject(pids[0], (char*)maindll);

std::cout << "[+] Injected the dll at " << addr << std::endl << std::endl;
std::cout << "[+] Injected main dll at " << addr << std::endl << std::endl;

for (;; Sleep(1000)) {
while (getProcess((char*)process) == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion ZoomWebcamPatch/ZoomWebcamPatch.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="detours.h" />
<ClInclude Include="detours.hpp" />
<ClInclude Include="detver.h" />
<ClInclude Include="DLLS.h" />
<ClInclude Include="framework.h" />
Expand Down
6 changes: 3 additions & 3 deletions ZoomWebcamPatch/ZoomWebcamPatch.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
<ClInclude Include="framework.h">
<Filter>Pliki źródłowe\main</Filter>
</ClInclude>
<ClInclude Include="detours.h">
<Filter>Pliki źródłowe\helpers</Filter>
</ClInclude>
<ClInclude Include="detver.h">
<Filter>Pliki źródłowe\helpers</Filter>
</ClInclude>
Expand All @@ -42,6 +39,9 @@
<ClInclude Include="hooks.h">
<Filter>Pliki źródłowe\core</Filter>
</ClInclude>
<ClInclude Include="detours.hpp">
<Filter>Pliki źródłowe\helpers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions ZoomWebcamPatch/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ cHooks* hooks;

//---------CLASSES---------//


DWORD WINAPI initThread(LPVOID param) {
DWORD WINAPI guardThread(LPVOID param) {

//--------modules--------//

Expand All @@ -37,7 +36,7 @@ BOOL APIENTRY DllMain(HMODULE hModule,
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
uwu(nullptr, 0, initThread, nullptr, 0, nullptr);
uwu(nullptr, 0, guardThread, nullptr, 0, nullptr);
DisableThreadLibraryCalls(hModule);
break;
case DLL_THREAD_ATTACH:
Expand All @@ -46,4 +45,4 @@ BOOL APIENTRY DllMain(HMODULE hModule,
break;
}
return TRUE;
}
}
3 changes: 1 addition & 2 deletions ZoomWebcamPatch/framework.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#define WIN32_LEAN_AND_MEAN // Wyklucz rzadko używane rzeczy z nagłówków systemu Windows
// Pliki nagłówkowe systemu Windows
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <iostream>
#include <string>
Expand Down
16 changes: 10 additions & 6 deletions ZoomWebcamPatch/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ BOOL WINAPI hooked_SafeCheckDLLMAIN(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID
}

cHooks::cHooks() {

//----------ADDRESSES----------//

dwHackCheckMain = sigscan->FindPattern((char*)modules->mZoom, (char*)"\xE8\x00\x00\x00\x00\x68\x00\x00\x00\x00\xFF\x15", (char*)"x????x????xx");
dwDllMainSafeCheck = sigscan->FindPattern((char*)modules->mDllSafeCheck, (char*)"\x83\x7C\x24\x00\x00\x75\x41", (char*)"xxx??xx");
// Zoom v5.0.2 (24046.0510) kind of tested
//dwHackCheckMain = sigscan->FindPattern((char*)modules->mZoom, (char*)"\x83\x7C\x24\x00\x00\x75\x41", (char*)"xxx??xx");
dwDllMainSafeCheck = sigscan->FindPattern((char*)modules->mDllSafeCheck, (char*)"\x83\x7C\x24\x00\x00\x75\x41", (char*)"xxx??xx"); //removed cuz its stupid

//-----------------------------//

if (dwHackCheckMain == 0 || dwDllMainSafeCheck == 0) {
std::string errormsg = "Sigscan failed! \n\ndwHackCheckMain = " + std::to_string(dwHackCheckMain); +"\ndwDllMainSafeCheck = " + std::to_string(dwDllMainSafeCheck) + "\n\nReport the issue on GitHub.";
if (dwDllMainSafeCheck == 0) {

std::string errormsg = "Sigscan failed! \n\ndwDllMainSafeCheck = " +
std::to_string(dwDllMainSafeCheck) +
"\n\nReport the issue on GitHub. I won't see it on any other forums.";
std::wstring w_errormsg = std::wstring(errormsg.begin(), errormsg.end());
MessageBoxW(NULL, w_errormsg.c_str(), L":(", NULL);
}
Expand All @@ -38,7 +41,8 @@ cHooks::cHooks() {

//----------ASM HOOKS----------//

doAsmHook((void*)dwHackCheckMain, &bytePatchSafeCheck, 5);
// not needed
//doAsmHook((void*)dwHackCheckMain, &bytePatchSafeCheck, 5);

//-----------------------------//

Expand Down
4 changes: 1 addition & 3 deletions ZoomWebcamPatch/hooks.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "detours.h"
#include "detours.hpp"

typedef BOOL(WINAPI* f_HackCheckDLLMAIN)(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);

Expand All @@ -12,8 +12,6 @@ class cHooks {
bool unregSafeCheck(void);

DWORD dwDllMainSafeCheck; //\x83\x7C\x24\x00\x00\x75\x41 xxx??xx

DWORD dwHackCheckMain; //\xE8\x00\x00\x00\x00\x68\x00\x00\x00\x00\xFF\x15 x????x????xx
};

extern cHooks* hooks;

0 comments on commit 437ed12

Please sign in to comment.