CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2012
    Posts
    20

    Unhappy join/bind 2 exe files

    Can any one help me here
    I want join 2 exe files together,create new file is = join of two.if I open new file then both should be excuited
    But i am fail still

    my code problem here

    using System;
    using System.Windows.Forms;
    using System.IO;

    namespace Bind
    {
    public class Bind
    {
    [STAThread]
    private static void Main ()
    {
    string dir = Application.StartupPath + "\ \";

    FileStream fs1 = File.OpenRead (dir + "1.exe");
    FileStream fs2 = File.OpenRead (dir + "2.exe");

    byte [] p1 = new byte [fs1.Length];
    fs1.Read (p1, 0, (int) fs1.Length);

    byte [] p2 = new byte [fs2.Length];
    fs2.Read (p2, 0, (int) fs2.Length);

    FileStream fs3 File.Create = (dir + "3.exe");

    fs3.Write (p1, 0, p1.Length);
    fs3.Write (p2, 0, p2.Length);

    return;
    }
    }
    }

  2. #2
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: join/bind 2 exe files

    Right. Simply byte-wise concatenating two exe's will not succeed. You can merge two .NET assemblies using ILMerge: https://research.microsoft.com/en-us...t/ilmerge.aspx
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  3. #3
    Join Date
    Dec 2012
    Posts
    20

    Re: join/bind 2 exe files

    Quote Originally Posted by BioPhysEngr View Post
    Right. Simply byte-wise concatenating two exe's will not succeed. You can merge two .NET assemblies using ILMerge: https://research.microsoft.com/en-us...t/ilmerge.aspx
    thanks you sir BIOPHYSENGR
    but still can not get it.why its not possible simply as I done

  4. #4
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: join/bind 2 exe files

    Executables have a specific format, just like any common file type. You also couldn't, for example, take two images and concatenate them together merely byte-wise contatenating them. Each file contains some header data that is expected at the beginning of an image. Finding a header half way through is unexpected and would likely be interpreted as a sign of data corruption. However, you could use a new program to write a NEW header telling the computer to expect a longer data region that happened to contain the information required for both images. Back to executables - an analogous situation is in effect - .NET executbles follow an extended version of the PE format, see https://en.wikipedia.org/wiki/PE_for..._the_PE_format
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  5. #5
    Join Date
    Dec 2012
    Posts
    20

    Re: join/bind 2 exe files

    Quote Originally Posted by BioPhysEngr View Post
    Executables have a specific format, just like any common file type. You also couldn't, for example, take two images and concatenate them together merely byte-wise contatenating them. Each file contains some header data that is expected at the beginning of an image. Finding a header half way through is unexpected and would likely be interpreted as a sign of data corruption. However, you could use a new program to write a NEW header telling the computer to expect a longer data region that happened to contain the information required for both images. Back to executables - an analogous situation is in effect - .NET executbles follow an extended version of the PE format, see https://en.wikipedia.org/wiki/PE_for..._the_PE_format
    thank you so much sir,thanks a lot.now I understand.for extra can you make a binder example for me?if not than also thank you,i am gona study more about that.currently im student

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: join/bind 2 exe files

    @yousufshah, what would be the benefit of combining two exe's into one as you've suggested?

  7. #7
    Join Date
    Dec 2012
    Posts
    20

    Re: join/bind 2 exe files

    Quote Originally Posted by Arjay View Post
    @yousufshah, what would be the benefit of combining two exe's into one as you've suggested?
    @Arajy. I want be a good security engineer , So these bad Trojans things I have to learn, after that I will study on antiViruse
    I have some offers from Vsecure antivirus job.
    Still I am fresh,and rejected at some interviews. So want learn more
    Now started coding in C#
    i done java,assembly,c .html, .net and some php
    but I am still beginner.bc student at uni and no physical experiences.
    hard time and short.so want learn more and more about trojans and viruses

  8. #8
    Join Date
    Dec 2012
    Posts
    20

    Re: join/bind 2 exe files

    If some 1 can make a source for me,I can pay him,

  9. #9
    Join Date
    Dec 2012
    Posts
    20

    Re: join/bind 2 exe files

    Quote Originally Posted by BioPhysEngr View Post
    Right. Simply byte-wise concatenating two exe's will not succeed. You can merge two .NET assemblies using ILMerge: https://research.microsoft.com/en-us...t/ilmerge.aspx
    i Just want join two files like in IExpress. drop/extract both files at @appdata and execute file #1 and file # 2

  10. #10
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: join/bind 2 exe files

    Ah, however, discussion of methods for creating viruses and other malicious programs is not permitted on this forum (see the AUP).

    [ Thread closed ]
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

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

Featured