Legal Issues

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
TheDragon
Member
Member
Posts: 43
Joined: Mon Aug 25, 2008 8:23 pm
Location: Middle of Nowhere

Legal Issues

Post by TheDragon »

Hello there. I have decided to not try to recode Windows, but I was thinking more along the lines of a program that disassembles the code of commercial Windows programs and reassembles into my OS's executable format. However, many programs that are for windows do not allow the user to disassemble it or "reverse engineer" it in any way. However, according to several definitions, reverse engineering involves taking a thing apart to see how it works, especially so they can reimpliment it, etc. However, this would be just so they can use the product. I'm just checking for legality because of my budget (~$0) and my lawyer (*NULL)(OK, that was a lame joke, but still...). Thanks.
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Legal Issues

Post by PatrickV »

First of all microsoft does not like people disassembling their operating systems and their software that are made by them. It is againest the licence agreement. If you like to make people programs work in your os version you have to ask them first who created the software. You just not allowed to do that at all in case. I would quite now becasue all you might get is a "NO!" from software developers
My View is stay out kitchen before you create a fire
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Legal Issues

Post by Brendan »

Hi,

I'm not a lawyer.

AFAIK the utility itself would be perfectly legal, but using the utility in certain ways wouldn't be legal. For example, anyone who writes any application for Windows would be able to use the utility to port their application to your OS (for e.g. so they could sell a version of their application for your OS). Also, the licenses for certain applications would allow it (e.g. open source applications).

If someone does use your utility in an illegal way, then AFAIK that's not your problem. Just like if someone makes a hammer (intended for building houses) and someone uses it to kill someone, then the manufacturer of the hammer isn't responsible for that. I would put some sort of disclaimer in the utility though - something saying "this utility is intended to make it easy for programmers to port their software, and you don't accept responsibility for people using the utility for purposes it wasn't intended to be used for".

However, for almost all of the cases where your utility could be used legally (commercial application developer porting their own application, or someone porting an open source application), the source code for the application is also available to whoever is doing the porting. IMHO this means it'd be more practical to write a few compilers for your OS (or port GCC or something), so that people can compile the source code as a native application for your OS instead of using a utility to disassemble and re-target a Windows binary. This also allows them to do things like "#if WINDOWS { foo } #elseif PATRICK { bar } #endif" to take advantage of any special features you provide that makes your OS better than Windows (even if it's only better in specific situations).

The biggest problem would be implementing a utility that actually does work; and trying to figure out what you're going to do about Microsoft's DLLs (and any other DLLs that the application depends on that weren't written by the same people as the application).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Velko
Member
Member
Posts: 153
Joined: Fri Oct 03, 2008 4:13 am
Location: Ogre, Latvia, EU

Re: Legal Issues

Post by Velko »

I think Mingw's or Cygwin's objcopy should be able to convert PE to ELF (or some other common format). You could implement PE loader for your OS as well. However, it won't help you much. You need at least some subset of Windows API (ported DLLs or your own implementation) to be able to run Windows executables.
If something looks overcomplicated, most likely it is.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Legal Issues

Post by Combuster »

I can imagine converting windows applications for which the developer never bothered to make it run on other OSes (i.e. for the end user rather than developer)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Legal Issues

Post by Brendan »

Hi,
Combuster wrote:I can imagine converting windows applications for which the developer never bothered to make it run on other OSes (i.e. for the end user rather than developer)
If you copy a book and make an identical book, then you'd need the copyright holder's permission. However, if you copy a book into an extremely different format (e.g. braille, an audio tape, etc) then that makes no difference and you still need the copyright holder's permission. The same would apply to software - if you convert a Windows binary into a completely different form, then you still need the copyright holder's permission.

For "fair use" copyright exceptions, different countries have different rules. For example, for where I live (Australia) the Wikipedia says: "Under current Australian law it is still a breach of copyright to copy, reproduce or adapt copyright material for personal or private use without permission from the copyright owner."

It's fairly clear to me that anyone in Australia would need permission from the copyright holder to use this utility.

So, how many pieces of software can you think of where the license allows copying but source code isn't available (where a utility like this can be used legally but re-compiling from source isn't an option)? I'm guessing there might be a few pieces of freeware software, but not enough pieces of software to make this sort of utility a viable option (considering the additional complexity involved in implementing something like this compared to implementing or porting a suitable compiler).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Walling
Member
Member
Posts: 158
Joined: Mon Dec 04, 2006 6:06 am
Location: Berlin, Germany

Re: Legal Issues

Post by Walling »

Is it me or isn't this application just some sort of virtualization? As far as I know QEMU does exactly that: It recompiles the guest system (several kernel space instructions in special) to something that runs on the host. If I have the license to Windows, I can IMHO use QEMU to run it. If the problem is that you translate Windows programs to your own object format statically, then just do it dynamically and call it a virtual machine. Of course the user must have license to run the program.
User avatar
TheDragon
Member
Member
Posts: 43
Joined: Mon Aug 25, 2008 8:23 pm
Location: Middle of Nowhere

Re: Legal Issues

Post by TheDragon »

OK. Thanks for your input so far, but it seems there has been a little misunderstanding as far as what my idea is. It's like you have a windows program, right? You get my OS (still working on 0.0.1a) and want to ditch windows for my OS. So you get this little program I will code (either for Windows or for my OS, i haven't decided), and run it. It asks you want program you want it to transfer, and it reads the hex code of the program file (since binary is too long to type out a billion times over) and writes an equivalent file in a folder (probably a sub-folder in the program's directory) in my OS's executable format. It'll also look through the header for any linked program files (just the thinks like DLLs and such) and transfers them, one by one. Now, while it is translating the files, it'll keep a record of all the files the program would ever possibly execute (like if a procedure like

Code: Select all

ReadFile("thisfile.dat"):
), it'll log the string "thisfle.dat" with the record. After it is done with the translation of all the executable files linked with the main program, transfer the program files that were in the log to the sub folder where all the executables were being placed after being translated. Clear so far? Then the user transfers the files to the computer that has my OS on it and can use the Windows program any time they want. I might even make a more expensive version that will make a little installer package for all the translated files, so the user can't bungle it up as the are wont to do (PEBKAC strikes again!). I hope I'm clearer this time. And please don't steal my idea.
Of course the user must have license to run the program.
Yeah, that's what I was talking about. It's for users to be able to run their programs on my OS. But I don't want to do a virtual machine because in my opinion they are quite a hassle. You have to wait for the program to load, but first you need to wait for the VM to load! And I'm planning on having my format be very different from any other exe format, so I don't think a VM approach would work. Besides, A VM run program is like 10 times slower than a pre-re-compiled version of any program.

OK. Let me make sure I got this straight.

I can do this as long as I say that the users are responsible for their actions and that they need to have the proper authority to run software anyway?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Legal Issues

Post by Combuster »

Brendan wrote:Hi,
Combuster wrote:I can imagine converting windows applications for which the developer never bothered to make it run on other OSes (i.e. for the end user rather than developer)
If you copy a book and make an identical book, then you'd need the copyright holder's permission.
There is at least one law that allows you to make a copy for personal use. In fact at my university people tend to abuse it by "borrow my book, so you can make copies for personal use" (you get the idea)
However, if you copy a book into an extremely different format (e.g. braille, an audio tape, etc) then that makes no difference and you still need the copyright holder's permission. The same would apply to software - if you convert a Windows binary into a completely different form, then you still need the copyright holder's permission.


*Enter Devil's Advocate*

A binary is a representation of machine code and data with the information to run it. By executing it you are converting it to a different form: the machine code located in memory, and the data located somewhere else in memory, with the data structures governing the process, open files and so on.
Technically, you even get a different physical representation as soon as you copy it from CD to the harddisk. So if you can't convert a program into something that the computer can run, then what use is it.
Conversely, since you must do a conversion of some sort, why would it be incorrect to convert in steps and store the intermediate result. Windows caches binaries so that it doesn't need to perform as much when it is needed. Hence it has made a copy that is different yet has the same meaning. Why is windows allowed to do so and not a third party tool that essentially does the same thing?

Why must lawyers make everything so difficult :evil:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Walling
Member
Member
Posts: 158
Joined: Mon Dec 04, 2006 6:06 am
Location: Berlin, Germany

Re: Legal Issues

Post by Walling »

TheDragon wrote:I can do this as long as I say that the users are responsible for their actions and that they need to have the proper authority to run software anyway?
Open source licenses all include a "no warranty" section, like this (from the BSD license):
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You can have a look on the other open source licenses here. Maybe it is enough to add that section to your license text. If you are releasing it under an open source license, I see no problem. But I'm not a lawyer, so I hereby provide this help "as is" and any express or implied warranties... blah blah blah. :D
User avatar
babylon2233
Member
Member
Posts: 66
Joined: Fri May 23, 2008 5:30 pm
Location: Malaysia

Re: Legal Issues

Post by babylon2233 »

PatrickV wrote:If you like to make people programs work in your os version you have to ask them first who created the software.
I believe you mean, we can't run people's programs on the platform other than the intended platform. I think it's not right unless it stated under EULA. I don't think you will break the law only by running Windows program using WINE on Linux.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Legal Issues

Post by jal »

TheDragon wrote:It's like you have a windows program, right? You get my OS (still working on 0.0.1a) and want to ditch windows for my OS. So you get this little program I will code (either for Windows or for my OS, i haven't decided), and run it. It asks you want program you want it to transfer, and it reads the hex code of the program file and writes an equivalent file in a folder (probably a sub-folder in the program's directory) in my OS's executable format.
Your approach is overly simplistic. The thing is, the 'executable format' is not the problem. The API is. If what you propose is possible, why do you think there's something called WINE to run Windows programs on Linux? So your idea is, unfortunately, completely useless.


JAL
User avatar
TheDragon
Member
Member
Posts: 43
Joined: Mon Aug 25, 2008 8:23 pm
Location: Middle of Nowhere

Re: Legal Issues

Post by TheDragon »

If I understand correctly, the way a Windows program accesses the API is with an interrupt code of some sort, right? So, I just have to read the interrupt code, analyze what it does (search for it in a 2d array or something like that) and translate it into my API. like so:

Let us assume that the Windows API call code for dumping all the data from the clipboard into the current location (pasting) is 7h (no, I have no idea what it is). Let's say that the equivelent for that in my OS is 8h (no, I have no idea what it would be either). So my program reads some byte code that looks like "call api call 7h" and it translates to "call api call 8h". It sounds simplistic because I was trying to explain it. (At least, I hope that's why... :) ).

If someone can dissassemble some(-windows-)thing, translate it into some sort of ANSI C, and recompile it into a UNIX-compatible program, why can't I?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Legal Issues

Post by Brendan »

Hi,
TheDragon wrote:If I understand correctly, the way a Windows program accesses the API is with an interrupt code of some sort, right?
I'm not so sure - for Unix, the process links to a shared library at run-time; where the API used by the process is defined by the functions exported by the shared library. Because of this you can have many different kernels with completely different "kernel APIs", where the same binary works under any kernel because the OSs shared library exports the same functions.

I wouldn't be surprised if Windows works the same - e.g. the process links to a system DLL, where the system DLL is the only thing that talks to the kernel, and where different Windows kernels have different system DLLs.
TheDragon wrote:Let us assume that the Windows API call code for dumping all the data from the clipboard into the current location (pasting) is 7h (no, I have no idea what it is). Let's say that the equivelent for that in my OS is 8h (no, I have no idea what it would be either). So my program reads some byte code that looks like "call api call 7h" and it translates to "call api call 8h". It sounds simplistic because I was trying to explain it. (At least, I hope that's why... :) ).
Let's assume Windows uses messages, and your OS uses pipes, and the application sends messages to a system service that doesn't exist in your OS because Microsoft patented it.

Let's also assume that the application has some data embedded in the code, and your utility thinks this data is a call to the Windows API and trashes it.

Let's also assume that the data you trashed is for a jump table, and the application does "jmp [the_trashed_table + eax * 4 + ebx]"; and when you realize there's a problem you spend several years doing research and then implement a utility that's capable of finding all possible values of EAX and EBX so that your utility doesn't stuff things up.

Let's also assume that I spent thousands of dollars writing a Windows application and carefully wrote the terms of the copyright so that my help desk doesn't need to attempt to support problems caused by installing my application on unsupported operating systems, and get annoyed at people violating my copyright and then complaining that the application doesn't work on an unsupported operating system. Let's also assume that I wrote an equivalent application for your OS (with it's own separate help desk for support and it's own copyright that permits use on your OS) and need to sell this version at a much higher price to get a decent return on my investment because there's less sales and a smaller target market; and people attempting to use the Windows version of the application on an unsupported OS is costing me a lot more than suing people for copyright violation would. In this case, would I sue individuals for violating my copyright, or would I claim that your utility is a tool intended for piracy and sue you directly, and watch you go bankrupt trying to defend yourself in court even though I knew I'd lose the case before I sued you?

Alternatively, let's assume that your utility always works perfectly and there's never any legal problems; but nobody every writes any applications for your OS because it makes more sense to write a Windows application and then convert it to your OS; and that nobody ever uses your OS because all of the applications run on Windows anyway and it's easier to just keep using Windows than to mess around installing an OS that didn't come with the computer. Meanwhile, Combuster finishes his OS before you do because he didn't spend several years tying to get an incredibly complex binary translator working or reverse engineering hidden Windows APIs, and he has time to implement some brilliant new feature, and everyone starts using Combuster's OS because they want to use this brilliant new feature that all Combuster's native applications support, because they all know that Windows doesn't have this brilliant new feature. :D


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
TheDragon
Member
Member
Posts: 43
Joined: Mon Aug 25, 2008 8:23 pm
Location: Middle of Nowhere

Re: Legal Issues

Post by TheDragon »

What do you mean by embedded data and trashing it?

And suppose I redesign it so it comes out as one big assembly file and reassemble it into my exe format.

And I think the original design will be OK as long as I never assume anything (that's how fatal bugs make their living).

But I think we are getting off topic here... Is this LEGAL OR NOT? :?: :?: :?: :)
Post Reply