Commit Graph

152 Commits

Author SHA1 Message Date
de4dot
77f1f2de67 Rename custom attribute fields and properties 2012-03-03 06:13:35 +01:00
de4dot
0b43c77fdb Add missing call to removeNewlines() 2012-02-05 18:45:41 +01:00
de4dot
1141a451ac Update resource renamer code.
- Faster code
- Renames resource even if it doesn't end in '.resources'
2012-01-28 18:37:02 +01:00
de4dot
257456fd8b Speed up renaming by storing less names in the typeNames dict.
merge() was pretty slow but is much faster now.
2012-01-28 00:17:00 +01:00
de4dot
9e1412a6ae Use TryGetValue to speed it up a little 2012-01-27 05:54:30 +01:00
de4dot
50e7d28ddf Speed up method param renaming code 2012-01-27 05:39:25 +01:00
de4dot
cf1ed9fb64 Use a MethodDefKey
Fixes problem when a class implements an interface that its base class
also implements, but those interfaces are in two different assemblies
(different version, eg. mscorlib 2.0 and mscorlib 4.0).
2012-01-23 09:14:50 +01:00
de4dot
52e7b2926f Use non-renamable prop/event since it should be valid 2012-01-22 23:47:35 +01:00
de4dot
2dadd773ec Use ParameterDefinition.Sequence 2012-01-21 20:31:47 +01:00
de4dot
04903f0f9b Don't append a 0 to props when we've found the real name 2012-01-18 08:14:06 +01:00
de4dot
a92bbbe9c3 Warn if method isn't found since some obfuscators are buggy. 2012-01-17 05:44:22 +01:00
de4dot
0d0a40376d Update copyright years 2012-01-09 23:02:47 +01:00
de4dot
6a8a036687 Add another check to detect COM type 2012-01-09 06:13:55 +01:00
de4dot
0398666c93 Update detection of <Module> type 2012-01-08 18:46:23 +01:00
de4dot
d295fa24a2 Ignore refs and defs from other modules 2012-01-08 01:30:57 +01:00
de4dot
951906d7e5 Move file 2012-01-07 00:05:43 +01:00
de4dot
93d801997e Make sure the new property names are unique 2012-01-04 09:42:01 +01:00
de4dot
9a7d28472d Remove new lines when printing method/type names 2012-01-03 19:52:40 +01:00
de4dot
7d39c543cc Refactor code 2012-01-01 13:02:16 +01:00
de4dot
ac30b8c213 Rename method to getValues() 2012-01-01 12:09:16 +01:00
de4dot
970ef14266 Restore method arg names 2012-01-01 12:07:16 +01:00
de4dot
66b3061444 Remove useless method and only rename if not renamed 2012-01-01 12:06:40 +01:00
de4dot
288aa20c5c Update namespace renaming code
Two different namespaces with the same names in different modules will now
be renamed to two different names, eg. ns0 and ns1 instead of the same
name, eg. ns0.
2011-12-29 14:16:00 +01:00
de4dot
08eafd1080 Remove useless overrides 2011-12-29 14:04:43 +01:00
de4dot
ad59501474 Add findAny() methods 2011-12-28 13:24:02 +01:00
de4dot
c295d03078 Remove namespace from nested types 2011-12-25 23:03:53 +01:00
de4dot
c1838bec35 Update log messages 2011-12-23 17:48:10 +01:00
de4dot
f7f77a821c Use the SetMethod property 2011-12-19 15:43:40 +01:00
de4dot
dd8d0d0e83 Use new method/field dictionaries 2011-12-16 19:33:44 +01:00
de4dot
f30b0ef749 Add type, method, field, prop, event dictionaries 2011-12-16 18:56:45 +01:00
de4dot
e7ea01f87d Move console code to new de4dot.cui assembly 2011-12-09 09:02:06 +01:00
de4dot
5ccc8e0fda Add prop/event override prefix 2011-12-06 02:45:28 +01:00
de4dot
731d302741 Pass the getter and setter methods to createProperty() 2011-12-05 23:47:48 +01:00
de4dot
6073106cfe Restore explicitly overridden props/events 2011-12-05 18:11:34 +01:00
de4dot
427abbce79 Update detection of WinForms field names 2011-12-04 19:09:21 +01:00
de4dot
99cec56165 Update renamer code. Check for unresolved type and generic params 2011-12-04 18:22:47 +01:00
de4dot
c9d4dc2268 Update renamer code so a compiler can compile the decompiled output
- property Byte[]_0 => Byte_0
- property ICollection.Boolean_0 => ICollection.IsSynchronized
- property pByte_0 => PByte_0
- property T_0 => Prop_0
- property indexer => Item
2011-12-03 14:28:10 +01:00
de4dot
af0ff59794 Always rename P/Invoke methods 2011-12-02 13:18:22 +01:00
de4dot
d913c61df6 Fix some todos 2011-12-02 00:43:49 +01:00
de4dot
2734a9ee95 Update the code that resolves typedefs 2011-12-01 22:32:09 +01:00
de4dot
d6ba1fa2d5 Add p prefix to types 2011-12-01 22:30:43 +01:00
de4dot
26f4afeff3 Rename class to StreamXXX if it's a stream class 2011-11-30 18:24:43 +01:00
de4dot
cfe85774ab Method prefix should be an empty string 2011-11-25 15:17:12 +01:00
de4dot
716870b4bd Make sure InitializeComponent() detection code is called 2011-11-24 10:07:55 +01:00
de4dot
a0f5a109dd Add p prefix if it's a pointer type 2011-11-24 05:25:04 +01:00
de4dot
9d61d9845d Don't add an override prefix if one of the methods is an iface method 2011-11-23 14:39:52 +01:00
de4dot
99d52b90c5 Revert older commit and print method override prefix 2011-11-23 12:13:41 +01:00
de4dot
ae5001b239 Make sure initializeEventHandlerNames() is called after renaming props 2011-11-23 11:34:11 +01:00
de4dot
f7b117fe18 Restore events 2011-11-23 06:41:28 +01:00
de4dot
550ea19c0b Rename nullable types to better names, eg. int_0 instead of nullable_0 2011-11-23 05:09:34 +01:00
de4dot
1e22947f6a Don't add prop/event 'other' methods to props/events list 2011-11-23 04:42:13 +01:00
de4dot
8d5dae6dcf Update code to pass the new test 2011-11-22 15:56:48 +01:00
de4dot
d4c4d0a425 Don't add override prefix if scope has 2+ methods 2011-11-22 09:49:59 +01:00
de4dot
33f9a466a1 Don't add method to overrideMethods if it already overrides that iface method 2011-11-22 08:57:10 +01:00
de4dot
45cd6bf211 Update the code that renames virtual methods, props, events 2011-11-22 08:14:34 +01:00
de4dot
9953111d1c Rename event add/remove methods' last arg to value 2011-11-21 11:26:02 +01:00
de4dot
c1ef76fda4 Use correct name when renaming event handlers 2011-11-21 10:56:18 +01:00
de4dot
b2b563ef22 Add more renamer code 2011-11-21 10:36:23 +01:00
de4dot
1b0fbfc681 Add more renamer code 2011-11-18 16:55:54 +01:00
de4dot
e9e0588cb6 Use Utils.StartsWith() since mono's impl is buggy 2011-11-17 04:22:12 +01:00
de4dot
195c7194cb Rename types 2011-11-17 04:17:03 +01:00
de4dot
b58c3843e3 Add code to map virtual methods to base/iface methods 2011-11-16 23:08:27 +01:00
de4dot
fa2f0808b1 Add some renamer classes 2011-11-15 14:26:51 +01:00
de4dot
e5da0a1255 Move old renamer code 2011-11-14 21:39:44 +01:00
de4dot
c68540aed7 Remove catch all exception and use latest cecil submodule 2011-11-14 09:44:39 +01:00
de4dot
d3996b5152 Any type of exception could occur. 2011-11-12 21:01:58 +01:00
de4dot
fdd6e55587 Sort the list of namespaces before printing the result 2011-11-10 00:57:27 +01:00
de4dot
c562c335e8 Add option to remove namespace if there's only one class in it 2011-11-09 12:08:48 +01:00
de4dot
ff0c0cddbd Update WinForms renaming code 2011-11-09 11:28:34 +01:00
de4dot
4ecedb5b01 Don't check whether method is virtual 2011-11-06 12:17:20 +01:00
de4dot
75a464a7f4 Merge branch 'master' into dnr 2011-11-05 14:27:40 +01:00
de4dot
51fc70169d Handle case where asm resolver returns a later version 2011-11-05 13:58:03 +01:00
de4dot
432c321bab Catch SecurityDeclaration resolve exception 2011-11-05 10:30:38 +01:00
de4dot
a23a889776 Ignore resolve errors. It's likely an obfuscator bug. 2011-11-05 08:08:16 +01:00
de4dot
c66c062753 Fix problem when HasPInvokeInfo == true but PInvokeInfo == null 2011-11-05 07:46:24 +01:00
de4dot
f524989a1e Re-arrange some code 2011-11-05 07:42:58 +01:00
de4dot
2236300943 Update renamer to better rename methods and args
Finds InitializeComponent() method and renames it if necessary.
Finds all event handlers and names the args sender and e respectively.
Finds all field event handlers and names them <field>_<event>, eg.
button_Click.
2011-11-04 19:08:23 +01:00
de4dot
7486b73da3 Restore original WinForms class and field names 2011-11-04 15:39:16 +01:00
de4dot
df507526ba Update renamer code so it's less likely to use an existing name 2011-11-04 13:59:43 +01:00
de4dot
bd3b1e9b20 Check for null before calling unload() 2011-11-04 07:33:14 +01:00
de4dot
42e7583659 Unload loaded modules when renaming is over 2011-11-03 18:55:14 +01:00
de4dot
98cdcf9ca5 Only protect *Invoke methods. Rename and remove a variable 2011-11-03 18:53:58 +01:00
de4dot
3dd8649859 Merge branch 'master' into dnr 2011-11-03 07:11:10 +01:00
de4dot
f351a09564 Update symbol renamer to load referenced assemblies.
This way it's possible to use a rename-all regex (.*) without renaming
symbols that shouldn't be renamed (eg. methods that are defined in an
interface in a non-deobfuscated module, eg. Dispose()). A warning is
displayed if an assembly can't be loaded.
2011-11-03 06:43:33 +01:00
de4dot
96d086ba2b Merge branch 'master' into dnr 2011-11-02 05:58:12 +01:00
de4dot
2a967dc699 Call onTypesRenamed() a little later and update throw message with token 2011-11-02 05:57:10 +01:00
de4dot
c918c8e964 Merge branch 'master' into dnr 2011-11-02 04:57:13 +01:00
de4dot
78960c759c Rebuild dictionaries when types have been renamed 2011-11-02 04:54:54 +01:00
de4dot
b8879e74e6 Merge branch 'master' into dnr 2011-11-02 04:26:12 +01:00
de4dot
ccff408a00 Update code so it can rename duplicate member references 2011-11-02 04:24:22 +01:00
de4dot
ade1720d32 Use type cache to look up types (huge speedup in DNR code) 2011-11-02 02:25:07 +01:00
de4dot
5185dc8364 Throw if PInvokeInfo is null. The type was probably removed. 2011-10-31 00:18:11 +01:00
de4dot
08f5b04675 Fix a problem with String.StartsWith() on mono 2011-10-09 13:19:26 +02:00
de4dot
5eb824693e Don't throw if invalid visibility 2011-10-08 18:42:09 +02:00
de4dot
bea3a737d2 Don't rename resource if old name was empty string 2011-10-08 12:17:01 +02:00
de4dot
d2b621b5b3 Netmodules are better supported now 2011-10-05 08:20:32 +02:00
de4dot
062ecaaef2 Ignore emtpy strings when renaming resources in code 2011-09-29 19:00:34 +02:00
de4dot
b71eb587db Make sure field/method ref has a declaring type before resolving it 2011-09-29 10:51:21 +02:00
de4dot
cd0e5c0169 Updated resource renaming of code strings 2011-09-27 23:29:38 +02:00
de4dot
c257f16787 Methodsrewriter is now working 2011-09-27 22:06:43 +02:00