Results 1 to 6 of 6

Thread: Encryption & Decryption

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    4

    Question Re: Encryption & Decryption

    Hi Freinds
    i have a creypted executable file and i want decrypt it into memory an execute . i do not want create any temp file for execute it , i just decrypt and execute into memory ?
    plz help me
    tnx , and sorry for my bad english

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Encryption & Decryption

    Split from this Codebank thread

  3. #3
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Encryption & Decryption

    Not a good idea to even try it. If it could be done easily, Virus programs would have exploited that way of deploying themselves long ago...

  4. #4
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    Re: Encryption & Decryption

    its actually not as hard as you might think randem, you just need to understand the Windows PE format (which I dont).

    I have an example that does it, however you will have to modify it slightly. The example load the exe from a file into a byte array, in your case you will have to load it into a byte array from the decrypted data. There is however, some things to take into consideration if you use code that can do this.

    1) This code crashes some computers, not all, but some. I have tried it out on 2 of my 3 computers, 1 of them crashed the other did not. I do not know why this is the case.

    2) You need an executable to act as a "container", this can be any executable on the system, including the executable you used to do the decrypting.

    3) The app.path of the executable will be the same as the executable you are using as the container, so if you used "c:\windows\system32\cmd.exe" as the container then the app path of the program loaded into memory will be "c:\windows\system32\"

    The way the code works is it takes the exe, parses the PE headers, then shells an instance of the container executable using create process API with a suspended process flag. it then replaces the loaded code in the process with the code of the exe (after the PE Headers have been parsed) and then resumes the process, thus your exe takes the place of the other application.

    I did not write this example, but i will upload it for your use.
    Attached Files Attached Files

  5. #5
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Encryption & Decryption

    Quote Originally Posted by Macka007
    its actually not as hard as you might think randem, you just need to understand the Windows PE format (which I dont).
    If you don't know, why would you respond to me... I do know...

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    4

    Re: Encryption & Decryption

    Quote Originally Posted by Macka007
    its actually not as hard as you might think randem, you just need to understand the Windows PE format (which I dont).

    I have an example that does it, however you will have to modify it slightly. The example load the exe from a file into a byte array, in your case you will have to load it into a byte array from the decrypted data. There is however, some things to take into consideration if you use code that can do this.

    1) This code crashes some computers, not all, but some. I have tried it out on 2 of my 3 computers, 1 of them crashed the other did not. I do not know why this is the case.

    2) You need an executable to act as a "container", this can be any executable on the system, including the executable you used to do the decrypting.

    3) The app.path of the executable will be the same as the executable you are using as the container, so if you used "c:\windows\system32\cmd.exe" as the container then the app path of the program loaded into memory will be "c:\windows\system32\"

    The way the code works is it takes the exe, parses the PE headers, then shells an instance of the container executable using create process API with a suspended process flag. it then replaces the loaded code in the process with the code of the exe (after the PE Headers have been parsed) and then resumes the process, thus your exe takes the place of the other application.

    I did not write this example, but i will upload it for your use.


    Tnx Dear

Posting Permissions

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



Click Here to Expand Forum to Full Width