Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
59 lines (55 loc) · 1.78 KB
/
Copy pathProgram.cs
File metadata and controls
59 lines (55 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using dnlib.DotNet.Emit;
using dnpatch;
using dnpatch.deobfuscation;
namespace UnpackMe2
{
class Program
{
/*
* First field: ioncodes
* Click Button 1
* Second field: ionCODES
* Click Button 2
* Enjoy Patches MessageBox
*/
static void Main(string[] args)
{
Deobfuscation deobfuscation = new Deobfuscation("UnpackMe2.ori.exe", "UnpackMe2.deob1.exe");
deobfuscation.Deobfuscate();
deobfuscation = new Deobfuscation("UnpackMe2.deob1.exe", "UnpackMe2.deob2.exe");
deobfuscation.Deobfuscate();
Patcher obfuscationPatcher = new Patcher("UnpackMe2.deob2.exe", false);
Target[] targets = obfuscationPatcher.FindInstructionsByOperand(new[]
{
"bBbBbBbBb",
"AaAaA",
"Good"
});
foreach (var target in targets)
{
target.Instructions = new[]
{
Instruction.Create(OpCodes.Ldstr, "ion"),
Instruction.Create(OpCodes.Ldstr, "codes"),
Instruction.Create(OpCodes.Ldstr, "Patched!")
};
}
obfuscationPatcher.Patch(targets);
targets = obfuscationPatcher.FindInstructionsByOperand(new []
{
"ameereagle"
});
foreach (var target in targets)
{
target.Instruction = Instruction.Create(OpCodes.Ldstr, "ioncodes");
}
obfuscationPatcher.Patch(targets);
obfuscationPatcher.Save("UnpackMe2.patched.exe");
}
}
}