Results 1 to 23 of 23

Thread: [RESOLVED] how can i run exe file from embedded files(Resource)?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Resolved [RESOLVED] how can i run exe file from embedded files(Resource)?

    how can i run exe file from embedded files(Resource)?
    can run exe file from embedded resource without extract it?(anti hack)
    thanks

  2. #2
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: how can i run exe file from embedded files(Resource)?

    There's no way around it that I've been able to find thus far, you'll need to extract it to a temp location, run it, then delete it when done.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    There's no way around it that I've been able to find thus far, you'll need to extract it to a temp location, run it, then delete it when done.
    no i need another way and secure?

  4. #4
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: how can i run exe file from embedded files(Resource)?

    Quote Originally Posted by kakablack
    no i need another way and secure?
    If you find a way, let me know, I've got a .net app where the client wants this done too.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  5. #5
    Addicted Member pcuser's Avatar
    Join Date
    Jun 2008
    Posts
    219

    Re: how can i run exe file from embedded files(Resource)?


  6. #6
    Addicted Member pcuser's Avatar
    Join Date
    Jun 2008
    Posts
    219

    Re: how can i run exe file from embedded files(Resource)?

    The code that's being discussed in that thread can be found here http://www.freevbcode.com/source/0107/RUNPE.zip

    Load the app that you want to run as a custom resource then change the Command1_Click event to this:

    Code:
    Private Sub Command1_Click()
        Dim resBYTE() As Byte
        resBYTE = LoadResData(101, "CUSTOM")
        RunExe App.Path & "\" & App.EXEName, resBYTE   
    End Sub
    This will extract your embedded app to a byte array and run it from ram without ever having to touch the hard drive.

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how can i run exe file from embedded files(Resource)?

    Error at RunExe App.Path & "\" & App.EXEName, resBYTE

    Can not start victim process!


    Should be
    Code:
    Private Sub Command1_Click()
     Dim resBYTE() As Byte
     
     resBYTE = LoadResData(101, "CUSTOM")
      
     RunExe Text1(0).Text, resBYTE
    End Sub
    Attached Files Attached Files
    Last edited by jmsrickland; Feb 19th, 2009 at 06:29 PM.

  8. #8
    Addicted Member pcuser's Avatar
    Join Date
    Jun 2008
    Posts
    219

    Re: how can i run exe file from embedded files(Resource)?

    That's because you're running it from the vb ide. Compile it and run the exe.

  9. #9
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how can i run exe file from embedded files(Resource)?

    OK, but if you use my statement you can run it from both IDE and EXE modes


    NOTE:

    At first I got that error with your statement. But not with my statement. Then I compiled it. Now it works using either statement. Reason is that a RUNPE.EXE exist in the working directory and even though your are in the IDE mode it picksup the RUNPE.EXE from the folder. But if you do not have the RUNPE.EXE in the folder it wont work using your statement in IDE but it will using mine.
    Last edited by jmsrickland; Feb 19th, 2009 at 06:40 PM.

  10. #10
    Addicted Member pcuser's Avatar
    Join Date
    Jun 2008
    Posts
    219

    Re: how can i run exe file from embedded files(Resource)?

    OK, fair enough. I just use "RunExe App.Path & "\" & App.EXEName, resBYTE" because I can guarantee that that exe is going to be there at that location no matter what computer it's running on. I should've mentioned that it has to be compiled to work though.

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    is it work on win98 or vista?

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    is it work on win98 or vista?
    and
    i have some dll with this exe file! how use it?

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    nobody answer to me?

  14. #14
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how can i run exe file from embedded files(Resource)?

    Quote Originally Posted by kakablack
    is it work on win98 or vista?
    and
    i have some dll with this exe file! how use it?
    It worked on Windows XP and I don't know what your question is about how to use DLL with EXE.

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    RUNPE.zip (9.2 KB, 12 views)
    i use this code but this code run exe in norma focus mode!
    can i run my exe with this code but in Hide mode?

  16. #16
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how can i run exe file from embedded files(Resource)?

    I looked at the entire source code and I cannot find any way to run the EXE in Hide mode.

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    i change some param but worked for some application but if program run with delay it cant hide!
    why?

  18. #18
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how can i run exe file from embedded files(Resource)?

    Can you not add Me.Visible = False to application?

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    Can you not add Me.Visible = False to application?
    are u kiding!
    how u can add me.vis... to a compiled application?!

  20. #20

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    RUNPE.zip (9.2 KB, 17 views)
    can i run a exe with wait param
    example
    shell and wait until complete
    Private Sub Command1_Click()
    Dim resBYTE() As Byte

    resBYTE = LoadResData(101, "CUSTOM")

    RunExe(and wait to complete) Text1(0).Text, resBYTE <<<< is possible?
    End Sub
    thanks

  21. #21
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how can i run exe file from embedded files(Resource)?

    The reason I said that about Me.Visible is because in your post #15 you said can i run my exe with this code but in Hide mode? And my exe implies that it is your executible so it would be normal to assume that you have all the resources to this executible which would include the source code.

  22. #22

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Posts
    156

    Re: how can i run exe file from embedded files(Resource)?

    The reason I said that about Me.Visible is because in your post #15 you said can i run my exe with this code but in Hide mode? And my exe implies that it is your executible so it would be normal to assume that you have all the resources to this executible which would include the source code.
    yes exe is binary no source

  23. #23
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: how can i run exe file from embedded files(Resource)?

    I know exe is binary. That isn't what I said. If you say it's your exe then it's easy to assume you also have the source code to it. That's all. How can you have an exe that is yours and not have the source code to it. If you didn't compile it then it isn't your exe; know what I mean.

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