Skip to content

Commit

Permalink
Added 32bit support
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceiridge committed Apr 9, 2020
1 parent c937e7f commit fa5110e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 22 deletions.
19 changes: 13 additions & 6 deletions ChromeDevExtWarningPatcher/Patches/BytePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ namespace ChromeDevExtWarningPatcher
{
public class BytePatch
{
public byte origByte, patchByte;
public int offset;
public byte origByteX64, patchByteX64;
public int offsetX64;
public BytePatchPattern pattern;

public BytePatch(BytePatchPattern pattern, byte origByte, byte patchByte, int offset)
public byte origByteX86, patchByteX86;
public int offsetX86;

public BytePatch(BytePatchPattern pattern, byte origByteX64, byte patchByteX64, int offsetX64, byte origByteX86, byte patchByteX86, int offsetX86)
{
this.pattern = pattern;
this.origByte = origByte;
this.patchByte = patchByte;
this.offset = offset;
this.origByteX64 = origByteX64;
this.patchByteX64 = patchByteX64;
this.offsetX64 = offsetX64;

this.origByteX86 = origByteX86;
this.patchByteX86 = patchByteX86;
this.offsetX86 = offsetX86;
}
}
}
15 changes: 9 additions & 6 deletions ChromeDevExtWarningPatcher/Patches/BytePatchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ public bool PatchBytes(ref byte[] raw, bool x64, BytePatchPattern.WriteToLog log
continue;
}
long addr = patch.pattern.FindAddress(raw, x64, log);
int patchOffset = x64 ? patch.offsetX64 : patch.offsetX86;
byte patchOrigByte = x64 ? patch.origByteX64 : patch.origByteX86;
byte patchPatchByte = x64 ? patch.patchByteX64 : patch.patchByteX86;

if(addr != -1) {
long index = addr + patch.offset;
long index = addr + patchOffset;
byte sourceByte = raw[index];

log("Source byte of patch at " + patch.offset + ": " + sourceByte);
if (sourceByte == patch.origByte) {
raw[index] = patch.patchByte;
log(index + " => " + patch.patchByte);
log("Source byte of patch at " + patchOffset + ": " + sourceByte);
if (sourceByte == patchOrigByte) {
raw[index] = patchPatchByte;
log(index + " => " + patchPatchByte);
patches++;
} else
log("Source byte unexpected, should be " + patch.origByte + "!");
log("Source byte unexpected, should be " + patchOrigByte + "!");
} else {
log("Couldn't find offset for a patch " + patch.pattern.Name);
}
Expand Down
8 changes: 4 additions & 4 deletions ChromeDevExtWarningPatcher/Patches/Defaults/Patches.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
namespace ChromeDevExtWarningPatcher.Patches.Defaults {
public class RemoveExtensionWarningPatch1 : BytePatch {
public RemoveExtensionWarningPatch1() : base(new RemoveExtensionWarningPattern(), 0x04, 0xFF, 22) { }
public RemoveExtensionWarningPatch1() : base(new RemoveExtensionWarningPattern(), 0x04, 0xFF, 22, 0x04, 0xFF, 20) { }
}

public class RemoveExtensionWarningPatch2 : BytePatch {
public RemoveExtensionWarningPatch2() : base(new RemoveExtensionWarningPattern(), 0x08, 0xFF, 35) { }
public RemoveExtensionWarningPatch2() : base(new RemoveExtensionWarningPattern(), 0x08, 0xFF, 35, 0x08, 0xFF, 32) { }
}

public class RemoveDebugWarningPatch : BytePatch {
public RemoveDebugWarningPatch() : base(new RemoveDebugWarningPattern(), 0x41, 0xC3, 0x00) { }
public RemoveDebugWarningPatch() : base(new RemoveDebugWarningPattern(), 0x41, 0xC3, 0x00, 0x55, 0xC3, 0x00) { }
}

public class RemoveElisionPatch : BytePatch {
public RemoveElisionPatch() : base(new RemoveElisionPattern(), 0x56, 0xC3, 0x00) { }
public RemoveElisionPatch() : base(new RemoveElisionPattern(), 0x56, 0xC3, 0x00, 0x55, 0xC3, 0x00) { }
}
}
14 changes: 10 additions & 4 deletions ChromeDevExtWarningPatcher/Patches/Defaults/Patterns.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
namespace ChromeDevExtWarningPatcher.Patches.Defaults {
public class RemoveExtensionWarningPattern : BytePatchPattern {
namespace ChromeDevExtWarningPatcher.Patches.Defaults { // 0xFF is ?
public class RemoveExtensionWarningPattern : BytePatchPattern { // ShouldIncludeExtension; "ProxyOverriddenBubble.UserSelection" 2nd next
public RemoveExtensionWarningPattern() : base("Remove Extension Warning") {
AlternativePatternsX64.Add(new byte[] { 0x56, 0x48, 0x83, 0xEC, 0x20, 0x48, 0x89, 0xD6, 0x48, 0x89, 0xD1, 0xE8, 0xFF, 0xFF, 0xFF, 0xFF, 0x89, 0xC1 });

AlternativePatternsX86.Add(new byte[] { 0x55, 0x89, 0xE5, 0x56, 0x8B, 0x75, 0xFF, 0x89, 0xF1, 0xE8, 0xFF, 0xFF, 0xFF, 0xFF, 0x89, 0xC1, 0xB0, 0xFF, 0x83, 0xF9, 0xFF });
}
}

public class RemoveDebugWarningPattern : BytePatchPattern {
public class RemoveDebugWarningPattern : BytePatchPattern { // MaybeAddInfoBar; "MaybeAddInfoBar"
public RemoveDebugWarningPattern() : base("Remove Debug Warning") {
AlternativePatternsX64.Add(new byte[] { 0x41, 0x57, 0x41, 0x56, 0x41, 0x54, 0x56, 0x57, 0x53, 0x48, 0x81, 0xEC, 0xFF, 0xFF, 0xFF, 0xFF, 0x49, 0x89, 0xCC, 0x48, 0x8B, 0x05, 0xFF, 0xFF, 0xFF, 0xFF, 0x48, 0x31, 0xE0, 0x48, 0x89, 0x84, 0x24, 0xFF, 0xFF, 0xFF, 0xFF, 0x48, 0x8D, 0x4A, 0xFF });
AlternativePatternsX64.Add(new byte[] { 0x41, 0x57, 0x41, 0x56, 0x56, 0x57, 0x53, 0x48, 0x81, 0xEC, 0xFF, 0xFF, 0xFF, 0xFF, 0x48, 0x89, 0xCE, 0x48, 0x8B, 0x05, 0xFF, 0xFF, 0xFF, 0xFF, 0x48, 0x31, 0xE0, 0x48, 0x89, 0x84, 0x24, 0xFF, 0xFF, 0xFF, 0xFF, 0x48, 0x8D, 0x4A, 0x08 });

AlternativePatternsX86.Add(new byte[] { 0x55, 0x89, 0xE5, 0x53, 0x57, 0x56, 0x83, 0xE4, 0xFF, 0x83, 0xEC, 0xFF, 0x89, 0xE6, 0xA1, 0xFF, 0xFF, 0xFF, 0xFF, 0x89, 0xCF, 0x8B, 0x4D, 0xFF, 0x31, 0xE8, 0x83, 0xC1, 0xFF });
}
}

public class RemoveElisionPattern : BytePatchPattern {
public class RemoveElisionPattern : BytePatchPattern { // ShouldPreventElision; "jknemblkbdhdcpllfgbfekkdciegfboi" inside or "https://support.google.com/chrome/?p=unauthenticated" 3rd next
public RemoveElisionPattern() : base("Remove Elision") {
AlternativePatternsX64.Add(new byte[] { 0x56, 0x57, 0x53, 0x48, 0x83, 0xEC, 0x40, 0x48, 0x8B, 0x05, 0xFF, 0xFF, 0xFF, 0xFF, 0x48, 0x31, 0xE0, 0x48, 0x89, 0x44, 0x24, 0xFF, 0xE8, 0xFF, 0xFF, 0xFF, 0xFF, 0x48, 0x85, 0xC0, 0x74, 0x61 });

AlternativePatternsX86.Add(new byte[] { 0x55, 0x89, 0xE5, 0x53, 0x57, 0x56, 0x83, 0xEC, 0xFF, 0xA1, 0xFF, 0xFF, 0xFF, 0xFF, 0x31, 0xE8, 0x89, 0x45, 0xFF, 0xE8, 0xFF, 0xFF, 0xFF, 0xFF, 0x85, 0xC0, 0x74, 0xFF, 0x50, 0xE8, 0xFF, 0xFF, 0xFF, 0xFF, 0x83, 0xC4, 0xFF, 0x8D, 0x58, 0xFF });
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Disable Chrome's and Chromium's Developer Mode Extension Warning Popup
# Disable Chromium's and Chrome's Developer Mode Extension Warning Popup & Elision WWW/HTTPS Hiding & Debugging Extension Popup
**Download** it in the [release section](https://github.com/Ceiridge/Chrome-Developer-Mode-Extension-Warning-Patcher/releases).

## Supported browsers
See below for the custom paths (commandline option).
```javascript
- All x64 Chromium-based browsers, including:
- All x64 and x86/x32 bit Chromium-based browsers, including:
- Chrome ✓
- Chromium
- Brave ✓
Expand Down

0 comments on commit fa5110e

Please sign in to comment.