Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool

    How to make a DLL C++[X1]

    I will start this as if you understand a little of data types and will stick to hacking side of things. If you do not understand anything MSDN is always they to help.

    If you do not have an IDE just download Visual C++ 2010 Express

    (My computer froze twice while i was writing this and i had to restart every time)

    I am using Visual Studio 2010 Ultimate

    Lets Start
    1. Create a Win32 Project
      1. File -> New Project,
      2. Select a win32 project
      3. Give it a name, I will call mine Hello World.
      4. You should see a wizard pop-up.
      5. Click Next..
      6. Now what you do is Select DLL and click next
  • DLLMAIN
    [INDENT]Double Click in your Solution Explorer dllmain.cpp
    if you do not see your Solution Explorer goto View and select Solution Explorer
    You should see a Function called DllMain.
    Code:
    BOOL APIENTRY DllMain( HMODULE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
    					 )
    {
    	switch (ul_reason_for_call)
    	{
    	case DLL_PROCESS_ATTACH:
    	case DLL_THREAD_ATTACH:
    	case DLL_THREAD_DETACH:
    	case DLL_PROCESS_DETACH:
    		break;
    	}
    	return TRUE;
    }
    DLLMAIN is an optional entry point into a dynamic-link library (DLL). When the system starts or terminates a process or thread, it calls the entry-point function for each loaded DLL using the first thread of the process. The system also calls the entry-point function for a DLL when it is loaded or unloaded using the LoadLibrary and FreeLibrary functions.

    [Highlight=SYNTAX]
    BOOL WINAPI DllMain(
    __in HINSTANCE hinstDLL,
    __in DWORD fdwReason,
    __in LPVOID lpvReserved
    );
    [/highlight]


    For more information visit HERE
  • Creating a Message box Function
    Now we are going to create a Message Box Function which is simple

    Type the code below above your DLLMAIN function.
    Code:
    int MsgBox(char* Message, char* Title)
    {
    	int ret = MessageBoxA(0,Message, Title, MB_OK);
    	return ret;
    }
    This functions is a simple function of which shows a messagebox.
    the MessageBoxA () function is located in the header windows.h( i will talk about that later). The value obtained by MessageBoxA() is then stored in an Integer in ret, then the function returns as ret making MsgBox equal ret.

    The function MessageBoxA is explained in more detail here

  • Calling the function MsgBox in DLLMAIN.

    That we have every function we want we much make DLLMAIN our entry point do something useful.
    if you had gone to the MSDN website on DLLMAIN it would explain on some of the things we are going to do here so i will skip the explaining.

    in DLLMain under DLL_PROCESS_ATTACH add this:
    Code:
    MsgBox("Hello World", "Hey");
    break;

  • Compiling and Injectiong

    now that we have done all of the about your code should look like this
    Code:
    int MsgBox(char* Message, char* Title)
    {
    	int ret = MessageBoxA(0,Message, Title, MB_OK);
    	return ret;
    }
    
    BOOL APIENTRY DllMain( HMODULE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
    					 )
    {
    	switch (ul_reason_for_call)
    	{
    	case DLL_PROCESS_ATTACH:
    		MsgBox("Hello World", "Hey");
    		break;
    	case DLL_THREAD_ATTACH:
    	case DLL_THREAD_DETACH:
    	case DLL_PROCESS_DETACH:
    		break;
    	}
    	return TRUE;
    }
    Now we much compile the code. go to Build -> and select Build Hello World, or you can just hit F70

  • END OF TUTORIAL ..

    You have made a message DLL. You can now inject it into and process or load it from an application using LoadLibrary and you should see a message box appear
    ENJOY
    Last edited by topblast; 04-01-2011 at 07:49 PM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  • The Following 14 Users Say Thank You to topblast For This Useful Post:

    [MPGH]AVGN (04-05-2011),Cryptonic (04-21-2011),Decoder back (04-01-2011),Departure (04-01-2011),DetectiveLoki (04-22-2011),markoj (04-01-2011),mo3ad001 (04-02-2011),Mr..Bob (04-22-2011),ParkII (04-16-2011),PashaAmd (04-02-2011),PikaMucha_Itu (04-14-2011),S0aD (04-13-2011),Strikex (04-06-2011),sugar04 (04-07-2011)

  • #2
    [E]xiled's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    Melbourne, Australia.
    Posts
    180
    Reputation
    84
    Thanks
    273
    My Mood
    Breezy
    Okay then... Good job i guess!
    | Buy Premium MC accounts CHEAP Click here |
    Respected seller.
    Check my vouches in the first post of the above MC account thread ^

  • #3
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    i made the first.. you make the second..

    i see the question how to make DLLs from source code so.. I did this
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  • #4
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Umm Awesome ?

    Can have a copy of that VS Ultimate

  • #5
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by whit View Post
    Umm Awesome ?

    Can have a copy of that VS Ultimate
    sure.
    you can get it from here

    If you download this i am not responsible for what you do with it. it is just a torrent and not the real thing....

    wait all i did was give you a link that went to google.!!!!!!!!!!!!!!!!!!!!!!!!

    I use it because i code in almost all its languages.

    FUCK SHARP is not good.... F# is not good.

    Last edited by topblast; 04-01-2011 at 09:23 PM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  • The Following 2 Users Say Thank You to topblast For This Useful Post:

    markoj (04-03-2011),whit (04-01-2011)

  • #6
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,064
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    I thanked you cuz of all the words and for giving people your illegally downloaded software
    Dont ban me

  • #7
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by markoj View Post
    I thanked you cuz of all the words and for giving people your illegally downloaded software
    I didnt tell..wait... WAIT!!!!!!!!!!!!!!!!!!!!!!.. EDITING!

    i only googled something and clicked i am feeling lucky i didnt give them the real thing.. GOOGLE DID IT.
    Last edited by topblast; 04-01-2011 at 09:23 PM.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  • #8
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    @topblast
    I dont have to keep this shit mounted do i ?

  • #9
    azndogfood's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    in hell
    Posts
    167
    Reputation
    8
    Thanks
    6
    My Mood
    Amazed
    what's a dll? what's c++? i don't get it

  • #10
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    805
    Reputation
    125
    Thanks
    1,794
    My Mood
    Doh
    Good work TopBlast, At least you stood up to the plate and posted something useful, unlike most of the threads in this category when dealing with C++

  • The Following User Says Thank You to Departure For This Useful Post:

    topblast (04-02-2011)

  • #11
    topblast's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Far from around you Programmer: C++ | VB | C# | JAVA
    Posts
    3,607
    Reputation
    149
    Thanks
    5,052
    My Mood
    Cool
    Quote Originally Posted by azndogfood View Post
    what's a dll? what's c++? i don't get it
    you had to be an ass did you.


    Quote Originally Posted by whit View Post
    @topblast
    I dont have to keep this shit mounted do i ?
    no you dont.
    I just like programming, that is all.

    Current Stuff:

    • GPU Programmer (Cuda)
    • Client/Server (Cloud Server)
    • Mobile App Development

  • #12
    mo3ad001's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Posts
    842
    Reputation
    53
    Thanks
    797
    My Mood
    Busy
    Nice Tut TopLast ^^

    H A X O
    Email : Noobmem@hotmail.com


  • #13
    yaserifti1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    The finest pussies of Earth
    Posts
    250
    Reputation
    9
    Thanks
    10
    My Mood
    Angelic
    GJ wont do much but help some idiots type in work now hacks into the msg box, but anyways gj
    Key:
    = done
    = not done
    = working on it
    = damn I killed it!

    Accomplishments On MPGH:

    make a mod -

    make a gun to gun mod -

    make a hack -

    learn C++ -

    roast a nub -

  • #14
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    805
    Reputation
    125
    Thanks
    1,794
    My Mood
    Doh
    @yaserifti1 Why so negative? if it helps 1 person understand about a dll entry point and how to call a function, Then its a whole lot more than what anyone else has done in this category.

  • The Following User Says Thank You to Departure For This Useful Post:

    _Fk127_ (04-02-2011)

  • #15
    yaserifti1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    The finest pussies of Earth
    Posts
    250
    Reputation
    9
    Thanks
    10
    My Mood
    Angelic
    Quote Originally Posted by Departure View Post
    @yaserifti1 Why so negative? if it helps 1 person understand about a dll entry point and how to call a function, Then its a whole lot more than what anyone else has done in this category.
    Now i feel sad WHY SO SERIOUS?

    [IMG]https://i367.photobucke*****m/albums/oo115/n1ghtmar3_2008/Joker.jpg[/IMG]
    Last edited by yaserifti1; 04-02-2011 at 09:45 AM.
    Key:
    = done
    = not done
    = working on it
    = damn I killed it!

    Accomplishments On MPGH:

    make a mod -

    make a gun to gun mod -

    make a hack -

    learn C++ -

    roast a nub -

  • Page 1 of 2 12 LastLast