471,305 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,305 software developers and data experts.

Rename all method names in an assembly

I have a CF app and I haven't found a decent obfuscator for it. I want to
write a simple obfuscator, that replaces variables and methods names. Is
there any way to rename all method names returned by Assembly.GetMethods,
for instance, method names, my own methods and other methods such as
GetType, GetHashCode, Equals, ToString - in order to scramble the code? Any
ideas on how to do this?

Thanks!
Jan 21 '06 #1
3 2155
Caroline,

What is it that you don't like about the other obfuscators? You know
that if you change those method names, you will have to change all the
references to your libraries (if that matters to you), since the signatures
are different (if you change the signature names, you have to recompile).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Caroline" <ca******@nonono.com> wrote in message
news:u8**************@TK2MSFTNGP14.phx.gbl...
I have a CF app and I haven't found a decent obfuscator for it. I want to
write a simple obfuscator, that replaces variables and methods names. Is
there any way to rename all method names returned by Assembly.GetMethods,
for instance, method names, my own methods and other methods such as
GetType, GetHashCode, Equals, ToString - in order to scramble the code? Any
ideas on how to do this?

Thanks!

Jan 21 '06 #2
They simply don't work well with CF. I've tried xenocode, the resulting
assembly is more than twice the size, and my resulting exe doesn't work, or
others are way too expensive to even consider. Do you know of a simple thing
I could do to obfuscate my code? I don't really need anything fancy. I've
researched writing the key license code in unmanaged and loading from a dll
using reflection, etc.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
Caroline,

What is it that you don't like about the other obfuscators? You know
that if you change those method names, you will have to change all the
references to your libraries (if that matters to you), since the
signatures are different (if you change the signature names, you have to
recompile).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Caroline" <ca******@nonono.com> wrote in message
news:u8**************@TK2MSFTNGP14.phx.gbl...
I have a CF app and I haven't found a decent obfuscator for it. I want to
write a simple obfuscator, that replaces variables and methods names. Is
there any way to rename all method names returned by Assembly.GetMethods,
for instance, method names, my own methods and other methods such as
GetType, GetHashCode, Equals, ToString - in order to scramble the code?
Any ideas on how to do this?

Thanks!


Jan 21 '06 #3
Caroline <ca******@nonono.com> wrote:
I have a CF app and I haven't found a decent obfuscator for it. I want to
write a simple obfuscator, that replaces variables and methods names. Is
there any way to rename all method names returned by Assembly.GetMethods,
for instance, method names, my own methods and other methods such as
GetType, GetHashCode, Equals, ToString - in order to scramble the code? Any
ideas on how to do this?


For one thing, you *can't* rename methods like GetHashCode. They're
inherited from System.Object, and the runtime will be assuming they're
there (or rather, your code will be assuming that what you've written
as GetHashCode will be overriding Object.GetHashCode).

The best you'd be able to do is rename all of the names you've
introduced yourself.

This isn't a trivial task, however - I suspect you'd find it's cheaper
to work with obfuscator vendors to get something working based on their
existing codebase rather than writing your own.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 22 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by F. GEIGER | last post: by
28 posts views Thread by Jon Davis | last post: by
1 post views Thread by Jed | last post: by
1 post views Thread by Carl Pearson | last post: by
5 posts views Thread by NickP | last post: by
5 posts views Thread by mythili123 | last post: by
2 posts views Thread by =?iso-8859-1?b?cultaQ==?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.