473,574 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.GetMet hods,
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 2334
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.co m

"Caroline" <ca******@nonon o.com> wrote in message
news:u8******** ******@TK2MSFTN GP14.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.GetMet hods,
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.c om> wrote in
message news:%2******** ********@TK2MSF TNGP10.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.co m

"Caroline" <ca******@nonon o.com> wrote in message
news:u8******** ******@TK2MSFTN GP14.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.GetMet hods,
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******@nonon o.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.GetMet hods,
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.GetHashC ode).

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.co m>
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
2474
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 Pmw.Notebook. There are quite a few lists and dicts which were to be changed and I wasn't successful in the first try. However, if nobody has ever done...
28
5189
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(); .... and then call the virtual method, why is it that the base class's method is called instead of the overridden method? How do I fix this if I...
1
2405
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, and the newly named file is in the bin directory, shouldn't the web project run fine? I did this and instead I get the following error: The...
3
5424
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 any help! ALTER TABLE tblClientTable RENAME COLUMN fldRateField TO "MarketPrice"
1
7003
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, didn't want to rename them one at a time. Finally:
5
1387
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 making, there are 2 variants, each with their own unique graphics, name, colours etc. I can do most of these via pre-compile constants but I have no...
5
2279
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 names that matches $ARGV.I need help on how to rename the files .For ex if argumnets are a bbb if a file name is rename.txt then O/P must be...
0
1343
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: -------------------------------------------------------------------------------- public class StringArrayLibrary { public void Create(ref string names)
2
3620
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 import listdir, getcwd, rename import re
0
7808
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7732
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7822
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5302
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3754
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2249
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1062
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.