mirror of
https://github.com/NohamR/RMHook-Win.git
synced 2026-05-26 13:30:12 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a16b896f8a | ||
|
|
9335c33671 | ||
|
|
3d8d519d8b | ||
|
|
df2c1d2f4c | ||
|
|
4c384dec04 |
20
README.md
20
README.md
@@ -24,15 +24,22 @@ RMHook-Win intercepts the reMarkable Desktop app's Qt networking layer and patch
|
|||||||
|
|
||||||
## Installation and usage
|
## Installation and usage
|
||||||
|
|
||||||
### Important legal note
|
|
||||||
|
|
||||||
⚠️ **For legal reasons, this repository does not include a pre-patched reMarkable app.** However, the latest compiled dylib is available in the [Releases](https://github.com/NohamR/RMHook-Win/releases/latest) section.
|
⚠️ **For legal reasons, this repository does not include a pre-patched reMarkable app.** However, the latest compiled dylib is available in the [Releases](https://github.com/NohamR/RMHook-Win/releases/latest) section.
|
||||||
|
|
||||||
### Step 1: Build or obtain the proxy DLL
|
### Auto installation
|
||||||
|
|
||||||
Build the `paho-mqtt3as-proxy` project with Visual Studio using `paho-mqtt3as-proxy.slnx`, or use an existing `paho-mqtt3as.dll` built from this repo.
|
Run in a PowerShell terminal with administrator privileges:
|
||||||
|
```powershell
|
||||||
|
irm https://raw.githubusercontent.com/NohamR/RMHook-Win/refs/heads/main/scripts/download-and-install.ps1 | iex
|
||||||
|
```
|
||||||
|
|
||||||
### Step 2: Install the hook
|
### Manual installation
|
||||||
|
|
||||||
|
#### Step 1: Build or obtain the proxy DLL
|
||||||
|
|
||||||
|
Build the `paho-mqtt3as-proxy` project with [Visual Studio](https://visualstudio.microsoft.com/downloads/) using `paho-mqtt3as-proxy.slnx`, or use an existing `paho-mqtt3as.dll` built from this repo.
|
||||||
|
|
||||||
|
#### Step 2: Install the hook
|
||||||
|
|
||||||
Use the installer script from the `scripts` folder.
|
Use the installer script from the `scripts` folder.
|
||||||
Note: Run from an elevated PowerShell session. The installer script will request administrator privileges if needed.
|
Note: Run from an elevated PowerShell session. The installer script will request administrator privileges if needed.
|
||||||
@@ -57,7 +64,7 @@ The script expects the Windows reMarkable install folder at:
|
|||||||
C:\Program Files\reMarkable
|
C:\Program Files\reMarkable
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 3: Restore the original DLL
|
#### Step 3: Restore the original DLL
|
||||||
|
|
||||||
To remove the proxy and restore the original `paho-mqtt3as.dll`:
|
To remove the proxy and restore the original `paho-mqtt3as.dll`:
|
||||||
```powershell
|
```powershell
|
||||||
@@ -70,6 +77,7 @@ Config path:
|
|||||||
```text
|
```text
|
||||||
%LOCALAPPDATA%\RMHook\config.json
|
%LOCALAPPDATA%\RMHook\config.json
|
||||||
```
|
```
|
||||||
|
The config is loaded on app startup and changes require a restart to take effect. It specifies the host and port for redirecting reMarkable cloud traffic.
|
||||||
|
|
||||||
Example config:
|
Example config:
|
||||||
```json
|
```json
|
||||||
|
|||||||
@@ -51,6 +51,10 @@ static std::string GetLogPath()
|
|||||||
return "rmhook.log";
|
return "rmhook.log";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ClearLog()
|
||||||
|
{
|
||||||
|
std::ofstream file(GetLogPath(), std::ios::trunc);
|
||||||
|
}
|
||||||
|
|
||||||
static void Log(const std::string& msg)
|
static void Log(const std::string& msg)
|
||||||
{
|
{
|
||||||
@@ -304,7 +308,7 @@ static void LoadConfig()
|
|||||||
Log("[ERROR] Failed to check config existence: " + ec.message());
|
Log("[ERROR] Failed to check config existence: " + ec.message());
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageBoxA(NULL, "First launch detected.\nUsing default config (example.com:443).\nYou can edit configuration in %LOCALAPPDATA%\\RMHook\\config.json", "RMHook Configuration", MB_OK | MB_ICONINFORMATION);
|
MessageBoxA(NULL, "First launch detected.\nUsing default config (example.com:443).\nEdit configuration in %LOCALAPPDATA%\\RMHook\\config.json\nand restart the application to apply changes.", "RMHook Configuration", MB_OK | MB_ICONINFORMATION);
|
||||||
|
|
||||||
std::filesystem::create_directories(configPath.parent_path(), ec);
|
std::filesystem::create_directories(configPath.parent_path(), ec);
|
||||||
if (ec)
|
if (ec)
|
||||||
@@ -592,6 +596,7 @@ static void* ResolveExport(HMODULE module, const char* symbol)
|
|||||||
void InstallHooks()
|
void InstallHooks()
|
||||||
{
|
{
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
|
ClearLog();
|
||||||
|
|
||||||
Log("[*] Initializing MinHook");
|
Log("[*] Initializing MinHook");
|
||||||
|
|
||||||
|
|||||||
20
scripts/download-and-install.ps1
Normal file
20
scripts/download-and-install.ps1
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
$REPO = "NohamR/RMHook-Win"
|
||||||
|
$FILE = "paho-mqtt3as.dll"
|
||||||
|
|
||||||
|
$TempDir = [System.IO.Path]::GetTempPath()
|
||||||
|
$DestPath = Join-Path $TempDir $FILE
|
||||||
|
$InstallScriptPath = Join-Path $TempDir "install-hook.ps1"
|
||||||
|
|
||||||
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||||
|
|
||||||
|
Write-Host "[INFO] Downloading $FILE..."
|
||||||
|
Invoke-WebRequest -Uri "https://github.com/$REPO/releases/latest/download/$FILE" -OutFile $DestPath -UseBasicParsing
|
||||||
|
|
||||||
|
Write-Host "[INFO] Downloading install script..."
|
||||||
|
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/$REPO/refs/heads/main/scripts/install-hook.ps1" -OutFile $InstallScriptPath -UseBasicParsing
|
||||||
|
|
||||||
|
Write-Host "[INFO] Running install script..."
|
||||||
|
# Run the downloaded script, bypassing execution policies
|
||||||
|
powershell.exe -NoProfile -ExecutionPolicy Bypass -File $InstallScriptPath -Action install -SourcePath $DestPath
|
||||||
|
|
||||||
|
Write-Host "Done. You can safely close this window."
|
||||||
Reference in New Issue
Block a user