Skip to content

Instantly share code, notes, and snippets.

@xHeaven
Forked from guillaC/Program.cs
Created March 11, 2017 01:43
Show Gist options
  • Save xHeaven/9374bbb0b004f81c0c21799e9b063207 to your computer and use it in GitHub Desktop.
Save xHeaven/9374bbb0b004f81c0c21799e9b063207 to your computer and use it in GitHub Desktop.
antidump .net / does not work on GUI app. based on the work of ricardojrdez ( https://goo.gl/t1WNVp )
namespace Protected
{
using System;
using System.Runtime.InteropServices;
internal class Program
{
[DllImport("kernel32.dll")]
public static extern bool ZeroMemory(IntPtr Destination, int Length);
[DllImport("kernel32.dll")]
public static extern IntPtr GetModuleHandle(string lpModuleName);
[DllImport("kernel32.dll")]
static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize, uint flNewProtect, out uint lpflOldProtect);
private static void Main(string[] args)
{
DoSomeFaggoterie();
Console.WriteLine("Dump me.");
Console.ReadLine();
}
private static void DoSomeFaggoterie()
{
uint oldProt;
VirtualProtect(GetModuleHandle(null), 4096, 0x04, out oldProt); // Change protection of memory zone
ZeroMemory(GetModuleHandle(null), 4096); //Delete header
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment