Rename PE namespace
This commit is contained in:
parent
c5d9cc47ba
commit
c756d543c1
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class Cor20Header : IFileLocation {
|
public class Cor20Header : IFileLocation {
|
||||||
public uint cb;
|
public uint cb;
|
||||||
public ushort majorRuntimeVersion;
|
public ushort majorRuntimeVersion;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public struct DataDirectory {
|
public struct DataDirectory {
|
||||||
public uint virtualAddress;
|
public uint virtualAddress;
|
||||||
public uint size;
|
public uint size;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class DotNetStream : IFileLocation {
|
public class DotNetStream : IFileLocation {
|
||||||
public string name;
|
public string name;
|
||||||
public uint fileOffset;
|
public uint fileOffset;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public enum Machine : ushort {
|
public enum Machine : ushort {
|
||||||
i386 = 0x14C,
|
i386 = 0x14C,
|
||||||
ia64 = 0x200,
|
ia64 = 0x200,
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
along with de4dot. If not, see <http://www.gnu.org/licenses/>.
|
along with de4dot. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public interface IFileLocation {
|
public interface IFileLocation {
|
||||||
uint Offset { get; }
|
uint Offset { get; }
|
||||||
uint Length { get; }
|
uint Length { get; }
|
||||||
|
|
|
@ -21,7 +21,7 @@ using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class Metadata : IFileLocation {
|
public class Metadata : IFileLocation {
|
||||||
uint magic;
|
uint magic;
|
||||||
ushort majorVersion, minorVersion;
|
ushort majorVersion, minorVersion;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
using MVT = MetadataVarType;
|
using MVT = MetadataVarType;
|
||||||
|
|
||||||
public class MetadataTables {
|
public class MetadataTables {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public enum MetadataIndex {
|
public enum MetadataIndex {
|
||||||
iModule = 0,
|
iModule = 0,
|
||||||
iTypeRef = 1,
|
iTypeRef = 1,
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
enum MetadataVarType {
|
enum MetadataVarType {
|
||||||
end,
|
end,
|
||||||
stop,
|
stop,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class OptionalHeader : IFileLocation {
|
public class OptionalHeader : IFileLocation {
|
||||||
public ushort magic;
|
public ushort magic;
|
||||||
public byte majorLinkerVersion;
|
public byte majorLinkerVersion;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class PeImage {
|
public class PeImage {
|
||||||
BinaryReader reader;
|
BinaryReader reader;
|
||||||
BinaryWriter writer;
|
BinaryWriter writer;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
along with de4dot. If not, see <http://www.gnu.org/licenses/>.
|
along with de4dot. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class ResourceData : ResourceDirectoryEntry {
|
public class ResourceData : ResourceDirectoryEntry {
|
||||||
uint rva;
|
uint rva;
|
||||||
uint size;
|
uint size;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class ResourceDirectory : ResourceDirectoryEntry {
|
public class ResourceDirectory : ResourceDirectoryEntry {
|
||||||
Resources resources;
|
Resources resources;
|
||||||
int offset;
|
int offset;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public abstract class ResourceDirectoryEntry {
|
public abstract class ResourceDirectoryEntry {
|
||||||
protected readonly string name;
|
protected readonly string name;
|
||||||
protected readonly int id;
|
protected readonly int id;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class Resources {
|
public class Resources {
|
||||||
BinaryReader reader;
|
BinaryReader reader;
|
||||||
uint startOffset;
|
uint startOffset;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace de4dot.code.PE {
|
namespace de4dot.PE {
|
||||||
public class SectionHeader : IFileLocation {
|
public class SectionHeader : IFileLocation {
|
||||||
public byte[] name;
|
public byte[] name;
|
||||||
public uint virtualSize;
|
public uint virtualSize;
|
||||||
|
|
|
@ -30,7 +30,7 @@ using de4dot.blocks;
|
||||||
using de4dot.blocks.cflow;
|
using de4dot.blocks.cflow;
|
||||||
using de4dot.code.AssemblyClient;
|
using de4dot.code.AssemblyClient;
|
||||||
using de4dot.code.renamer;
|
using de4dot.code.renamer;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code {
|
namespace de4dot.code {
|
||||||
public class ObfuscatedFile : IObfuscatedFile, IDeobfuscatedFile {
|
public class ObfuscatedFile : IObfuscatedFile, IDeobfuscatedFile {
|
||||||
|
|
|
@ -21,7 +21,7 @@ using System.Collections.Generic;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.CliSecure {
|
namespace de4dot.code.deobfuscators.CliSecure {
|
||||||
public class DeobfuscatorInfo : DeobfuscatorInfoBase {
|
public class DeobfuscatorInfo : DeobfuscatorInfoBase {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.CliSecure {
|
namespace de4dot.code.deobfuscators.CliSecure {
|
||||||
class CodeHeader {
|
class CodeHeader {
|
||||||
|
@ -163,7 +163,7 @@ namespace de4dot.code.deobfuscators.CliSecure {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var metadataTables = peImage.Cor20Header.createMetadataTables();
|
var metadataTables = peImage.Cor20Header.createMetadataTables();
|
||||||
var methodDefTable = metadataTables.getMetadataType(PE.MetadataIndex.iMethodDef);
|
var methodDefTable = metadataTables.getMetadataType(MetadataIndex.iMethodDef);
|
||||||
if (methodDefTable.totalSize != codeHeader.methodDefElemSize)
|
if (methodDefTable.totalSize != codeHeader.methodDefElemSize)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ using Mono.Cecil.Cil;
|
||||||
using Mono.Cecil.Metadata;
|
using Mono.Cecil.Metadata;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.CodeVeil {
|
namespace de4dot.code.deobfuscators.CodeVeil {
|
||||||
class MethodsDecrypter {
|
class MethodsDecrypter {
|
||||||
|
|
|
@ -24,7 +24,7 @@ using Mono.Cecil.Cil;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.blocks.cflow;
|
using de4dot.blocks.cflow;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators {
|
namespace de4dot.code.deobfuscators {
|
||||||
abstract class DeobfuscatorBase : IDeobfuscator, IWriterListener {
|
abstract class DeobfuscatorBase : IDeobfuscator, IWriterListener {
|
||||||
|
|
|
@ -24,7 +24,7 @@ using Mono.MyStuff;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.blocks.cflow;
|
using de4dot.blocks.cflow;
|
||||||
using de4dot.code.renamer;
|
using de4dot.code.renamer;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators {
|
namespace de4dot.code.deobfuscators {
|
||||||
public interface IDeobfuscatorOptions {
|
public interface IDeobfuscatorOptions {
|
||||||
|
|
|
@ -22,7 +22,7 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.MaxtoCode {
|
namespace de4dot.code.deobfuscators.MaxtoCode {
|
||||||
// Decrypts methods and resources
|
// Decrypts methods and resources
|
||||||
|
|
|
@ -23,7 +23,7 @@ using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
||||||
class IniFile {
|
class IniFile {
|
||||||
|
|
|
@ -22,7 +22,7 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
||||||
// Find the type that decrypts strings and calls the native lib
|
// Find the type that decrypts strings and calls the native lib
|
||||||
|
|
|
@ -25,7 +25,7 @@ using Mono.Cecil;
|
||||||
using Mono.Cecil.Cil;
|
using Mono.Cecil.Cil;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
||||||
public class DeobfuscatorInfo : DeobfuscatorInfoBase {
|
public class DeobfuscatorInfo : DeobfuscatorInfoBase {
|
||||||
|
|
|
@ -23,7 +23,7 @@ using System.IO;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.blocks.cflow;
|
using de4dot.blocks.cflow;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
namespace de4dot.code.deobfuscators.dotNET_Reactor.v3 {
|
||||||
class MemoryPatcher {
|
class MemoryPatcher {
|
||||||
|
|
|
@ -25,7 +25,7 @@ using Mono.Cecil;
|
||||||
using Mono.Cecil.Cil;
|
using Mono.Cecil.Cil;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
||||||
public class DeobfuscatorInfo : DeobfuscatorInfoBase {
|
public class DeobfuscatorInfo : DeobfuscatorInfoBase {
|
||||||
|
|
|
@ -24,7 +24,7 @@ using Mono.Cecil;
|
||||||
using Mono.Cecil.Cil;
|
using Mono.Cecil.Cil;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
||||||
class MethodsDecrypter {
|
class MethodsDecrypter {
|
||||||
|
@ -170,7 +170,7 @@ namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
||||||
// DNR 4.0 - 4.4 (jitter is hooked)
|
// DNR 4.0 - 4.4 (jitter is hooked)
|
||||||
|
|
||||||
var metadataTables = peImage.Cor20Header.createMetadataTables();
|
var metadataTables = peImage.Cor20Header.createMetadataTables();
|
||||||
var methodDef = metadataTables.getMetadataType(PE.MetadataIndex.iMethodDef);
|
var methodDef = metadataTables.getMetadataType(MetadataIndex.iMethodDef);
|
||||||
var rvaToIndex = new Dictionary<uint, int>((int)methodDef.rows);
|
var rvaToIndex = new Dictionary<uint, int>((int)methodDef.rows);
|
||||||
uint offset = methodDef.fileOffset;
|
uint offset = methodDef.fileOffset;
|
||||||
for (int i = 0; i < methodDef.rows; i++) {
|
for (int i = 0; i < methodDef.rows; i++) {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using ICSharpCode.SharpZipLib.Zip.Compression;
|
using ICSharpCode.SharpZipLib.Zip.Compression;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
||||||
class NativeImageUnpacker {
|
class NativeImageUnpacker {
|
||||||
|
|
|
@ -23,7 +23,7 @@ using System.Collections.Generic;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
using Mono.Cecil.Cil;
|
using Mono.Cecil.Cil;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
namespace de4dot.code.deobfuscators.dotNET_Reactor.v4 {
|
||||||
class StringDecrypter {
|
class StringDecrypter {
|
||||||
|
|
|
@ -25,7 +25,7 @@ using System.Reflection;
|
||||||
using Mono.MyStuff;
|
using Mono.MyStuff;
|
||||||
using Mono.Cecil;
|
using Mono.Cecil;
|
||||||
using de4dot.blocks;
|
using de4dot.blocks;
|
||||||
using de4dot.code.PE;
|
using de4dot.PE;
|
||||||
|
|
||||||
namespace de4dot.mdecrypt {
|
namespace de4dot.mdecrypt {
|
||||||
public class DynamicMethodsDecrypter {
|
public class DynamicMethodsDecrypter {
|
||||||
|
@ -90,7 +90,7 @@ namespace de4dot.mdecrypt {
|
||||||
IntPtr ourCompMem;
|
IntPtr ourCompMem;
|
||||||
bool compileMethodIsThisCall;
|
bool compileMethodIsThisCall;
|
||||||
|
|
||||||
de4dot.code.PE.MetadataType methodDefTable;
|
de4dot.PE.MetadataType methodDefTable;
|
||||||
IntPtr methodDefTablePtr;
|
IntPtr methodDefTablePtr;
|
||||||
ModuleDefinition monoModule;
|
ModuleDefinition monoModule;
|
||||||
MethodDefinition moduleCctor;
|
MethodDefinition moduleCctor;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user