Results 1 to 11 of 11
  1. #1
    LEGiiTxCHAOTiiC's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    Chicago
    Posts
    200
    Reputation
    39
    Thanks
    72

    Code::Blocks MingW Inline ASM IW5M Fullbright

    Ok so I have this code, I wrote it myself. The offsets and bytes are NOT MINE. They belong to people on this forum, Kenshin13 and some other dude in a fullbright thread. Since I don't know shit about ASM, how can I fix this to compile with MingW Code::Blocks? Don't worry about the rest of the code, I just need the ASM syntax correct. I can't find anything on Google, because every damn thread on other forums is different. I hoping somebody with knowledge of this, will be kind enough to help a fellow MPGH member. If any program is released with this code in it, you will be credited. I guarantee you that. I don't release without credits, and full permission from members that I borrow offsets / bytes from.

    Code:
    #include <iostream>
    #include <windows.h>
    
    using std::cout;
    
    byte byte1[] =
    {
        0x05
    };
    
    byte byte2[] =
    {
        0x01
    };
    
    DWORD Fb = 0x5F9690C;   /* Fullbright offset */
    
    int main(int argc, char* argv[])
    {
        SetConsoleTitle("MPGH IW5M Advanced UAV");
    
        HWND hWnd = FindWindow(NULL, TEXT("Call of Duty®: Modern Warfare® 3 Multiplayer"));
    
        if(hWnd == NULL)
        {
            MessageBoxA(NULL, TEXT("Cannot find IW5M"), TEXT("Error"), MB_ICONERROR);
        }
    
        else
        {
            DWORD pId;
            GetWindowThreadProcessId(hWnd, &pId);
            HANDLE hAndle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
    
            cout << "Advanced UAV\nNever run out of radar again, and ALWAYS know where your enemy is!";
            cout << "\n\nCredits:\nCoded by LEGiiTxCHAOTiiC, addresses and bytes by Kenshin13, of MPGH.net.";
            cout << "\n\nPlease keep this window open to keep using the hack.\n";
    
            for(;;)
            {
                WriteProcessMemory(hAndle, (void*)0x1C2C41C, &byte1, 2, 0);
                WriteProcessMemory(hAndle, (void*)0x8FF304, &byte2, 2, 0);
    
                asm
                (
                    "mov eax, Fb \n\t"
                    "mov dword ptr[eax], 9 \n\t"
                );
    
                Sleep(5);
            }
            /* CloseHandle(hAndle); */
        }
        return 0;
    }

  2. #2
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    You should look for "how to use asm with GCC". Gcc is the compiler that Code::Blocks use

    A sample of what I've found:

    asm("movl %ecx %eax"); /* moves the contents of ecx to eax */

    full documentation here: GCC-Inline-Assembly-HOWTO

    Let us know if it works

    PS: FindWindow(NULL, TEXT("Call of Duty®: Modern Warfare® 3 Multiplayer")); might not work for some people... use FindWindow("IW5", NULL); instead
    Last edited by MarkHC; 10-31-2012 at 06:39 PM.


    CoD Minion from 09/19/2012 to 01/10/2013

  3. #3
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,470
    Reputation
    564
    Thanks
    6,168
    My Mood
    Psychedelic
    The other dude is BaberzZ;
    Also, maybe try this:

    Code:
    __asm__(".att_syntax prefix");
    __asm__("movl $0x5,0x5F9690C"); //Turn on
    
    __asm__(".att_syntax prefix");
    __asm__("movl $0x9,0x5F9690C"); //Turn off

  4. #4
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Actually, it'd be like:

    Code:
    asm("mov $0x5F9690C, %eax");
    asm("mov $9, (%eax)");


    CoD Minion from 09/19/2012 to 01/10/2013

  5. #5
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,470
    Reputation
    564
    Thanks
    6,168
    My Mood
    Psychedelic
    Quote Originally Posted by -InSaNe- View Post
    Actually, it'd be like:

    Code:
    asm("mov $0x5F9690C, %eax");
    asm("mov $9, (%eax)");
    Consider this:
    Code:
    *(BYTE*)0x5F9690C = 0x5;
    If I used objdump -d it shows this:
    Code:
    movl $0x5,0x5F9690C
    So it doesn't use registers to write these things. So you don't need to move it into EAX...
    Compiles too

  6. #6
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Quote Originally Posted by Kenshin13 View Post
    Consider this:
    Code:
    *(BYTE*)0x5F9690C = 0x5;
    If I used objdump -d it shows this:
    Code:
    movl $0x5,0x5F9690C
    So it doesn't use registers to write these things. So you don't need to move it into EAX...
    Compiles too
    Don't think it'll work... I don't have CodeBlocks installed here so I won't test.. but I'm almost sure it won't work... its the same thing as doing:
    Code:
    __asm MOV 0x5F9690C, 5
    on Visual Studio... and it doesn't work.


    CoD Minion from 09/19/2012 to 01/10/2013

  7. #7
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,470
    Reputation
    564
    Thanks
    6,168
    My Mood
    Psychedelic
    objdump -d
    It Neverrrrr liesssss

    He can try both.

    P.S Will this work?:
    Code:
    __asm MOV [0x5F9690C], 0x5;
    Last edited by Kenshin13; 10-31-2012 at 07:19 PM.

  8. #8
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Quote Originally Posted by Kenshin13 View Post
    P.S Will this work?:
    Code:
    __asm MOV [0x5F9690C], 0x5;
    Nope.. see this thread: https://www.mpgh.net/forum/604-call-d...nline-asm.html


    CoD Minion from 09/19/2012 to 01/10/2013

  9. #9
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,470
    Reputation
    564
    Thanks
    6,168
    My Mood
    Psychedelic
    Also @LEGiiTxCHAOTiiC, You don't need to write to the CVAR every 5 ms. Just the CG->AdvUAV (For IW5M only) That will probably save a little disk resources...
    On another note, based from your asm code, you can use InSaNe's code. Or mine (but InSaNe's looks nicer)

    __asm__("movl $0x5F9690C, %eax");
    __asm__("movl $4, (%eax)");
    Last edited by MarkHC; 10-31-2012 at 10:43 PM.

  10. #10
    intervention61's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    285
    Reputation
    10
    Thanks
    875
    My Mood
    Cool
    Quote Originally Posted by LEGiiTxCHAOTiiC View Post
    Since I don't know shit about ASM
    Code:
                    "mov eax, Fb \n\t"
                    "mov dword ptr[eax], 9 \n\t"
    Firstly, if you don't know shit about ASM; why bother using it? or a better approach would be to learn the basics first.
    Anyways, even if you get the syntax correct; it won't work. You aren't injecting a DLL so address space is different between the two processes and so "mov dword ptr[eax], 9" will actually modify the value of address in eax of your current process(your external application) not MW3's. That's the reason why your getting the process handle so you can modify memory using WriteProcessMemory() because you can't do it directly.
    Last edited by intervention61; 11-01-2012 at 07:01 PM.
    "Joker: why the hakcer are steaklign us name it´s the greatest asshole and motherfucker and i fuck him or her mother"

  11. The Following User Says Thank You to intervention61 For This Useful Post:

    Kenshin13 (11-02-2012)

  12. #11
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Oh.. He isn't injecting... just now I realized that


    CoD Minion from 09/19/2012 to 01/10/2013

  13. The Following User Says Thank You to MarkHC For This Useful Post:

    Kenshin13 (11-02-2012)

Similar Threads

  1. [Solved] Fullbright with inline ASM
    By inmate in forum Call of Duty Modern Warfare 3 Coding, Programming & Source Code
    Replies: 11
    Last Post: 11-01-2012, 11:05 AM
  2. [Discussion] Code::Blocks & other IDE's
    By t7ancients in forum Coders Lounge
    Replies: 17
    Last Post: 05-21-2012, 03:17 PM
  3. [Help] inline asm, jumping.
    By mavi2k in forum C++/C Programming
    Replies: 5
    Last Post: 06-01-2011, 03:29 AM
  4. Replies: 14
    Last Post: 10-22-2010, 07:37 PM
  5. Code::Blocks
    By mokkiller2 in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 4
    Last Post: 04-16-2010, 04:41 PM

Tags for this Thread