Results 16 to 30 of 84

Threaded View

  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

    [Open Source] Injection Library - C#

    Wazzzuuuup.

    Been working on this for a while now. It's a .NET library with various injection methods which make it very straightforward to make your own injectors/loaders. It even includes a public Manual Map injection method.

    Although the source is in C#, the compiled library is usable in both VB.NET and C#, depending on your language preferences. I have included both the raw binary as well as the project folder in the attachments to this post.

    The source is fairly documented, but I get lazy so there may be sections that you'll need to work out for yourself when looking into the source. The project targets .NET 2.0, so there should be no compatibility issues with projects you want to make.

    To use the library, simply create a new .NET project and add the library as a project reference. (Project >> Add Reference >> Browse >> Locate DLL)

    I've implemented this library using a factory pattern, so using the various different injection methods are very straightforward. All the various types of injection inherit from the base "InjectionMethod" class, which implements two different methods for injecting.

    Code:
    Inject(...)           // inject a single module
    or
    InjectAll(...)        // inject a range of modules
    Both of these methods have various overloads but the key point is that each method can either inject from a PortableExecutable object, or from a file location. A PortableExecutable object can be created in-memory, or from a file location. This means that when using ManualMap injection, it's possible to inject a DLL without it ever touching the harddisk during the injection process. Standard/ThreadHijack methods both call LoadLibrary, so even if you pass a PortableExecutable object to these injection methods, the module will be written to disk in a random location.

    The two main namespaces you'll likely refer to are going to be
    Code:
    C#
    using InjectionLibrary;
    using JLibrary.PortableExecutable;
    
    VB.NET
    Imports InjectionLibrary
    Imports JLibrary.PortableExecutable
    Example 1: Using the creation factory to make an injection method
    Code:
    C# -
    InjectionMethod injector = InjectionMethod.Create(InjectionMethodType.ManualMap);
    
    VB.NET -
    Dim injector As InjectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap)
    Example 2: Super-stealthy injection from resources.
    Code:
    C# -
    var injector = InjectionMethod.Create(InjectionMethodType.ManualMap);
    var processId = Process.GetProcessesByName("engine")[0].Id;
    var hModule = IntPtr.Zero;
    
    using (var img = new PortableExecutable(Properties.Resources.TestDll))
        hModule = injector.Inject(img, processId);
    
    if (hModule != IntPtr.Zero)
    {
        // injection was successful
    }
    else
    {
        // injection failed
        if (injector.GetLastError() != null)
            MessageBox.Show(injector.GetLastError().Message);
    }
    
    
    
    
    VB.NET -
    Dim injector As InjectionMethod = InjectionMethod.Create(InjectionMethodType.ManualMap)
    Dim processId As Integer = Process.GetProcessesByName("engine")(0).Id
    Dim hModule As IntPtr = IntPtr.Zero
    
    Using img As New PortableExecutable(My.Resources.TestDll)
        hModule = injector.Inject(img, processId)
    End Using
    
    If hModule <> IntPtr.Zero
        ' injection successful
    Else
        ' injection failed
        If injector.GetLastError() IsNot Nothing
            MessageBox.Show(injector.GetLastError().Message)
        End If
    End If
    Virus Scans
    Binary:
    [x][x]
    Source:
    [x][x]

    That's about the crux of it, the injector is on x86 compatible, meaning you won't be able to inject into x64 processes, but that shouldn't be too much of an issue. If you have any other questions about using the library, just ask in the thread.
    The library is released under the GNU GPL, so you're free to use the library however you wish, I'm not responsible for whatever you make with it though, and I ask for a mention if you release an injector/loader using my library, nothing fancy just an acknowledgement of my work.

    Cheers,
    Jason
    <b>Downloadable Files</b> Downloadable Files
    Last edited by BACKD00R; 11-20-2013 at 12:37 PM.

    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. The Following 373 Users Say Thank You to Jason For This Useful Post:

    -Vinicius (12-15-2016),.Ninja66 (06-22-2016),//VOLT (07-13-2015),1234filip (10-10-2017),159753cado25 (10-07-2016),9r053cut0r (02-27-2024),a1419322593 (05-14-2020),a50dani (05-26-2015),AbuHaschi (11-06-2018),abwen (12-27-2012),adinhodzic (11-13-2014),Afdul (10-12-2017),affenaff (10-31-2016),aggelos13e (10-18-2018),akbargain (09-17-2018),akocjohn73 (12-05-2014),AkumuRu (03-02-2013),alepchan (08-14-2015),alexchin0 (03-23-2016),alfred112 (12-07-2014),alkabiiru (08-09-2015),AlphaAnonymous (11-11-2015),amirtyga1 (04-28-2017),annamaxwell777 (02-28-2016),AnwerMatterXD (02-19-2016),appler (03-08-2016),archimonde10 (02-14-2016),ariez_zz (05-17-2019),aryo1990 (06-07-2014),azerty9 (01-17-2016),Azilem (04-03-2018),Badmeen (06-21-2016),BAGyBagy (10-22-2017),beeatz_7 (03-03-2020),Bekira (01-30-2019),biboy45y (11-28-2014),Biesi (07-03-2013),BigBawlsDaddy (08-21-2018),bilyboold (09-01-2015),blacksilent (12-27-2018),Black_Zyther (01-26-2016),bosskong (02-15-2018),boykaka1 (02-04-2018),boykakaa (10-21-2016),bra101yan (03-08-2017),brato14 (02-06-2013),Broderick (10-23-2012),cabebakar (10-25-2015),cablehead (04-23-2014),Calien (12-12-2012),Camper008 (05-15-2014),carl3399 (06-10-2014),cel4l1903 (09-09-2014),cenkzenk (07-28-2013),cherascc (02-16-2018),chiziahu (01-13-2017),chrisredfild (11-21-2012),clayton023 (02-27-2016),cob_258 (08-30-2015),Cod3hack (09-18-2015),Code4Dot (03-19-2015),coldreader (08-10-2014),coolestgamer123 (05-31-2016),Coulray (09-14-2014),cristianoramon (05-31-2015),Cryptonic (05-08-2013),cubay (02-02-2019),cyril143 (09-01-2014),daissy (05-05-2014),dalejandro93221 (07-04-2020),danie2 (07-18-2015),danieelee (03-12-2020),dariowouters (10-27-2015),DawgiiStylz (11-02-2012),Dazzyblow (04-01-2014),deakgegi (11-17-2015),decardenas30 (08-09-2018),DEiseL (10-03-2018),dirzonor (08-24-2016),distiny (12-12-2012),dkssudgktpdy (01-28-2015),Dong'Rickz (04-05-2015),Down7 (01-15-2019),dreek1 (08-24-2014),driftamaniq_dk (02-24-2014),dsadwdda (12-23-2015),dydgus2211 (01-27-2023),DyNamoTR (03-02-2013),dynazone (06-06-2018),Dzzy (05-08-2016),e-skillz (11-05-2016),e5564265 (04-14-2015),Eaglepk (03-12-2014),elfutrao02 (04-19-2017),end360 (07-27-2013),eqloser (02-07-2016),EtcaYee (04-01-2015),EvacTest (10-10-2020),Fandangos Cheats (02-12-2015),fernandotdb (01-26-2013),Firewolf25612 (06-02-2019),flashcoder (04-11-2017),flashyyxd (05-15-2017),Flegy (11-30-2012),[MPGH]Flengo (11-10-2012),Flzduden (11-23-2015),FourDJ (09-08-2019),foxgirl (12-31-2016),frankobol (04-24-2013),fredemm (02-28-2013),FUFYN (05-31-2014),FukkYouall (02-13-2015),fwsefwsgrgwhergr (11-02-2012),G-Forc3 (12-03-2014),g3troot (08-20-2017),GalaxyBurg (04-21-2017),galbukra12 (10-14-2018),GeneralG (04-18-2017),GicuPiticu (05-07-2016),gilababi88 (10-10-2018),gjac101 (01-22-2018),globetrother1 (03-20-2016),grosbouc (10-03-2016),GTX970 (12-26-2014),guilhermelenine (05-13-2016),guitarman1209 (12-23-2012),GuitarPlayer20 (02-18-2017),Gun_Adder (10-27-2012),gz1p (11-05-2014),Hacker Fail (08-11-2015),hackx38 (02-21-2019),hallo133 (05-25-2014),harifdjs (05-03-2018),HeavenHU (05-07-2015),hellmaker13 (10-27-2012),hellomen11 (09-03-2014),Hell_Demon (10-23-2012),hemiru (05-15-2018),hernande (01-21-2016),RuShi (08-30-2016),hjames (07-01-2014),holyswordman (06-10-2015),homiekg (11-14-2018),Houshasei (02-05-2017),iceguy (03-04-2013),ih8umom (12-23-2017),iK3ksii (01-11-2013),illustre (07-18-2014),imba4 (02-20-2017),ImNotPasting (12-16-2017),iNational (01-18-2019),IndigoAs (05-09-2015),IrlImba (11-01-2013),IStoleUrAWP (06-14-2013),itzlit (04-22-2021),ivanJo (02-24-2018),jackforzaliy (06-12-2020),Jackilous (04-10-2015),james0123 (06-06-2014),janghyunseung (07-07-2015),jangminrui (02-20-2019),JaredMoreno91 (05-12-2018),jericsond (12-22-2014),Johnaudi (02-08-2015),JohnMLS (05-27-2014),jokerz3211 (12-29-2012),jolaxnopra (06-22-2016),jonluke (09-15-2017),Jules_ (07-29-2016),JVN (02-19-2017),k3c04kcyb3r (10-24-2016),karaulov (06-23-2013),KelmoX (08-20-2014),Kenshin13 (05-29-2013),kevin_thevet_413 (07-14-2013),kianyoungz2 (12-03-2017),krazyshank (12-26-2012),Krouzu (05-03-2017),kutyaropi (02-24-2018),kyongyeol96 (08-02-2015),LandoKane (11-06-2022),Leacher2019 (01-27-2019),lidooma (10-14-2016),LilGho$t (02-09-2013),llSN0Wll (08-12-2015),lockhong3 (10-28-2012),lolagames (12-31-2017),lolwhutwtf (12-23-2013),longdaik (08-24-2018),longlai (05-09-2015),LordHardy2 (09-02-2016),lordshiva (12-09-2022),Lovroman (11-03-2013),luismag (03-13-2015),luzj (02-20-2013),LynxaaHF (07-18-2018),M2m0ryZ (02-15-2016),M3ISTER (03-30-2016),m4rr1o0 (12-24-2017),maben (03-21-2016),madeven (11-20-2012),Mafia67 (08-05-2016),malfac009 (11-17-2017),mangobutz (10-19-2018),Margen67 (08-05-2016),Mark325 (03-15-2013),MasterBS (04-02-2014),MasterFuhrer (10-20-2017),mavs789 (12-29-2016),maxparos (01-30-2013),[MPGH]Mayion (08-06-2015),medo mansor (11-16-2012),mell30 (04-16-2014),Melman7 (08-12-2013),meloy988 (03-14-2016),MemoryThePast (01-10-2019),mendbest (10-17-2015),mhuquasar (12-03-2018),mindaugas242424 (12-10-2012),MinorPro (12-14-2018),mirekb44 (01-07-2017),Mjmuneeb (05-21-2018),mo7sen99 (03-29-2015),moka123 (07-27-2015),Morpheus2711 (03-18-2015),moru123 (06-08-2018),mousselecrest (03-12-2016),mrasipila (01-04-2018),mrsgo97 (08-10-2015),mrsnapznetX (03-09-2016),MrStabber (08-31-2017),MRX1337 (02-18-2017),mssgst (05-26-2013),muraj123 (08-20-2017),N1ce_Boy (11-03-2014),nellyblack (03-03-2013),NeTBuS (01-28-2013),neutro11230 (05-02-2018),nevachanaa (08-06-2017),new124tan (06-19-2015),NewbieXXX (07-09-2018),Nicholai1232 (04-11-2014),Nickitee (03-21-2013),nico9551 (01-17-2018),NIgga* (08-24-2014),njoyurlife (12-13-2012),nnerio (03-19-2018),nnl1212 (10-19-2018),nnnhitman (12-26-2014),NooNaame (10-03-2015),oamzero2555 (07-18-2015),Paradise2509 (10-13-2016),PaRaVoZIK (05-19-2015),pein9 (05-18-2019),petr1981 (04-13-2017),Ph4nton (07-31-2015),phakguarddong (10-26-2013),Phoenix1337 (02-26-2013),pionkjeffery (11-22-2012),Pixelhut (06-08-2016),Pizzanut (07-13-2017),popcorio (06-11-2017),PPCINJ (04-12-2013),praveen63 (02-22-2016),Print (11-16-2012),ProgramerPower (04-13-2015),PunX_Silent (11-09-2014),PusherCZ12456 (11-10-2015),QCoder (05-15-2017),qwer333 (07-15-2017),R3DDOT (05-01-2014),Randombest (05-20-2018),Rastajan (03-25-2014),RathensDox (08-17-2019),RATzone Community (04-19-2017),rayssenjellouli (01-06-2017),Rayttor (08-03-2021),reapermark (11-03-2012),redspartan927 (01-28-2013),reidjako123 (02-27-2016),reymond143 (02-15-2018),Rigbone (02-17-2016),riquelme888 (03-20-2013),robinso (02-23-2013),romi0913 (01-23-2020),ronoazoro1231 (05-01-2017),Rullez (09-16-2014),Rullez's Sheep (03-24-2015),ryan13223 (07-20-2016),ryanfung599 (02-04-2019),Ryodvincenta (11-18-2016),Ryuzaki™ (12-28-2014),sajmon69 (06-16-2019),salasta (01-19-2016),SAMCRO (03-02-2013),saqib31 (11-06-2012),Sasha2132 (04-26-2017),SchokkEngine (04-11-2017),SCRABi (06-14-2017),sean337 (08-13-2013),sebasnieto241 (04-12-2017),Sepius (03-29-2017),SHADO0 (04-09-2015),Shadow Mask (09-27-2015),Shadow606 (12-16-2016),shiftbanks (12-31-2018),ShockByte (12-02-2016),shomasso (03-09-2013),sialrr (11-26-2023),sifenks55 (12-31-2014),Silent (09-12-2016),Skylar2123 (12-04-2016),SlowIND (03-02-2016),smallC (07-16-2013),snoopcreep (10-23-2017),something1234567 (09-27-2016),Spade1974 (06-26-2018),Sqoqu (11-12-2016),srg.bacon (02-21-2015),sukakurva (12-25-2020),super3star (05-07-2015),SuperSusssss (02-18-2022),suppanut (03-29-2018),szczurcio1 (08-27-2014),Tailed-Beast (01-30-2017),terribly (05-31-2023),testube (09-10-2014),teufel123 (11-21-2013),Thaisen (11-20-2016),The Decoder (12-17-2012),TheBruce (03-05-2017),TheG2ek (06-30-2019),THEMINECRAFT951 (05-03-2015),thorin1 (12-29-2018),Timboy67678 (01-10-2014),Timon22 (05-22-2019),Tombas (03-18-2014),TopListVotes (11-14-2014),Tormiasz (11-24-2015),TreZide (05-06-2018),ttp1 (07-21-2018),uCares (01-21-2014),unknownalt (05-14-2016),Username33q (10-28-2020),van4221 (12-14-2012),vanjazd (10-30-2021),vaxvam (07-06-2013),VEDDEV (08-02-2020),VeNTaGG (04-16-2013),Vjaceslavs (12-01-2016),wafinasir (05-24-2016),wakeup2014 (08-07-2015),wakoji9936 (10-08-2020),walkatroh34 (09-27-2016),waqg2211 (12-26-2014),weracksa (02-26-2013),xah4 (03-30-2015),xbonsai (06-08-2020),xcyber17 (02-13-2016),xelipe (11-03-2016),XFaktor (03-10-2015),xlonz11 (12-09-2015),xuxuzinho123 (11-29-2018),xxtoperxx76 (04-11-2019),yetao (03-23-2016),zenforic (07-25-2016),ziziou (04-15-2014),zmodteam (03-01-2017),zpeachy (08-02-2016),zznika (02-25-2013),Zzuk (08-29-2015),_VERSTROATE_ (12-29-2012),`Techno (07-08-2013)

Similar Threads

  1. [Tutorial] Finding Source Code of Not Open Source Programs
    By treeham in forum C++/C Programming
    Replies: 21
    Last Post: 03-28-2010, 08:35 AM
  2. Open Source Release. Semi-Useless Timer Source Code!
    By User1 in forum Visual Basic Programming
    Replies: 6
    Last Post: 09-20-2009, 02:55 AM
  3. Combat Arms Utilities Open Source Project
    By User1 in forum Combat Arms Hacks & Cheats
    Replies: 28
    Last Post: 09-20-2009, 02:08 AM
  4. Replies: 0
    Last Post: 09-01-2008, 08:28 PM