Results 1 to 10 of 10
  1. #1
    blackgaming's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    72
    Reputation
    10
    Thanks
    6
    My Mood
    Aggressive

    [HELP]Visual Basic

    1st Question Sir how can i make an application that auto choose a dll..?

    Example : I make an injector and i want to make that injector to choose a dll in auto.. how can i make that ? Help me please... so the one that will use the injector will not know where the dll is..

    2nd question Sir

    I would like to know how i can get the location of c:\windows\system32 because some pc install windows not at C: drive

    Thanks in Advace !!
    Last edited by blackgaming; 01-20-2011 at 01:13 AM.

  2. #2
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Answer to Question 1

    Have dll in the same path as application (as in the same folder)
    then set to inject dll from application path using

    Code:
    Application.StartupPath
    or

    Code:
    Application.Executablepath
    @ Question 2

    You can get the system folder using

    Code:
    Environment.GetFolderPath(Environment.SpecialFolder.System)
    A example of use would be

    Code:
    MsgBox(Environment.GetFolderPath(Environment.SpecialFolder.System))
    Test this on Form1_Load and you should get a message box listing the system32 folder path, you can use this method to return the system32 folder.





     


     


     



    The Most complete application MPGH will ever offer - 68%




  3. #3
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    1. Locate current folder via. Application.StartupPath (environment.currentdirectory can change)
    2. Enumerate all (or one) DLL file(s) in that folder using Directory.GetFiles
    3. Inject!

    EDIT: The below is incorrect. Thanks NextGen1 for pointing that out! See further details here.
    For your second question C:\ is ALWAYS the active Windows drive path - C:\WINDOWS\system32 will always be located at that position.
    Last edited by freedompeace; 01-21-2011 at 02:43 AM.

  4. The Following User Says Thank You to freedompeace For This Useful Post:

    Hassan (01-21-2011)

  5. #4
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,137
    My Mood
    Dead
    Quote Originally Posted by freedompeace View Post
    For your second question C:\ is ALWAYS the active Windows drive path - C:\WINDOWS\system32 will always be located at that position.
    Wait what ? If I install windows on D Drive, then wouldn't it be:

    D:\Windows\System32\

    ?

  6. #5
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    @ Freedom,

    A. It's already answered
    B. C is always the active windows path (yes hassan even if installed on D:\ drive, The OS will make the Active Windows Drive the C Drive.) However, the system folder location may be different.

    Example, On a dual partition (or on newer OS) system paths may be different, Example: My Current System folder for this OS is C:\Windows.0\System32

    My Second OS is C:\Windows\System32

    and My 3rd is C:\Windows.1\System32 This happens when multiple windows OS's are installed on one partition and is not at all uncommon, so my solution is correct, your solution could exclude maybe 40% of consumers and is based on a assumption, that is why there is a need and a reason for special directory codes my friend, if everything (including special directories) were static, there would be no need for the code. ...............!... .


    So with that said, If you use

    Code:
    Environment.GetFolderPath(Environment.SpecialFolder.System)
    to return the current windows system32 folder you can then use it anyway you need too.




    Last edited by NextGen1; 01-21-2011 at 06:01 AM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




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

    Hassan (01-21-2011)

  8. #6
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,137
    My Mood
    Dead
    Oh ok. My bad, didn't knew that. Sorryz freedom :P

  9. #7
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    he was still wrong about the system folder, failed installs or multiple installs will change the relative path of the system32 folder, almost the same way that upgrading new windows OS's change the older windows to .old (almost the same way)

    Anyway, hence the reason for special directories in the .net framework, again, if everything was static, there would be no need for them.....

    Last edited by NextGen1; 01-21-2011 at 12:31 AM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  10. The Following User Says Thank You to NextGen1 For This Useful Post:

    Hassan (01-21-2011)

  11. #8
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,137
    My Mood
    Dead
    Quote Originally Posted by NextGen1 View Post
    he was still wrong about the system folder, failed installs or multiple installs will change the relative path of the system32 folder, almost the same way that upgrading new windows OS's change the older windows to .old (almost the same way)
    Yup, he is partially right. There wouldn't be any point of system variables then !!

  12. #9
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    as expressed before , he is right that c:\ will always be the active windows directory, but he made the point to declare that system32 will (and i quote) "C:\WINDOWS\system32 will always" be at that path, which is 100% incorrect, therefor the windows active directory as C:\ becomes moot as that was the basis of his argument.

    but enough said.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  13. #10
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    Quote Originally Posted by NextGen1 View Post
    @ Freedom,

    A. It's already answered :p
    B. C is always the active windows path (yes hassan even if installed on D:\ drive, The OS will make the Active Windows Drive the C Drive.) However, the system folder location may be different.

    Example, On a dual partition (or on newer OS) system paths may be different, Example: My Current System folder for this OS is C:\Windows.0\System32

    My Second OS is C:\Windows\System32

    and My 3rd is C:\Windows.1\System32 This happens when multiple windows OS's are installed on one partition and is not at all uncommon, so my solution is correct, your solution could exclude maybe 40% of consumers and is based on a assumption, that is why there is a need and a reason for special directory codes my friend, if everything (including special directories) were static, there would be no need for the code. ...............!... .
    Oh dayum you're right!

    I've edited my post accordingly :)

  14. The Following User Says Thank You to freedompeace For This Useful Post:

    NextGen1 (01-21-2011)