473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 2312
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: F. GEIGER | last post by:
Hi again, I'd like to rename a page of a notebook. Deleting the page and adding a new one is not really an option, because the page is filled with other controls already. So I looked into...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
1
by: Jed | last post by:
I have a DLL that I compiled to CodeAsset.dll. The version is 1.1.0.0. If I rename the file from CodeAsset.dll to CodeAsset.1.1.dll, reference it in a web project, recompile the web project,...
3
by: ineedahelp | last post by:
Hi, can anyone help me with the code necessary to rename a field in an access table. I have tried the ALTER TABLE method but it doesn't like my variable names. Here is the code and thank you for...
1
by: Carl Pearson | last post by:
Howdy, All, Was trying to modify all tables in a particular database starting with the same prefix, i.e., "tbl_". Decided I'd rather have them all start with "_tbl_" instead. Being lazy,...
5
by: NickP | last post by:
Hi there, I need to be able to change the name of my application through a pre-compile constant, is this possible? I want to try to avoid having 2 separate code trees for an application I am...
5
by: mythili123 | last post by:
The script will rename all files in the current directory whose names contain the first argument by replacing that part of the filename with the second argument. so far i could just get the file...
0
by: Rik Moed | last post by:
Hi all, I encounter a problem with a library method that should create a multi dimensional string array. Below is the method:...
2
by: =?iso-8859-1?b?cultaQ==?= | last post by:
Hi, I would like to rename files (jpg's ones) using a text file containing the new names... Below is the code that doesn't work : ***** #!/usr/bin/python #-*- coding: utf-8 -*- from os...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.