Thread: DLL Creation/Compailing

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    8

    DLL Creation/Compailing

    Hey,
    i want to know how to marage to different codes, and how to compile it...
    im using dev c++ but i cant get the complation work

    how do i complaile, and how do i marage 2 different codes?
    thanks

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    merge code from 2 projects into one?
    merge code from two files into one?
    link 2 files into one exe/dll?

    Explain better what you need to do.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    8
    OK,

    I have 2 codes, and i wanna marage them into one and make a dll from them.

    thos are the codes:

    Code 1:

    Code:
    // Include
    #include <windows.h> 
     
    //Globals
    unsigned char NametagsOne[2] = {0x90, 0x90};
    unsigned char NametagsTwo[6] = {0x90, 0x90, 0x90, 0x90, 0x90, 0x90};
    unsigned char NametagsOneOrig[2] = {0x74, 0x25}; // 0042E28E  |. 74 25          |JE SHORT iw3mp.0042E2B5
    unsigned char NametagsTwoOrig[6] = {0x0F, 0x85, 0xCE, 0x00, 0x00, 0x00}; // 0042E26C  |. 0F85 CE000000  |JNZ iw3mp.0042E340
     
    BOOL WINAPI DllMain (HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
    {
        if (dwAttached == DLL_PROCESS_ATTACH)
        {
       unsigned long Protection;
             VirtualProtect((void*)0x42E28E, 2, PAGE_READWRITE, &Protection);
             memcpy((void*)0x0042E28E, (const void*)NametagsOne, 2);
             VirtualProtect((void*)0x42E28E, 2, Protection, 0);
     
             VirtualProtect((void*)0x42E26C, 6, PAGE_READWRITE, &Protection);
             memcpy((void*)0x0042E26C, (const void*)NametagsTwo, 6);
             VirtualProtect((void*)0x42E26C, 6, Protection, 0);
       return 1; 
        }
     
      return 3142; 
    }

    Code 2:

    Code:
    //Includes 
    #include <windows.h> 
    
    HANDLE CallOfDuty4 = GetCurrentProcess(); 
    BYTE NoRecoil[] = {0x75, 0x12};  // 00457DFF   75 12            JNZ SHORT iw3mp.00457E13
    
    BOOL WINAPI DllMain (HINSTANCE hModule, DWORD dwAttached, LPVOID lpvReserved)
    {
        if (dwAttached == DLL_PROCESS_ATTACH)
        {
             WriteProcessMemory(CallOfDuty4, (void*)0x00457DFF, &NoRecoil, 2, 0);
        }
        
      return 1; 
    }
    Last edited by lironf18; 02-29-2008 at 04:17 PM.

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    And what is the difference between these 2 codes?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    8
    oops -.-
    edited

  6. #6
    Registered User
    Join Date
    Feb 2008
    Posts
    8
    dammit, i tryed till now with guides to compaile, even without maraging both of them with no luck -.-

    can anyone please marage it and make the dll for me and upload it here? i just got sick of it =/

  7. #7
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Quote Originally Posted by lironf18 View Post
    dammit, i tryed till now with guides to compaile, even without maraging both of them with no luck -.-

    can anyone please marage it and make the dll for me and upload it here? i just got sick of it =/
    @lironf18,

    These "codes" are nothing more than game hacks for Call of Duty 4. BTW, are you related to elmutt the other wannabe game hacker? Possibly a distant cousin or something?

    But anyway, here's your compilable DLL. It's essentially garbage and will probably get you punkbusted. I'll quote another member of this board by saying "Is that code? It looks like unreadable hash of mashed tomato juice to me!"


    Code:
    // Filename: myDll.cpp
    // Compile: cl.exe /LD mydll.cpp
    #include <windows.h> 
    
    unsigned char NametagsOne[2] = {0x90, 0x90};
    unsigned char NametagsTwo[6] = {0x90, 0x90, 0x90, 0x90, 0x90, 0x90};
    unsigned char NametagsOneOrig[2] = {0x74, 0x25}; // 0042E28E  |. 74 25          |JE SHORT iw3mp.0042E2B5
    unsigned char NametagsTwoOrig[6] = {0x0F, 0x85, 0xCE, 0x00, 0x00, 0x00}; // 0042E26C  |. 0F85 CE000000  |JNZ iw3mp.0042E340
    
    void beginHacking() 
    { 
        unsigned long Protection;
        HANDLE CallOfDuty4 = GetCurrentProcess(); 
        BYTE NoRecoil[] = {0x75, 0x12};  // 00457DFF   75 12            JNZ SHORT iw3mp.00457E13
        WriteProcessMemory(CallOfDuty4, (void*)0x00457DFF, &NoRecoil, 2, 0);
        VirtualProtect((void*)0x42E28E, 2, PAGE_READWRITE, &Protection);
        memcpy((void*)0x0042E28E, (const void*)NametagsOne, 2);
        VirtualProtect((void*)0x42E28E, 2, Protection, 0);
    
        VirtualProtect((void*)0x42E26C, 6, PAGE_READWRITE, &Protection);
        memcpy((void*)0x0042E26C, (const void*)NametagsTwo, 6);
        VirtualProtect((void*)0x42E26C, 6, Protection, 0);
    } 
    
    
    BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID _Reserved ) 
    { 
        switch( dwReason ) 
        { 
            case DLL_PROCESS_ATTACH: 
                HINSTANCE  g_hInst = hInstance; 
                beginHacking(); 
    
                return true; 
                break; 
        } 
    
        return true; 
    }

  8. #8
    Registered User
    Join Date
    Feb 2008
    Posts
    8
    mm i dont wanna be hacker and i dont call my self hacker, i just want hacks for cod.
    can anyone please tell me what i do with this?

  9. #9
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    So if you don't want to "crack" things, what are you doing with code that modifies memory of another process?

    By the way, IMO, "hacking" is the wrong term here, as hacking is really a form of advanced/skilled programming, whilst cracking is the term for "breaking someone elses code", which is clearly what this code is attempting to do.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  10. #10
    Registered User
    Join Date
    Feb 2008
    Posts
    8
    this code is public, i didnt steal it or w/e
    did i ask too much to learn on how to compile?
    i know its simple, so please some one just tell me how get it works

  11. #11
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by lironf18 View Post
    this code is public, i didnt steal it or w/e
    did i ask too much to learn on how to compile?
    i know its simple, so please some one just tell me how get it works
    No, but you are attempting to subvert a game into doing things differently - I don't know what the code does in itself, but the general concept of injecting "your own"[1] code into another application is "cracking", and should not be discussed on this forum according to the forum rules that you said you'd obey when you signed up to the forum [even if you just clicked yes without reading them, they still apply to you] - this thread should be locked/deleted.

    [1] Or code you found somewhere on the web, got from a friend, etc.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  12. #12
    Registered User
    Join Date
    Feb 2008
    Posts
    8
    omg, why its so hard to help? so what, i dont want to learn c++, i just want to learn how to compile cant you live with that?
    for what is this forum exsist if you arnt helping?

  13. #13
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    omg, why its so hard to help? so what, i dont want to learn c++, i just want to learn how to compile cant you live with that?
    for what is this forum exsist if you arnt helping?
    This forum exists to help people learn how to program, not to help people cheat (either at homework or video games). Get lost.

  14. #14
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I guess the comparison would be to ask "How do I make heroin?" on a chemistry forum...

    If you were to ask a genuine question on how to achieve something useful [you may think cheating in a game is useful - that's your decision, but in my mind it's not, and I'm the one you are asking to help you].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  15. #15
    Registered User
    Join Date
    Feb 2008
    Posts
    8
    i got my help allrdy and im good, this forum sucks. cya.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. dll communicating between each other
    By cloudy in forum C++ Programming
    Replies: 5
    Last Post: 06-17-2005, 02:20 AM
  3. DLL and std::string woes!
    By Magos in forum C++ Programming
    Replies: 7
    Last Post: 09-08-2004, 12:34 PM
  4. C++ .NET - "inconsistent dll linkage" - What's that?
    By BrianK in forum Windows Programming
    Replies: 2
    Last Post: 03-16-2004, 10:16 AM
  5. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 05:29 AM