-
-
Save DanielRTeixeira/2bc64603b08efaabfb6f7423ffb66737 to your computer and use it in GitHub Desktop.
Basic Example of Binary Patching With MPatch.exe and APatch.exe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Build Your Binaries | |
c:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe a.cs | |
c:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe b.cs | |
c:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe c.cs | |
# Create Your Patch | |
# You need Windows 7 SDK | |
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\mpatch.exe" a.exe b.exe dbi_patch | |
#Apply Your Patch | |
#Patch c.exe so it looks like b.exe | |
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\apatch.exe" dbi_patch a.exe c.exe | |
#Compare | |
fc b.exe c.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine("Hello World"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine("Bye World"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine(""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment