Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Question Exe writing exe??

    I have seen many exe's design an exe based on a users prefernces. I was wondering if anyone knows how to do this in vb or c++. Also, if anyone knows how to pack ocx's and dll's into one exe and remotely extracting them.

  • #2
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally Posted by Dunna
    I have seen many exe's design an exe based on a users prefernces.
    Where? I'd love to see this...

    Polymorphic coding is difficult in compiled languages (like C++) because you need to include a compiler into the program...
    Also, there are really only two reasons for polymorphic programming - 1. Interesting software research projects into Genetic Algorithms, and 2. virus and malware.


    Originally Posted by Dunna
    Also, if anyone knows how to pack ocx's and dll's into one exe and remotely extracting them.
    By remotely extracting, do you mean without the knowledge of the client.

    anyways, you can zip the files up together and then create a self-extracting zip file to deliver the product...
    Questions are what binds the universe,
    Questions lead to answers,
    Answers lead to knowledge,
    Knowledge leads to wisdom,
    Wisdom brings more questions -- Horus Kol, 2004 :)

  • #3
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    There is a packaging utility avaible called Fusion by bit-arts, but it costs 399$ which I'm not going to spend. This utility adds the ocx's and such right into the exe! I'm not sure how that works, but it says it "injects" them into it, whatever that means. Also, I have the packaging ability of a new executable in a few remote control utilities in my office (not sure of the names). There is a client and a server. The client allows you to select certain options for the server, you then click "Add" and it re-compiles or generates a server.exe file based on your selections. I'm not sure how it's done, but the client.exe has no compiler that comes with it, unless there is a compiler built right in...
    Last edited by Dunna; 11-29-2004 at 05:10 PM.

  • #4
    New Coder
    Join Date
    Nov 2004
    Location
    Netherlands
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If the user preferences were only string changes, you could create an .exe with a string table resource and include it as a resource in the main program. The user would then enter the string changes he wants and all the main program would have to do is change the string table resource. Easier said than done though...

  • #5
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Could you explain how? I assume you are talking about C++ but if it's possible in VB please explain. If it's to complicated or to long just e-mail me at sdunns1222@yahoo.com

  • #6
    New Coder
    Join Date
    Nov 2004
    Location
    Netherlands
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm sorry to disappoint you, but I'm afraid I haven't the faintest idea on how to do such a thing in VB, nor do I know how to edit resources in an already compiled executable in C or VB. However, there is an open source compiler/editor called OpenWatcom located at http://downloads.openwatcom.org/ftp/source/ which you could look into.

  • #7
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    I would download that file and check it out, however, it is 45 MG's! On a dial-up like I'm using that will take just a little while...

  • #8
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There is a packaging utility avaible called Fusion by bit-arts, but it costs 399$ which I'm not going to spend. This utility adds the ocx's and such right into the exe! I'm not sure how that works, but it says it "injects" them into it, whatever that means. Also, I have the packaging ability of a new executable in a few remote control utilities in my office (not sure of the names).
    oh, i think i see...

    This won't help you with runtime changes - only at compilation... it won't remember a users settings once you "injected" the files - only what you put in before you distribute it.
    Questions are what binds the universe,
    Questions lead to answers,
    Answers lead to knowledge,
    Knowledge leads to wisdom,
    Wisdom brings more questions -- Horus Kol, 2004 :)

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you could store the users preferences etc. in a file, then inject the update and read in the preferences.

    scroots
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #10
    New Coder
    Join Date
    Dec 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have seen many exe's design an exe based on a users prefernces. I was wondering if anyone knows how to do this in vb or c++. Also, if anyone knows how to pack ocx's and dll's into one exe and remotely extracting them.

    I dunno man, whatever you wanna do it doesnt sound good.
    "... exe's design an exe based on a users prefernces... "
    ok you mean self-modifying code, or code which can *patch* itself at
    runtime. NOT EASY -- you must understand assembly and opcodes.
    plus loaded exe has 'sections' which arent contiguous and you have to
    know about relocating object code and a whole lotta stuff
    the packing thing...well you could have them encrypted then at run
    unpack and execute,,,,um again need to know your machine

    If I may ask...what the hell are you trying to do?
    this sounds like some serious digital voodoo and if you
    succeed you might wanna throw all pretences of portability
    away...this is very architecture dependant code
    good luck!

  • #11
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Horus Kol
    oh, i think i see...

    This won't help you with runtime changes - only at compilation... it won't remember a users settings once you "injected" the files - only what you put in before you distribute it.
    yah but that would mean I have the Fusion program on the user's computer who selects the prefernces. How else could I possibly "inject" the preferences back in?

  • #12
    Regular Coder
    Join Date
    Nov 2004
    Location
    Somewhere over the rainbow
    Posts
    208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You save the preferences in a file outside the program, which the program then reads on runtime...
    Questions are what binds the universe,
    Questions lead to answers,
    Answers lead to knowledge,
    Knowledge leads to wisdom,
    Wisdom brings more questions -- Horus Kol, 2004 :)

  • #13
    Regular Coder
    Join Date
    May 2004
    Location
    New Hampshire, America
    Posts
    246
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Alright, I read in an article off Google that one way to do what I want to do is to right the users preferences on to the end of the file. When that file ran it would read the end of itself and know what to do. Now, my question: Does anyone know how to do that? Or even provide a different answer to my first question? Oh yeah, whoever was talking about the EXE being in continous segment's and modifying opcodes, I looked into that but the math was a little to much for me. I understand the concept however, and maybe if someone who understands the math could explain it to me or teach me how to add my own segment to the end of the file.... I know it's complicated but we have a lot of smart CF users.

  • #14
    Regular Coder
    Join Date
    Feb 2004
    Location
    WA
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To write the settings in the exe file itself is bad programming and almost all virus software will treat this as a self modifying virus.

    Another problem would be that this wont be able to run from read-only media like CD-ROM, or even from the hard drive if the user only has read-only permissions.

    If you still need to do it regardless: You need to seek to the end of the exe file and start writing there. Before you write your settings, you need to write a unique marker like "uniqueXXXmarker" and then search for two words unique and marker seperated by XXX when reading back the data. You can't search for the whole string because if you do, the string will occur in the exe file itself in its string table. You need to use a marker in the first place since you would not know where the end of the original exe is after you write the data without a marker.
    Last edited by Unit; 01-13-2005 at 07:16 PM.
    Nobody is Perfect. I am Nobody.

  • #15
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Apart from this whole concept being pretty damn interesting, I do not see any reason for wanting such a solution. You see this sort of thing everyday when you download a setup executable file, I believe NSIS is open source so perhaps you can examine it's code to gain more insight. Dynamic linking has many different things going for it such as being able to upgrade your program's functions by just switching a file. Recompiling the whole executable would just be plain foolish if say you wanted to replace a dll that wa just a few kb worth and your executable was fairly large in respect to the location of the dll data. Besides resources are not just limited to your icons strings and bitmaps if I recall you can define your own custom resources.

    But for VB I am unsure, it is an interpreted language. I believe that you can compile it but I don't think you are given such a level of control when it comes to the compilation as to decide exactly how it will work.
    Omnis mico antequam dominus Spookster!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •