Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. archiving code or binary within my prog

archiving code or binary within my prog

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structures
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Spiritofamerica
    wrote on last edited by
    #1

    hello This is meant as a theorethical programming question basically but if you could acompany some examples in c and vbs to your answers as examples or proof of concepts that would be lovely. So the question is: Can code be archived(made smaller than it actually is)? Like for exemple could I have a function make_code_big_again that could receive as a parameter a array like structure, string wharever containing some code that was made small andmake it bigg again and run it??? or could this be done with binary files??? like could I somehow archive them, put them inside the exe in a big string or as resources and then unpack them, but withouth utilising any third paryt software like winrar or winzip cause that wouldn't make the program very platform independent. ??? thank you for your time

    J M C 3 Replies Last reply
    0
    • S Spiritofamerica

      hello This is meant as a theorethical programming question basically but if you could acompany some examples in c and vbs to your answers as examples or proof of concepts that would be lovely. So the question is: Can code be archived(made smaller than it actually is)? Like for exemple could I have a function make_code_big_again that could receive as a parameter a array like structure, string wharever containing some code that was made small andmake it bigg again and run it??? or could this be done with binary files??? like could I somehow archive them, put them inside the exe in a big string or as resources and then unpack them, but withouth utilising any third paryt software like winrar or winzip cause that wouldn't make the program very platform independent. ??? thank you for your time

      J Offline
      J Offline
      jgeorge21
      wrote on last edited by
      #2

      Sure, if the code is run on an interpreter.

      1 Reply Last reply
      0
      • S Spiritofamerica

        hello This is meant as a theorethical programming question basically but if you could acompany some examples in c and vbs to your answers as examples or proof of concepts that would be lovely. So the question is: Can code be archived(made smaller than it actually is)? Like for exemple could I have a function make_code_big_again that could receive as a parameter a array like structure, string wharever containing some code that was made small andmake it bigg again and run it??? or could this be done with binary files??? like could I somehow archive them, put them inside the exe in a big string or as resources and then unpack them, but withouth utilising any third paryt software like winrar or winzip cause that wouldn't make the program very platform independent. ??? thank you for your time

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        something like an auto-extractable zip archive ? yes it's possible... I think that you can find an example somewhere here on codeproject.


        Maximilien Lincourt Your Head A Splode - Strong Bad

        1 Reply Last reply
        0
        • S Spiritofamerica

          hello This is meant as a theorethical programming question basically but if you could acompany some examples in c and vbs to your answers as examples or proof of concepts that would be lovely. So the question is: Can code be archived(made smaller than it actually is)? Like for exemple could I have a function make_code_big_again that could receive as a parameter a array like structure, string wharever containing some code that was made small andmake it bigg again and run it??? or could this be done with binary files??? like could I somehow archive them, put them inside the exe in a big string or as resources and then unpack them, but withouth utilising any third paryt software like winrar or winzip cause that wouldn't make the program very platform independent. ??? thank you for your time

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          if you put that code in DLLs which are loaded dynamically (ie. using LoadLibrary, etc), you can compress them (use zLib), attach them to the end of your loader EXE. it could be similar to this: http://www.codeproject.com/file/self_extractor.asp[^], but with the added decompression step. Image Toolkits | Image Processing | Cleek

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups