Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 02-15-2013, 07:20 AM   #1
Fully Optimized
 
ssc456's Avatar
 
Join Date: Jan 2007
Posts: 4,279
Send a message via MSN to ssc456
Default C# .net DLL Decompiler

Hey Guys,

I'm in a bit of a pickle, I use a third party tool called GMS Marquee, now we have a license that we paid for this and it was working fine for the last 5 years up until a couple of months ago.

Unfortunately the company we bought the tool from has been taken over and is now a oil company? (Global Majic Software).

The problem we have is that I've upgraded my version of Visual Studio and a couple of other third party components and during the upgrade this third party tool has now decided that it doesn't like our license key.

I've used a couple of programs like Telerik Just Decompile or ILSpy which work great for getting in and looking at the code and even producing new C# projects however the variables are all over the place.

I've got a couple of classes where I have 13 different variables all called A . . . . .

Does anyone know of any other decompiler tools which will try and deal with the variables a little better?

P.S we do have a license for this!
__________________

__________________
He who has never failed has never attempted anything worth succeeding at.

Dont Eat Animals, Its Not Good For Them And They Dont Like It!
ssc456 is offline   Reply With Quote
Old 02-15-2013, 09:35 AM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: C# .net DLL Decompiler

You should contact AVEVA (the company that bought GMS).
assuming that they bought the company, (and not just their assets) then they may be able to help you.

Failing that if they won't help you then you're stuck.

A part of your license to use the software surely says that you won't try to de-compile the software, especially not to make your own version.

If you can't make it work then you're stuck, and forum rules are going to mean that we can't help you to break the contract that you signed when you bought the software.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 02-15-2013, 10:23 AM   #3
Fully Optimized
 
ssc456's Avatar
 
Join Date: Jan 2007
Posts: 4,279
Send a message via MSN to ssc456
Default Re: C# .net DLL Decompiler

Quote:
Originally Posted by root View Post
You should contact AVEVA (the company that bought GMS).
assuming that they bought the company, (and not just their assets) then they may be able to help you.

Failing that if they won't help you then you're stuck.

A part of your license to use the software surely says that you won't try to de-compile the software, especially not to make your own version.

If you can't make it work then you're stuck, and forum rules are going to mean that we can't help you to break the contract that you signed when you bought the software.
Interesting thoughts, I have contacted the company that bought them and unfortunately they basically said that they don't support or pretty much even speak to people about GMS stuff anymore.

Which brings me to my next point, if you agree and pay for a license from a company which is an agreement of on-going support for the product and constant use of the product (ie no reoccurring payments etc) and that company ceases to exists and the new company fails to uphold their end of the license agreement does that not mean that any agreement made between us and GMS is now void?

I appreciate and respect the forum rules and if you guys can't help me on here that's a shame.

Thanks
__________________
He who has never failed has never attempted anything worth succeeding at.

Dont Eat Animals, Its Not Good For Them And They Dont Like It!
ssc456 is offline   Reply With Quote
Old 02-15-2013, 02:38 PM   #4
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: C# .net DLL Decompiler

Quote:
I've used a couple of programs like Telerik Just Decompile or ILSpy which work great for getting in and looking at the code and even producing new C# projects however the variables are all over the place.

I've got a couple of classes where I have 13 different variables all called A . . . . .
Sounds potentially obfuscated to me.

What did the program do? Is it something that can be replicated with free tools, or not really? How long did the license period last for, and did it include support?

Legally speaking, it's an interesting area, and not necessarily in a good way. If the company was bought in full by some other company, then the new company now owns all copyrights / software / patents that the former company did. It also, as far as I'm aware, inherits all support contracts, debts, and so on - so if you're entitled to support for X more years through this agreement, they're (probably) legally obliged to give it to you. However, whether it's worth you going down the enforcement route if they're not is seriously doubtful.

Of course, this also means they carry on holding the copyright for this program, whether they use it or not, and could thus make legal claims if they find you're violating the terms of service. Now, I don't know whether this expressively forbids decompilation or not, but even if it doesn't it sounds like they've run it through an obfuscator which means extracting the source is going to be, while not impossible, likely extensively infeasible.

So you've got a few options going forward, none of which sound particularly enticing - sorry about that!
__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Old 02-18-2013, 06:37 AM   #5
Fully Optimized
 
ssc456's Avatar
 
Join Date: Jan 2007
Posts: 4,279
Send a message via MSN to ssc456
Default Re: C# .net DLL Decompiler

Well it's a ticker tape or Marquee (depending on what you want to call it) scrolling txt type thing.

I know there are many alternatives out there and we are currently upgrading to a Telerik version however we have existing customers about 90 or so of them using the old version and what it means at the minute is if any of them would like any development work done, we can do the development work but when we roll it out to them their software starts saying Evaluation mode for the Marquee component.

I've used a couple of DLL de-compilers however they throw all of the variables out and decide to rename them all A.
__________________
He who has never failed has never attempted anything worth succeeding at.

Dont Eat Animals, Its Not Good For Them And They Dont Like It!
ssc456 is offline   Reply With Quote
Old 02-19-2013, 05:16 AM   #6
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: C# .net DLL Decompiler

Quote:
Originally Posted by ssc456 View Post
Well it's a ticker tape or Marquee (depending on what you want to call it) scrolling txt type thing.

I know there are many alternatives out there and we are currently upgrading to a Telerik version however we have existing customers about 90 or so of them using the old version and what it means at the minute is if any of them would like any development work done, we can do the development work but when we roll it out to them their software starts saying Evaluation mode for the Marquee component.

I've used a couple of DLL de-compilers however they throw all of the variables out and decide to rename them all A.
There are two things that you can do.

Call the company that bought out GMS beg and plead, tell them that you need support, that you bought a product with support, and sine GMS has become this company you would expect support from them, and they should have realised there would be a duty to provide it.

They probably don't want to provide support because it's expensive, but it's hardly your fault if they failed in their due diligence to realise that there may be ongoing support obligations to customers.



The other things that you can do:
Change the component you're using.

Use an older version of visual studio for supporting your legacy customers.

This is always an issue when using 3rd party components, you don't have the source you don't control the software.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 02-19-2013, 06:46 AM   #7
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: C# .net DLL Decompiler

Quote:
Originally Posted by root View Post
There are two things that you can do.

Call the company that bought out GMS beg and plead, tell them that you need support, that you bought a product with support, and sine GMS has become this company you would expect support from them, and they should have realised there would be a duty to provide it.

They probably don't want to provide support because it's expensive, but it's hardly your fault if they failed in their due diligence to realise that there may be ongoing support obligations to customers.



The other things that you can do:
Change the component you're using.

Use an older version of visual studio for supporting your legacy customers.

This is always an issue when using 3rd party components, you don't have the source you don't control the software.
Root has it bang on - these are your options (if one decompiler does that then all the others will generally produce the same result, it's pretty much impossible to code an "un-obfuscator".)

Take a special note of the last bit - I know this is a bit late, but I'd never use closed source 3rd party components for this reason... or at least have a thorough look around for alternatives first.
__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Old 02-22-2013, 03:43 AM   #8
Fully Optimized
 
ssc456's Avatar
 
Join Date: Jan 2007
Posts: 4,279
Send a message via MSN to ssc456
Default Re: C# .net DLL Decompiler

Thanks for your responses guys I think you are right, I've tried the de-compiler and then I've tried painstakingly going through all of the lost variable names and renaming them then going through all of the source code and sticking the variables back in but honestly it's going to be more cost effective (when my time is factored in) to find another 3rd party component!

Thanks for your help and advice!
__________________
He who has never failed has never attempted anything worth succeeding at.

Dont Eat Animals, Its Not Good For Them And They Dont Like It!
ssc456 is offline   Reply With Quote
Old 03-03-2013, 08:26 PM   #9
BSOD
 
Join Date: Feb 2013
Location: Parallel Universe
Posts: 313
Default Re: C# .net DLL Decompiler

is a decompiler the opposite of a compiler in that it displays the programs soruce code?
XPikachu is offline   Reply With Quote
Old 03-04-2013, 08:37 AM   #10
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: C# .net DLL Decompiler

pretty much yes.

it's unlikely to show you the "exact" source code.

but if I had a statement like.

if data1 = data2 then
{
echo yes
}
else
{
echo no
}

when this get's compiled it'll be reduced to a statement where value of data1 is loaded into a register, value of data2 is loaded into a different register,
a compare function is performed.
then a branch function is performed (where registers are loaded with values to display yes).
if the compare function returns different results, then a different branch statement would be executed with registers loaded to display no.

then there will be a return to stack type statement at the end of each of the branched piece of code.


so,
if (data1 == data2)
{
prinft("yes");
}
else
{
printf("no");
}

in C is compiled to something like.

LDD A data1
LDD B data2
CMP a B
BRA sub1 0
BRA sub2 1

:sub 1
...write yes...
RTS

:sub2
...write no...


then that gets compiled from assembly into a byte code.
0f 09 90 89 aa be 6f 7f ff ... kind of thing...

those byte codes map pretty much exactly to functions in assembly. (there may be more or less instructions depending on whether you're dealing with a reduced instruction set or a complex instruction set. so the actual chip instructions will say that the ldd A (load accumulator A) function is actually the byte code 01 (in hex) for a given chip.


so the first job the decompiler will do is turn
then that gets compiled from assembly into a byte code.
0f 09 90 89 aa be 6f 7f ff

back into that assembler.

ldd a variable1
lbb b variable2
cmp a b
bra (so on and so forth)

then the compiler will say, well, I can see that I loaded two values and compared them, so that's what happens when an if statement is compiled.

then it sees that if the condition is true is branches to sub1, -where it can see the word yes is displayed if it's not true then it branches to sub2 -where it sees the word no is displayed...


so it transforms that assembally into
if (variable1 == variable2) { printf("yes"); }
else { printf("no"); }

but you see the problem right? some information was lost in compilation.
comments were not saved, so we may struggle to understand what some functions do.

variable names are not saved, and are so given generic names...
where something may have been obvious before like
fullname = strcat(firstname, lastname);
now becomes
var1 = strcat(var2, var3); it's still obvious that it's a catenation of two strings, less obvious why this is being done!

also where we may have repeating functions,
say we call
data3 = my_func(data1, data2)
a lot, (because data 1 and data 2 keep changing.)

well the decompiler might not know that we'd used a separate function for what we were doing, and therefore may put that same function over and over in the source code.


Basically, during compilation of code, a lot of information is lost,
this can never be replaced exactly by a decompiler.

decompilers do have a place. but they are incredibly difficult to use.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 01:15 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0