Results 1 to 12 of 12
  1. #1
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow

    [Question] Attaching a VB.NET program to another program.

    Hey guys.

    I figure it's possible but I'm not 100% sure.

    What I want to do is create a program in vb.net that you can select another programs .exe and whenever that program opens up, it automatically starts my program as well.

    i.e Say I want to attach it to..notepad.

    Basically, whenever the user opens notepad, my program will start running.
    I don't want to have to make it run constantly in the background and then do a
    "CheckProcess" to bring it to the front, although I can do that.

    I was thinking about it and I actually think I will go with the "CheckProcess" option because there's no way I can make it easily distributable to people if they have to perform some complex task of somehoe\w attaching it manually to their .exe...unless there is some way I could make my program do that on the first runtime (when they configure the settings)...

    Thoughts?

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    batch

    Code:
    @echo off
    start Notepad.exe
    start xxxx.exe
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. #3
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Hmm yeah, but for that to work the user would have to run the batch file right?

    I'm just meaning they run notepad and bam, my program automatically pops up. I think i'll just make it run in the background with a notifyicon and just pull it to front when it finds "Untitled - Notepad" << Default window when notepad opens.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  4. #4
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Quote Originally Posted by J-Deezy View Post
    Hmm yeah, but for that to work the user would have to run the batch file right?

    I'm just meaning they run notepad and bam, my program automatically pops up. I think i'll just make it run in the background with a notifyicon and just pull it to front when it finds "Untitled - Notepad" << Default window when notepad opens.
    its an idea, but having ONE MORE program running on background without being used...
    Well i know.. it wont take that much memory... but still ^^
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  5. #5
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Brinuz View Post
    its an idea, but having ONE MORE program running on background without being used...
    Well i know.. it wont take that much memory... but still ^^
    We're talking a 100kb program here

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  6. #6
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    My one and only idea:

    If you righ***ick on the program you can set the property on which program to open it with. Set your program, BUT make your program open it in notepad or whatever.

    Other way, I do not think it'll work out that easily.



  7. #7
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Give me a minute...It's damn easy...

  8. #8
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Damn you, seriously xD

    Well you know vb since like 8 years or so, I know it for 1 year and I don't 'learn' regulary =D

    Screw you anyways!!!! xD



  9. #9
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by FLAMESABER View Post
    Give me a minute...It's damn easy...
    Step back everyone, the pro is in the house.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  10. #10
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108



  11. #11
    snipe76's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    54
    My Mood
    Fine
    i don't think so.
    the notepad.exe need to have a code like "process.open XXXX"
    the notepad need a code to run you'r program.
    i mean that u cant run ur program if the notepad doesn't say to run it.
    (lol don't be bad to me if i say that i don't think u can do it)

  12. #12
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    First add this sub to your program:

    Sub AddToRegistry( ByVal extension As String )
    My.Computer.Registry.ClassesRoot.CreateSubKey(exte nsion).SetValue( "",extension,Microsoft.Win32.RegistryValueKind. String )
    My.Computer.Registry.ClassesRoot.CreateSubKey(exte nsion & "\shell\open\command").SetValue( "",Application.ExecutablePath & " ""%l"" ",Microsoft.Win32.RegistryValueKind. String )
    End Sub

    Then add the following code to the project's load event:


    AddToRegistry( ".xml")

    'Add to registry method will register the extension you are trying to associate. For example I just associated my application with .xml files.

    For Each Argument As String In My.Application.CommandLineArgs
    Dim ReadContent As String = My.Computer.FileSystem.ReadAllText(Argument)
    'Just read it and display it in a textbox or message box.
    Richtextbox1.text = ReadContent
    'If you just want to read the contents then exit Loop
    Exit For
    Next

    This code will read all the text in the file you opened. For example you opened "FlameXaber.xml", it will load all the text that resides in that file. Hope this helps !!

    @Blubb: Lol, I am using it for just 4 years.
    @Snipe: Done xD

    Sorry for late reply. My internet was down.

  13. The Following User Says Thank You to Hassan For This Useful Post:

    'Bruno (05-27-2010)

Similar Threads

  1. [Question] Best Cracker For .Net
    By aLcohoL_95 in forum Visual Basic Programming
    Replies: 16
    Last Post: 10-15-2010, 09:30 PM
  2. [Help]How to start another program?[Solved]
    By Web-Designer in forum Visual Basic Programming
    Replies: 11
    Last Post: 09-04-2010, 11:13 PM
  3. [Question]form As A Startup Program???
    By nathanael890 in forum Visual Basic Programming
    Replies: 14
    Last Post: 02-09-2010, 06:50 PM
  4. How to attach keylogger whit any program
    By sunbun in forum Programming Tutorial Requests
    Replies: 4
    Last Post: 02-05-2009, 02:56 AM
  5. Question, Cant load Nexon.net or game
    By Zerolivekg in forum Combat Arms Hacks & Cheats
    Replies: 2
    Last Post: 12-22-2008, 09:09 PM