Injected dlls

Posts 1–15 of 19 · Page 1 of 2
Injected dlls
How to show in listboxinjected dlls ?
exaple: i make dll and inject it to my app and my app shows in listbox : myinjected.dll
@tynab
A list of all dll's used by the process?
Quote Originally Posted by Pingo View Post
@tynab
A list of all dll's used by the process?
yes .
@tynab

I'm not a very good vb coder but i'll give it a shot.

Code:
    Public Function GetModules(ByVal ProcessName As String) As List(Of String)
        Dim Proc As Process() = Process.GetProcessesByName(ProcessName)
        If Proc.Length = 0 Then
            Return Nothing
        End If
        Dim lst As List(Of String) = New List(Of String)
        For Each M As ProcessModule In Proc(0).Modules
            lst.Add(M.ModuleName)
        Next
        Return lst
    End Function
I'll use the solitaire game as an example.

Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ListBox1.DataSource = GetModules("Solitaire")
    End Sub
Quote Originally Posted by Pingo View Post
@tynab

I'm not a very good vb coder but i'll give it a shot.

Code:
    Public Function GetModules(ByVal ProcessName As String) As List(Of String)
        Dim Proc As Process() = Process.GetProcessesByName(ProcessName)
        If Proc.Length = 0 Then
            Return Nothing
        End If
        Dim lst As List(Of String) = New List(Of String)
        For Each M As ProcessModule In Proc(0).Modules
            lst.Add(M.ModuleName)
        Next
        Return lst
    End Function
I'll use the solitaire game as an example.

Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ListBox1.DataSource = GetModules("Solitaire")
    End Sub
listbox is empty ?
i want that when i inject my dll , app opens and show name of dll that is injected
Quote Originally Posted by tynab View Post

listbox is empty ?
i want that when i inject my dll , app opens and show name of dll that is injected
what Pingo said...
Code:
    Public Function GetModules(ByVal ProcessName As String) As List(Of String)
        Dim Proc As Process() = Process.GetProcessesByName(ProcessName)
        If Proc.Length = 0 Then
            Return Nothing
        End If
        Dim lst As List(Of String) = New List(Of String)
        For Each M As ProcessModule In Proc(0).Modules
            lst.Add(M.ModuleName)
        Next
        Return lst
    End Function
and ListBox1.Items.AddRange(GetModules("notepad"))
Quote Originally Posted by user590177 View Post


what Pingo said...
Code:
    Public Function GetModules(ByVal ProcessName As String) As List(Of String)
        Dim Proc As Process() = Process.GetProcessesByName(ProcessName)
        If Proc.Length = 0 Then
            Return Nothing
        End If
        Dim lst As List(Of String) = New List(Of String)
        For Each M As ProcessModule In Proc(0).Modules
            lst.Add(M.ModuleName)
        Next
        Return lst
    End Function
and ListBox1.Items.AddRange(GetModules("notepad"))
Code:
ListBox1.Items.AddRange(GetModules("notepad"))
gives me error
I think the answer was posted by Pingo in a very similar thread, posted a couple days ago.
http://www.mpgh.net/forum/33-visual-...form-show.html
>> Pingo
"
Thats because you can't just inject a .net dll and have it run.
You need to download an injector that'l host the clr or make a C++ bootstrap.
99% of the injectors on this site will only work for C++ dll's.
"

ie. you're using .net framework & _targetProcess wasn't made in .net, but you still need .net
lol, i made injector and when i inject with it i get msgbox "made by tynab" cuz i made test dll and i want listbox in my app to show that dll name (dll name of njected dll)
lol that you can inject, but not do this. Pingo's code was very close.

"i want that when i inject my dll , app opens and show name of dll that is injected"
^v contradict eachother :/
Quote Originally Posted by Pingo View Post @tynab
A list of all dll's used by the process?
yes .


"i made injector and when i inject with it i get msgbox "made by tynab""

so replace "made by tynab" with "this.fileName" or whatever :/ ??
or
Pingo's code.

Otherwise, not sure what you mean.
Quote Originally Posted by abuckau907 View Post
lol that you can inject, but not do this. Pingo's code was very close.

"i want that when i inject my dll , app opens and show name of dll that is injected"
"i made injector and when i inject with it i get msgbox "made by tynab""


so replace "made by tynab" with "this.fileName" or whatever :/ ??
or
Pingo's code.

Otherwise, not sure what you mean.
msgbox is made in dll (c++) , in another app i want that it show in listbox name of dll that is injected in that app !
Ping's code is extremely close. You said the listbox is empty....obviously* the process has loaded modules, so the code must be wrong. but it's very close.

look up "how to enumerate modules used by process - in .Net" ..i'll post code in a second. maybe.
but i want code that works , im not on computer now so i cant try to fix it but when i tested it it didnt work
Quote Originally Posted by tynab View Post
but i want code that works ...
^^ I'm keeping this quote lol

copy-paste will be here in a moment...

Code:
        Dim _pmc As ProcessModuleCollection = urProcess.Modules 'i found this by typing in Process.(see period) and looking at intellisense. pretty well named...I just made a guess..
        For Each aModule As ProcessModule In _pmc
            ListBox1.Items.Add(aModule.ModuleName)
        Next
''same as pingo's code: works for me :/
''edit: you must have got 'process name' wrong..probably included ".exe" hehe :/
^^change urProcess to ..your process. :\ I can't know what you named the variable, because YOU posted NO code



edit: When you do get home and test this, will you PLEASE respond if it worked or not. Despite what you may think, I don't like being the 'last comment' on a thread.

edit2: if your 'injected dll' doesn't show up in the list (idk, never tested this way actually), that's a separate issue: I just want to know if the listbox populates with the *normal* dll's used by the target app.
Ah well! haha
It worked fine for me
Posts 1–15 of 19 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us