|
We're currently looking at several obfuscators here, and the ones I've researched usually mention something about this. I actually encountered one that claimed it wouldn't break reflection, however, nearly all do. I know for a fact that DotFuscator (the one who's community edition is bundled with VS) won't work with reflection; any reflection calls, after they've been obfuscated, will thow an exception at runtime (ouch!).
Fortunately, most of the obfuscators I've tried allow shielding from obfuscation on a per-method basis, allowing you to workaround the problem. It's better just to avoid string reflection, IMO. If absolutely necessary, you could find the method using a custom attribute so it'd work even if obfuscated.
IMO, the obfuscators out there are way over-priced, don't work well, unprofessional (minus maybe XenoCode & WiseOwl), and just seem like a total hack to somewhat protect your code. I mean, you can still see the calls into the .NET assemblies (i.e. most of your code) which remain unobfuscated...
Then there are those apps like DotNetProtector, Thinstall, and others, that compress and encrypt your .NET assemblies into a single native executable. This seems like better protection, but the ones I've tried add a significant boot slow down; I remember DotNetProtector added about 3 seconds to the boot time of our large smart client app.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: The Secular Left, the Religious Right, and Prejudice
Judah Himango
|
|
|
|
|
Thanks for the response. I guess this doesn't bode well for things like declarative programming, where you use reflection to instantiate object graphs of, well, just about anything. Probably a good argument for compiling the declarative markup into code.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
I see it like this.
if you use reflection on private members , those members are a part of your API, even if they are private they are still inteded to be used by something on the outside.
and you should not obfuscate the API , only the private implementation.
and dotfuscatior has settings for most of that kind of stuff in the full version.
//Roger
|
|
|
|
|
I'm working on a voice key to be written in C#.
What I need to do is be able to take input from a microphone and measure the onset of vocal input. However, I don't know how I can read input directly from the mic jack in real time. What is the best approach to this?
|
|
|
|
|
There are articles on audio recorders here on CP.
Try searching the multimedia zone.
Regards,
mav
|
|
|
|
|
Hi,
Yesterday I found an application on the Internet that claimed that it managed to browse the source of any .NET application. In curiousity I downloaded it, installed it and tried to view the source of one my projects. Surprisingly it worked.
... which isn't too good!
Professionally it has to be impossible to work with a language that everyone can decompile after it's compiled! How do you do to protect your applications? Is there any methods that prevents this horrible feature? And why did Microsoft implent such redicilous feature?
// Zanathel
|
|
|
|
|
What you need is an Obfuscator for you code. Search for it on Google you will find more then enough information about them out there.
|
|
|
|
|
It's not a ridiculous feature, but an unfortunate side-effect of using an intermediate, hardware-independant language that all managed code is compiled into. The .NET Framework, at execution time, then takes that code, called MSIL, and translates it into instructions that the processor can actually execute.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Zanathel wrote:
Surprisingly it worked.
Not really. There is a little app that comes with the .NET framework that will do this also. It won't show you the original C# like some applications, but it will show the MSIL which, for the most part, can be easily read and understood.
Zanathel wrote:
Professionally it has to be impossible to work with a language that everyone can decompile after it's compiled!
Even C and C++ can be decompiles after it is compiled. That is why software licenses have had for many years a thou shalt not reverse engineer clause in them. While it is more difficult with a C or C++ application (because it doesn't have any metadata) it is still possible.
Zanathel wrote:
And why did Microsoft implent such redicilous feature?
The feature is not being able to reverse compile the application per se, but so that features such as reflection can work. This can be a very powerful feature which can make development a lot easier.
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Zanathel: could you give the link to this decompiler? I'm really curious how it works!
|
|
|
|
|
|
|
I've got a string
@"\fs17 someTextHere\"
where 17 could be any number
I'd like to extrract the "someTextHere" part from the string using a regular expression.
The regular expression
@"\\fs(\d{1})+ (\w|\W)+\\"
will match the entire string; but I only want to find out the "someTextHere" part of the string. Could any of the regular expression experts here help me out?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: The Secular Left, the Religious Right, and Prejudice
Judah Himango
|
|
|
|
|
@"\\fs\d+ (\w|\W)+\\"
Now you have only one grouping, which is the word. You can get this group out of your regex match, it has a property or something to access it. Any bracket will generate a group. From memory, the array is 1 indexed, with the 0 index containing the whole match.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks Christian; I was totally oblivious to the groups property, much appreciated. For the record, I ended up modifying the pattern a bit:
<br />
@"\\fs\d+ (\w+|\W+)\\"
As the previous one grouped only a single character (the plus sign was outside the parentheses).
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: The Secular Left, the Religious Right, and Prejudice
Judah Himango
|
|
|
|
|
Judah Himango wrote:
As the previous one grouped only a single character (the plus sign was outside the parentheses).
Sorry, I just copied that bit from yours, I didn't really check it
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
|
how can i have the computername in a simple windows application with c#
thanks
prog
|
|
|
|
|
I am assuming you are asking how you could get the computer name in a simple windows app? You could query the WMI for the computername.
Eric
|
|
|
|
|
For a much easier method, you'll find the computer name in the MachineName property of the Environment class.
String computerName = Environment.MachineName;
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
is it possible for this to be done for application running in a terminal services environment..can the name of the computer that is connecting to the app via terminal services be captured??
Afzal Hassen
|
|
|
|
|
Not that I know of. Since the application is always running on the server, it'll always return the name of the server. It has no way of knowing that it is running under a TS session since the .NET Framework doesn't expose any of the TS functionality. You'll have to look into calling the TS API directly to see if you can get the name of the computer that started the session.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i have dabbled with the WTSQueryUserConfig API call,and it does return the name of the computer, thanks for that input...
would you by any chance know how i can access the client computer hardware information via TS?? or of any articles that can help me accomplish this??
Thanks
Afzal Hassen
|
|
|
|
|
TS doesn't care about the client hardware at all, so it's not going to give you access to it. But, there's always one of these, once you get the client computer name from WTSQueryUserConfig, you can use it to connect back to the client machine and query WMI (if available!) to get its hardware details.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|