Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do they make Windows executables?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2150
Location: $TERM

PostPosted: Sat Dec 01, 2012 4:51 am    Post subject: How do they make Windows executables? Reply with quote

I was just wondering.

There're a lot of 'unofficial' Windows compilers like gcc, and various toolkits which will compile your project to Windows binaries, but, as we know, the Windows executable format is not standard and it's not known how they work.

So how do these compilers compile?
_________________
Buy from companies supporting opensource -- IBM, Dell, HP, Hitachi, Google etc...
Disfavor companies supporting only Win -- Logitech, Epson, Adobe, Autodesk, Pioneer, Kingston, WD, Yahoo, MSI, XFX
My blog
Back to top
View user's profile Send private message
dmitchell
Veteran
Veteran


Joined: 17 May 2003
Posts: 1159
Location: Austin, Texas

PostPosted: Sat Dec 01, 2012 5:05 am    Post subject: Re: How do they make Windows executables? Reply with quote

dE_logics wrote:
as we know, the Windows executable format is not standard and it's not known how they work.

I did not know that. Now I am wondering too.

A few weeks ago I had to cross compile for windows for the first time. I used mxe and it worked. What do others use for building windows executables?
_________________
Your argument is invalid.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2150
Location: $TERM

PostPosted: Sat Dec 01, 2012 8:48 am    Post subject: Reply with quote

If their format was known, making WINE would've been a lot easier. But they've to reverse engineer.
_________________
Buy from companies supporting opensource -- IBM, Dell, HP, Hitachi, Google etc...
Disfavor companies supporting only Win -- Logitech, Epson, Adobe, Autodesk, Pioneer, Kingston, WD, Yahoo, MSI, XFX
My blog
Back to top
View user's profile Send private message
erm67
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2005
Posts: 130
Location: somewhere in Berlusconia.

PostPosted: Sat Dec 01, 2012 9:08 am    Post subject: Reply with quote

http://en.wikipedia.org/wiki/Portable_Executable

Quote:
PE is a modified version of the Unix COFF file format. PE/COFF is an alternative term in Windows development.


Spec of the format, freely available here:

http://msdn.microsoft.com/en-us/windows/hardware/gg463119.aspx

Quote:
Microsoft PE and COFF Specification

Updated: October 5, 2010
This specification describes the structure of executable (image) files and object files under the Windows family of operating systems. These files are referred to as Portable Executable (PE) and Common Object File Format (COFF) files, respectively.
.......


Its a subset at the core of the API used in Windows that is not freely available and had to be reverse engineered for wine.
Or maybe you are referring to this note in the specs:
Quote:
Note: This document is provided to aid in the development of tools and applications for Windows but is not guaranteed to be a complete specification in all respects. Microsoft reserves the right to alter this document without notice.

_________________
Truck!!
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1634
Location: Poland => Lodz

PostPosted: Sat Dec 01, 2012 1:24 pm    Post subject: Reply with quote

AFAIK the hardest part of reimplementing WinAPI for Wine was getting the bugs right. I've read somewhere that there is lots of Windows software that has to work around some minor bugs that'll never get fixed, so there is also some software using those bugs for convenience. Bugs as in "we missed the spec a bit" not as in "crush and burn".
Back to top
View user's profile Send private message
McGruff
Tux's lil' helper
Tux's lil' helper


Joined: 28 Dec 2004
Posts: 147

PostPosted: Sat Dec 01, 2012 1:57 pm    Post subject: Reply with quote

A genuine Windows executable must have 10 major security flaws for every thousand lines of code otherwise the program will die with a "security alert: this program is secure" warning.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2150
Location: $TERM

PostPosted: Sat Dec 01, 2012 4:44 pm    Post subject: Reply with quote

erm67 wrote:
http://en.wikipedia.org/wiki/Portable_Executable

Quote:
PE is a modified version of the Unix COFF file format. PE/COFF is an alternative term in Windows development.


Spec of the format, freely available here:

http://msdn.microsoft.com/en-us/windows/hardware/gg463119.aspx

Quote:
Microsoft PE and COFF Specification

Updated: October 5, 2010
This specification describes the structure of executable (image) files and object files under the Windows family of operating systems. These files are referred to as Portable Executable (PE) and Common Object File Format (COFF) files, respectively.
.......


Its a subset at the core of the API used in Windows that is not freely available and had to be reverse engineered for wine.
Or maybe you are referring to this note in the specs:
Quote:
Note: This document is provided to aid in the development of tools and applications for Windows but is not guaranteed to be a complete specification in all respects. Microsoft reserves the right to alter this document without notice.


Yeah, I saw that, but that was just a part.

So all these compilers work on these specifications. Including ICC.

If you wanna really program on Windows, you HAVE to use .NET.
_________________
Buy from companies supporting opensource -- IBM, Dell, HP, Hitachi, Google etc...
Disfavor companies supporting only Win -- Logitech, Epson, Adobe, Autodesk, Pioneer, Kingston, WD, Yahoo, MSI, XFX
My blog
Back to top
View user's profile Send private message
erm67
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2005
Posts: 130
Location: somewhere in Berlusconia.

PostPosted: Sat Dec 01, 2012 7:09 pm    Post subject: Reply with quote

dE_logics wrote:

Yeah, I saw that, but that was just a part.

What part is missing? regarding the executables I mean?
dE_logics wrote:

So all these compilers work on these specifications. Including ICC.

If you wanna really program on Windows, you HAVE to use .NET.


Quote:
The .NET Framework (pronounced dot net) is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large library and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for the .NET Framework execute in a software environment (as contrasted to hardware environment), known as the Common Language Runtime (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. The class library and the CLR together constitute the .NET Framework.


It is a lot easier to program using .NET but even if the library is huge you might need (or want to use) lower level APIs for speed. Also the CRL is a limitation since only a subset of all API available for a platform are available, the advantage is that it runs on a broad range of systems.
It is just a way for M$ to drop legacy API, so if you want that your program works on a broad range of platforms (and M$ means flavours of windows with platforms) you have to use .NET.
_________________
Truck!!
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
John-Boy
Guru
Guru


Joined: 23 Jun 2004
Posts: 439
Location: Desperately seeking moksha in all the wrong places

PostPosted: Sat Dec 01, 2012 7:20 pm    Post subject: Reply with quote

erm67 wrote:
you have to use .NET.


Thought that was deprecated now, Javascript & HTML 5 being the future ?
_________________
Only in our dreams are we free. The rest of the time we need wages.
Back to top
View user's profile Send private message
erm67
Tux's lil' helper
Tux's lil' helper


Joined: 01 Nov 2005
Posts: 130
Location: somewhere in Berlusconia.

PostPosted: Sat Dec 01, 2012 9:12 pm    Post subject: Reply with quote

John-Boy wrote:
erm67 wrote:
you have to use .NET.


Thought that was deprecated now, Javascript & HTML 5 being the future ?


More or less. For the desktop .net is still a choice that will probably stay.

http://community.devexpress.com/blogs/ctodx/Windows8Architecture_485458D4.png
_________________
Truck!!
A posse ad esse non valet consequentia
Πάντα ῥεῖ
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2150
Location: $TERM

PostPosted: Sun Dec 02, 2012 12:38 pm    Post subject: Reply with quote

John-Boy wrote:
erm67 wrote:
you have to use .NET.


Thought that was deprecated now, Javascript & HTML 5 being the future ?


What, in .net?
_________________
Buy from companies supporting opensource -- IBM, Dell, HP, Hitachi, Google etc...
Disfavor companies supporting only Win -- Logitech, Epson, Adobe, Autodesk, Pioneer, Kingston, WD, Yahoo, MSI, XFX
My blog
Back to top
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1221
Location: Jefferson, USA

PostPosted: Sun Dec 02, 2012 4:58 pm    Post subject: Reply with quote

In no way is .NET deprecated. You have three choices for writing Windows 8 apps:

1. HTML5/JavaScript
2. .NET (C#)
3. C++
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum