6 Replies - 761 Views - Last Post: 29 December 2009 - 10:51 AM

#1 MeltingPoint  Icon User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 17
  • Joined: 31-March 09

Easy way of discriminating between .NET and non .NET apps?

Posted 29 December 2009 - 04:07 AM

I'm trying to figure out which apps that I have installed are".NET based". Usually one way to do it is to try a UPX packer on a executable. Since UPX packing does not work on .NET based executables, that is one easy way to do it. Another way is to check the dependencies or even simply run the app. (All standard forms-based .NET apps have a "certain" look to them. Big buttons, certain color-schemes, omnipresent DPI scaling issues.).

I was wondering if there was a easier and quicker way to do this than simply running every app or trying to UPX-it? Does any part of the WinOS or the .NET framework itself keep track of .NET executables in any way?

Is This A Good Question/Topic? 0
  • +

Replies To: Easy way of discriminating between .NET and non .NET apps?

#2 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5643
  • View blog
  • Posts: 12,359
  • Joined: 16-October 07

Re: Easy way of discriminating between .NET and non .NET apps?

Posted 29 December 2009 - 06:29 AM

Interesting question.

The easiest way would be to use .NET itself. Every .NET program, .exe or .dll can be loaded and manipulated. Knowing this, just try to load the file. If you succeed, it's .NET.

e.g.
void TestFile(string fileName) {
	Console.WriteLine(fileName);
	try {
		Assembly asm = Assembly.LoadFrom(fileName);
		Console.WriteLine(asm);
	} catch (Exception ex) {
		Console.WriteLine(ex.Message);
	}
}



There is some internal record keeping, in that .NET frameworks are cached in the OS; different versions do this differently. This is almost always the case with something "one click" launched from a web page. It is a true cache, though, so it's unlikely to enumerate all .NET programs on a given system as objects can age out.

It should be noted that .NET programs are not the resource hit you may believe. Or, more accurately, if you have any .NET programs, and running modern Windows this is inevitable, you've already taken the resource hit. A simple .NET program will use what's already been cached and may actually perform better than a standalone executable counter part.
Was This Post Helpful? 0
  • +
  • -

#3 MeltingPoint  Icon User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 17
  • Joined: 31-March 09

Re: Easy way of discriminating between .NET and non .NET apps?

Posted 29 December 2009 - 10:01 AM

Will try that. I'm writing an application (not in any .NET language) that traverses the client system and identifies any and all .NET based apps and then removes them (either through interaction with the user or silently) and then it finally removes all .NET framework installs. Basically, an app that makes a system .NET free.
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,222
  • Joined: 23-August 08

Re: Easy way of discriminating between .NET and non .NET apps?

Posted 29 December 2009 - 10:18 AM

Why the hell would you want to do that??? You're prepared to break people's systems? That's ridiculous, and I would say certainly borders on malicious.
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1633
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Easy way of discriminating between .NET and non .NET apps?

Posted 29 December 2009 - 10:22 AM

Personally if I ran a piece of software and it did that to my computer I would be so pissed, so what exactly is the reasoning behind something like this?
Was This Post Helpful? 0
  • +
  • -

#6 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5643
  • View blog
  • Posts: 12,359
  • Joined: 16-October 07

Re: Easy way of discriminating between .NET and non .NET apps?

Posted 29 December 2009 - 10:38 AM

You, um, do understand that the Windows OS and it's core components use the .NET framework? :blink:

Why don't your just search for kernel32.dll ( or similar ) and delete that? It should have roughly the same effect.
Was This Post Helpful? 0
  • +
  • -

#7 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1633
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Easy way of discriminating between .NET and non .NET apps?

Posted 29 December 2009 - 10:51 AM

Given that this kind of action can do nothing but harm a computer (as pointed out Windows requires the .Net Framework) i'm closing this thread before any more ideas are offered to you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1