Code::Blocks MingW Inline ASM IW5M Fullbright

Posts 111 of 11 · Page 1 of 1
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;
}
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
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
Actually, it'd be like:

Code:
asm("mov $0x5F9690C, %eax");
asm("mov $9, (%eax)");
Quote Originally Posted by MarkHC 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
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.
objdump -d
It Neverrrrr liesssss

He can try both.

P.S Will this work?:
Code:
__asm MOV [0x5F9690C], 0x5;
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)");
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.
Oh.. He isn't injecting... just now I realized that
Posts 111 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?