DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 2 FirstFirst 12
Results 16 to 26 of 26

Thread: Create Project that make .exe

  1. #16
    Join Date
    Feb 2004
    Location
    Colton, CA
    Posts
    550
    Why has Dan2552's quote of Andrews 4th post been labelled as my post? Bizarre.

  2. #17
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    Rich-

    I was wondering about that meself!

    -Andrew

  3. #18
    Join Date
    Nov 2004
    Posts
    16
    didnt notice that.

    dunno how it happened??

  4. #19
    Join Date
    Feb 2007
    Posts
    2

    Compilers

    There was a time when writing a compiler was a rite of passage. Making an EXE file is a trivial thing to do if...

    In some ways, it's a big if. First off, it helps to know just what an EXE really is. It is a file that contains the instructions that will be executed by the cpu in its own language, machine language. Since the EXE standard was created in CP/M (precursor to MSDOS) it originally consisted of 8080 instructions.

    In those days, it was very common to write in assembly language, a mnumonic representation of machine language. A programmer wrote a program in assembly and 'compiled' it in machine language for the machine to run since the machine did not understand the mnumonic form of the program.

    Many programmers felt that it was too difficult to work in assembly language so they started dreaming up new languages.

    COBOL was first, followed by fortran, then basic, then C,, pascal...

    In those days, it seemd like just about everybody wrote compilers. Some were more successful than others and have stood the test of time. Basic and C come to mind.

    EXE files are nothing more than a high level language translated into a form that the CPU(ps are pentium based these days) can understand. If you know the instruction set for 80486 and pentiums, you can write EXE files in your sleep. You also need to know a little about the internals of the operating system you are using becuase the exe has to live within it and play nice. Ealry PC users will remember when this was not observered in the early days. The OS imposes a little bit of structure on EXE files in addition to the machine code and OS requirements. This is in keping with the 'play nice' rules.

    If you use a commercial compiler, the chances are good that all the'play nice' rules are observed. You can write a compiler in any language that can write binary files. If you don't know what you're doing, you'll crash your computer a lot.

    So the real answer is;Yes you can make yuor own compiler in VB. Forth was written in forth mostly. C is written mostly in C. Most basics are written in assembly language or C these days but you can do it whatever you want. There is a point where you will spend a great deal of time reinventing the wheel.

    That's why people do write compilers much anymore, that and they think it's too haaarrd.

    Today few programmers are comfortable under the hood of a computer so it's all just magic to most of them. But for some of us old timer who started as electronics engineers in the days before PCs, it just a bunch of nuts and bolts, nothing to be afraid of.

    If you want to learn to write EXE files, Get a copy of the pentium instruction set, learn the windows API, find an assmbler and satrt writing simple applications. Maybe the best thing would be to learn to develop device drivers. in any case, expect to spend a great deal of time under the hood.

    Or you can do what most programmers do;use a commercial compiler. Just google 'write compiler' and explore the possibilities. Who knows, you might be the creater of the next big language. God knows there's plenty of room for it.

    By the way, every computer than runs windiws has a tool for making exe fies from scratch. It's called 'debug.exe' and many a EXE has been created with nothing more than it and a few piles of documentation.

  5. #20
    Join Date
    Feb 2007
    Posts
    2
    O contrare...

    There was a time when writing a compiler was a rite of passage. Making an EXE file is a trivial thing to do if...

    In some ways, it's a big if. First off, it helps to know just what an EXE really is. It is a file that contains the instructions that will be executed by the cpu in its own language, machine language. Since the EXE standard was created in CP/M (precursor to MSDOS) it originally consisted of 8080 instructions.

    In those days, it was very common to write in assembly language, a mnumonic representation of machine language. A programmer wrote a program in assembly and 'compiled' it in machine language for the machine to run since the machine did not understand the mnumonic form of the program.

    Many programmers felt that it was too difficult to work in assembly language so they started dreaming up new languages.

    COBOL was first, followed by fortran, then basic, then C,, pascal...

    In those days, it seemd like just about everybody wrote compilers. Some were more successful than others and have stood the test of time. Basic and C come to mind.

    EXE files are nothing more than a high level language translated into a form that the CPU(ps are pentium based these days) can understand. If you know the instruction set for 80486 and pentiums, you can write EXE files in your sleep. You also need to know a little about the internals of the operating system you are using becuase the exe has to live within it and play nice. Ealry PC users will remember when this was not observered in the early days. The OS imposes a little bit of structure on EXE files in addition to the machine code and OS requirements. This is in keping with the 'play nice' rules.

    If you use a commercial compiler, the chances are good that all the'play nice' rules are observed. You can write a compiler in any language that can write binary files. If you don't know what you're doing, you'll crash your computer a lot.

    So the real answer is;Yes you can make yuor own compiler in VB. Forth was written in forth mostly. C is written mostly in C. Most basics are written in assembly language or C these days but you can do it whatever you want. There is a point where you will spend a great deal of time reinventing the wheel.

    That's why people do write compilers much anymore, that and they think it's too haaarrd.

    Today few programmers are comfortable under the hood of a computer so it's all just magic to most of them. But for some of us old timer who started as electronics engineers in the days before PCs, it just a bunch of nuts and bolts, nothing to be afraid of.

    If you want to learn to write EXE files, Get a copy of the pentium instruction set, learn the windows API, find an assmbler and satrt writing simple applications. Maybe the best thing would be to learn to develop device drivers. in any case, expect to spend a great deal of time under the hood.

    Or you can do what most programmers do;use a commercial compiler. Just google 'write compiler' and explore the possibilities. Who knows, you might be the creater of the next big language. God knows there's plenty of room for it.

    By the way, every computer than runs windiws has a tool for making exe fies from scratch. It's called 'debug.exe' and many a EXE has been created with nothing more than it and a few piles of documentation.

  6. #21
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Well because this is here, if u posted this since 2004, and he wanted to start creating a compiler; I don't think that he will have finished it till now .
    This is in case of creating a compiler for a programming language.. but I'm asking what he want exactly ?
    for example Macromedia can make your flash project executable -i.e. make exe file- but is it really an executable file that contains assembled instructions by a programming language ?
    No just it has a scripting code that creat blocks of graphics vectors , and many recource pictures , audio, and videos ... and depending on the "flash player" it could understand all this work and display it as appreciated ..
    also for example any compressing tool "winzip, winrar, wintar, ... etc" all of them could make executable files "make exe files" but they aren't compiled too or any thing ... just contains compressed files together and at the top a small executer that understand what happens here, those types of exe files doesn't depends on any external tool but they include their tool into their exe -without any new compilation ..
    and there is other many examples , like setup.exe tools, trojan exe maker, and here those trojan maker [also knowen as "server editor"] could customize too many parameters in the generated exe file -as it appears- and as every body know those editors are easy to be made and doesn't take a time to creat it, as we see hundreds of trojan maker tools all around the world created by too many ppl .
    the idea is not complicated , it's not here to talk about this but a small search could tell u how to make this, ( they arent a real generated exe but loded and edited/patched )
    If he still want to make an exe file I just want him to tell us what he want, and what type of executable files he want ?
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  7. #22
    Join Date
    Jan 2007
    Posts
    22
    Hi

    U may store the EXE you want in the program's resources and extract it on demand and modify its resources also as you need . I've used this method B4 and got a great results .
    my project was a program that stores serial numbers for programs and make a stand alone file for serials like keygens (for example) and pastes it automatically using sendkeys ( it also pastes serials like windows xp (separated)) automatically

    the method was storing a an exe file with string resources including name ,serial ,etc..
    and extract it when needed to speciffic location and then modify its resource corresponding to name , serial etc..

    using API Functions

  8. #23
    Join Date
    Jan 2007
    Posts
    11

    Smile

    Hi,

    Seems that it can be possible with VB6.

    Look this: http://www.freevbcode.com/ShowCode.Asp?ID=8385

    It will not create an .EXE from scratch but it can run existing executables.


    -nakkimake-

  9. #24
    Join Date
    Apr 2004
    Location
    New York City
    Posts
    538
    Davee-

    Not sure why you re-opened a thread that's been dead since 2004, but...

    Wow, did I step on someone's toes a little? ;-)

    I stand by my original assertion. Sure, I suppose you COULD theoretically make a compiler, linker etc. in VB if you know the x86 instruction set like the back of your hand. But WHY would you want to? It would take a long time, and then what would you have? A slow, feature-poor compiler that wouldn't compare to the freeware compilers already out there, let alone the IDEs from Microsoft, IBM, Sun, etc. Why re-invent the wheel, except as an academic exercise? Yes, you'd have the satisfaction of "a difficult job well done", but I don't think that's what the OP was looking for...
    I sympathize with a time when writing a compiler was a rite of passage, but that's simply not gonna happen for a newbie programmer these days. And you seem to be forgetting that those compilers you wrote were for command-line OSes with no graphic capabilities, and probably no, or very little, multithreading. I am not knocking the skill it takes to do that, which is considerable, but writing a GUI compiler-linker etc. for Windows XP is VERY different. And that is what the OP was talking about. Even the major companies like Microsoft, Borland, IBM , Sun, etc. have large teams creating their compilers.
    Very few programmers are learning Assembly language and the x86 instruction set these days. We have so many higher-level languages that allow you to get serious work done in much shorter amounts of time that most people simply don't bother. I wish that everyone who programmed went through a course in low-level programming, programming theory, computer science, the registers, etc. but nowadays it doesn't happen like it should. Even some of the colleges have begun teaching Java instead of C as a first language in general programming courses (Ugh!). And for certain applications, Assembly, or even C, would be overkill. Do you need to learn assembly to create web sites? Sure, a low-level understanding of the computer would help a bit, but a low-level understanding of the popular web browsers and the HTTP, WWW and CSS specs would help a lot more...

    I once picked up a book on programming Windows GUI apps in Assembly Language. Sure, it could be done, but it's SO much extra code and effort for no real gain. Unless you're writing device drivers, comm programs, the latest-and-greatest 3D shooter, etc., there is not much point. And even then, I doubt there would be an advantage to writing it in Assembly vs. writing it in C, with critical sections possibly written in Assembly. Writing 70 lines of code in C just to put a Windows GUI window on the screen, vs. pressing F5 in VB5/6, is no contest unless you have a real need for the extra speed...And writing magnitudes-of-order more lines of Assembly to do it would be absurd...Not that you were advocating that, but I'm trying to make the point that most programmers today want to get their work done in the most efficient language/IDE possible. I used to write HTML and "classic" ASP pages in Notepad. Now I use VB.NET. Would I want to go back? No frickin' way! Why write dozens of lines of code plus dozens of lines of error-checking code just to put the contents of a database table on the screen, when I can do it in 5 minutes without a single line of code in VB.NET 2005? Sure, I'm glad I know "raw" HTML and CSS well enough to drop into the Source window and tweak the HTML/CSS the GUI is creating. But I don't want to have to write all of it myself! It takes too long, and my clients won't pay for me to use slow tools when faster ones are available...

    The OP was a newbie who didn't understand the amount of work that would be required. I was trying to get across to him the amount of work and knowledge he would need to assemble to tackle a project like that. So, while it would be --possible-- to create a compiler in VB, only a glutton for punishment would try...or an academic...or someone with too much time on their hands. And what would you have when you were done? Other than the satisfaction of doing something most people think can't be done, of course. And for someone with little programming knowledge, creating a compiler in ANY language is a daunting challenge, and I submit that doing so in VB6 is so far away from the average person with limited programming knowledge that it IS impossible, for all intents and purposes. Could the average VB6, VB.NET, Java, or C# programmer write a compiler? No way. But neither could the average C or C++ programmer today...At one time, once you learned Assembly, C, or (god forbid) Machine-Language programming,you were ready to program. Nowadays you also need to know how to operate a GUI-based OS, how to write code for the GUI-based OS, possibly a C or C++ based API, etc. etc. --there is so much more you need to know today beyond just your programming language...

    I'll get off my soapbox now, but I trust I've made my statements clearer...

    -Andrew

  10. #25
    Join Date
    Jan 2007
    Posts
    11
    Sorry, that I replied the thread...

    I'm new in this forum (but mature VB6/VB.NET coder) and actually the message where I replied was posted today. I'm definitely not interested about that kind of things. I just mentioned what I've seen in freevbcode.com's last week code posts.

    -nakkimake-

  11. #26
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819

    Arrow

    Last thing to say here; If you want , u may creat an "exe" file by using an existed compiler , the default command is "make" , if you have for example gdb or java an u type "make /?" in the consol you will find all its paramters and how to generate an exe file using it ... also the vb hase this "LIMITED" command : "vb6.exe /make 'BASIC_PROJECT_NAME.BAS' " ... so u may for example write a simple programming steps and use an existed compiler to compile it ... but here u need a real and valid programming lang , if u have vb6.exe so u may use the vb IDE it will be much easier , and if u have any other compilers optain a good free IDE from the web, it will be also much easier . I'm saying this only to tell about another method to "make exe" , if u were asking about compiling a programed instructions .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center