Results 1 to 10 of 10
  1. #1
    XxDragonSharKxX's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Germany
    Posts
    290
    Reputation
    10
    Thanks
    44
    My Mood
    Aggressive

    Question [Help] Dll Loading and Saving via .INI[Solved]

    Hey ;D
    I got my own Injector and I wanna add a Save/Load function that will use a ini file.
    I got already a code but I need help to save the dll path and use it again...

    Heres my code:

    Code:
    Private Sub Button6_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
            Dim INI As New INIDatei, i As Integer
            INI.Pfad = My.Application******.DirectoryPath & "\savedlls.ini"
            For i = 1 To Dlls.Items.Count
                INI.WertSchreiben("Files", "Number of Files", Dlls.Items.Count)
                INI.WertSchreiben("Files", CStr(i), Dlls.tostring)
            Next i
    
        End Sub
    
        Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
            Dim INI As New INIDatei, max As Integer, i As Integer
            INI.Pfad = My.Application******.DirectoryPath & "\savedlls.ini"
            max = CInt(INI.WertLesen("Files", "Number of Files"))
    
            For i = 1 To max
                Dlls.Items.Add(INI.WertLesen("Files", CStr(i)))
            Next i
        End Sub
    INI.wertlesen = read ini files.
    INI.wertschreiben = write into ini files.
    INI.pfad = the place where the ini will be loaded or created

    I need help at the part of dll.tostring I get this message in the ini file:

    Code:
    [Files]
    Number of Files=2
    1=System.Windows.Forms.ListBox, Items.Count: 2, Items[0]: Mpgh CrossFire.dll
    2=System.Windows.Forms.ListBox, Items.Count: 2, Items[0]: Mpgh CrossFire.dll
    But I used 2 different dlls.
    It can only save this and not the path...
    Can someone help me ?

    Scan:
    Virustotal. MD5: 42bd80d5fd2049278ea917d09b58e7d4
    Last edited by XxDragonSharKxX; 07-01-2010 at 02:49 AM.

  2. #2
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Firstly, is the user loading the .dll's into a listbox in the injector? Please post more info?

    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)

  3. #3
    XxDragonSharKxX's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Germany
    Posts
    290
    Reputation
    10
    Thanks
    44
    My Mood
    Aggressive
    ok I upload the full project so you can see ;D wait a sec

  4. #4
    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 XxDragonSharKxX View Post
    ok I upload the full project so you can see ;D wait a sec
    Nah dw about uploading the whole thing.

    But does the user browse for each file and then the .dll path is added to a listbox?

    That's all I need to know.

    Edit, can you just post a SS of your Injector with a .dll added to it? Then I can help you.
    Last edited by Jason; 07-01-2010 at 01:55 AM.

    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)

  5. #5
    XxDragonSharKxX's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Germany
    Posts
    290
    Reputation
    10
    Thanks
    44
    My Mood
    Aggressive
    Sorry I'm german and good in English but not perfect xDD Just download it if you wanna have more information in the whole thing *please*
    Here's the Injector:
    https://www.mpgh.net/forum/290-crossf...stream-v*****ml

    The Save and Load feature is only in my Project because I need help at it ^^
    I try to answer you eh:
    The user browse it and it will be added to the listbox. There is only shown the name. And my new function have to save it and load it later ^^

  6. #6
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Okay I got this.

    Add this to your "Browse" button.

    [php]
    Dim ofd As New OpenFileDialog

    ofd.Title = "Browse for your .dlls..."
    ofd.RestoreDirectory = True
    ofd.Filter = ".DLL files (*.dll)|*.dll"

    If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then

    Dim raw As String = ofd.FileName
    Dim mod1 As String = raw.Replace(".dll", "")
    Dim q1 As Integer = mod1.LastIndexOf("\") + 1


    Dim final As String = mod1.Substring(q1)

    ListBox1.Items.Add(final)

    SaveSetting("InjectorDLLs", "Dlls", final, ofd.FileName)

    End If
    [/php]

    This will add your .dll to the listbox, and save the path.

    Now to inject you need the path of the .dll, so declare this at the top of the form just underneath "Public Class Form1"

    [php]
    dim dllLoc as String
    [/php]

    And add this to your "ListBox1_SelectedIndexChanged" sub

    [php]
    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
    dllLoc = GetSetting("InjectorDLLs", "Dlls", ListBox1.SelectedItem)

    End Sub
    [/php]


    This will give you the path of the selected .dll.


    NOW, saving all this to a .ini

    first declare this underneath "Public Class Form1"

    [php]
    dim path as string = (Application.StartupPath & "\SavedDlls.ini")
    [/php]

    THEN

    add this sub to your project

    [php]
    Private Sub SaveList()

    Using sWrite As New IO.StreamWriter(path)

    For Each p As String In ListBox1.Items
    sWrite.WriteLine(p)
    Next

    End Using


    End Sub
    [/php]

    That will save all your listbox items.

    Now this sub to load them

    [php]
    Private Sub LoadList()

    Using sRead As New IO.StreamReader(path)

    Do
    Dim lbDLL As String = sRead.ReadLine()

    If IsNothing(lbDLL) Then Exit Do

    ListBox1.Items.Add(lbDLL)

    Loop

    End Using
    End Sub
    [/php]

    This will add all your items back to the listbox.

    so whenever you need to save the list simply type

    [php]
    SaveList()
    [/php]

    and whenever you need to load the list

    [php]
    LoadList()
    [/php]

    And that's it.

    Problems, just ask.
    Last edited by Jason; 07-01-2010 at 02:20 AM.

    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)

  7. The Following User Says Thank You to Jason For This Useful Post:

    XxDragonSharKxX (07-01-2010)

  8. #7
    XxDragonSharKxX's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Germany
    Posts
    290
    Reputation
    10
    Thanks
    44
    My Mood
    Aggressive
    testing right now ;D thank you for you help, Ill pm you if I got problems thannnkkk you

    IT WORKS THANK YA D
    But where the ini gets saved :O ? ^^
    Last edited by XxDragonSharKxX; 07-01-2010 at 02:26 AM.

  9. #8
    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 XxDragonSharKxX View Post
    testing right now ;D thank you for you help, Ill pm you if I got problems thannnkkk you
    No problems, any time.

    Just remember that dllLoc contains the location of your currently .dll file.

    So to inject make sure you're injecting dllLoc, it will be constantly updated to whichever .dll is selected in the listbox.

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

    XxDragonSharKxX (07-01-2010)

  11. #9
    XxDragonSharKxX's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Germany
    Posts
    290
    Reputation
    10
    Thanks
    44
    My Mood
    Aggressive
    working yay No problem *.*

  12. #10
    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 XxDragonSharKxX View Post
    working yay No problem *.*
    Naice, glad it worked

    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)

Similar Threads

  1. [Help] Reading and Saving a textfile [solved]
    By SynergeticGoose in forum Visual Basic Programming
    Replies: 4
    Last Post: 10-31-2011, 09:47 PM
  2. [Solved] need Help using .dll's and injectors
    By ryansnipe007 in forum CrossFire Help
    Replies: 8
    Last Post: 08-06-2011, 02:36 PM
  3. [Help]Merge Exe and Dll[Solved]
    By Sixx93 in forum Visual Basic Programming
    Replies: 11
    Last Post: 04-09-2010, 10:44 PM
  4. [Help] Streamwriter Importing and Saving
    By Invidus in forum Visual Basic Programming
    Replies: 2
    Last Post: 03-07-2010, 02:21 AM
  5. [HELP] How do u save settings and check all checkboxes at once?
    By deathninjak0 in forum Visual Basic Programming
    Replies: 15
    Last Post: 11-18-2009, 03:02 PM