SolvedFullbright with inline ASM

Posts 112 of 12 · Page 1 of 1
Fullbright with inline ASM
Hello guys

I have a problem... since a few days i play with ASM and i try to make a simple Fullbright cheat with inline ASM. (with dll injection)

But mw3 crash everytime when i inject the .dll.

My Code:

Code:
#include "stdafx.h"
#include <Windows.h>


void Fullbright(){
	DWORD dwFullbright = 0x06098CEC; 

	__asm{
		PUSH 0
			CALL [dwFullbright]
		MOV ESP, 9

	}

}
DWORD WINAPI Init(LPVOID unused)
{
   
    Fullbright();

}

BOOL WINAPI DllMain(HINSTANCE mod, DWORD DWORD_INITALIZE, LPVOID res)
{
    switch(DWORD_INITALIZE)
    {
    case DLL_PROCESS_ATTACH:  
        CreateThread(0, 0, &Init , 0, 0, 0); 

		 MessageBoxA(0, "Fullbright enabled", "Gangnamstyle is shit",0); 

        break;
     
     case DLL_PROCESS_DETACH:
 
                             MessageBoxA(0, "Fullbright disabled", "Gangnamstyle is very shit",0); 

        break;
    }
    return TRUE;
}

It would be nice if someone can tell me what i do wrong .


Thanks.

cheers =))
Is that how you create a thread? I think that may be incorrect...
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Init, 0, 0, 0);

And try testing it without the breaks.
The create thread isn't the problem... I think :P

I'm not really good with asm, but I think "MOV dwFullBright, 4" should work.

Code:
void Fullbright(){
	DWORD dwFullbright = 0x06098CEC; 

        __asm MOV dwFullbright, 4

}
Thanks for the answers

with:

Code:
DWORD dwFullbright = 0x06098CEC; 

	__asm{
			
		MOV dwFullbright, 9

	}
mw3 don´t crash, but the fullbright doesn´t work :/.

I dont know why...

cheers
Quote Originally Posted by inmate View Post
Thanks for the answers

with:

Code:
DWORD dwFullbright = 0x06098CEC; 

	__asm{
			
		MOV dwFullbright, 9

	}
mw3 don´t crash, but the fullbright doesn´t work :/.

I dont know why...

cheers
9 is the default value... Write 4 for FullBright
Ohh i fail

Yeah thats right, but even when i write 4 it doesn´t work :O.

cheers
Got it to work(on 4D1) with:

Code:
void Loop(){
	DWORD Fb = 0x5F9690C;
	while(true){
		__asm MOV EAX, Fb
		__asm MOV DWORD PTR[EAX], 4
		Sleep(1000);
	}
}
Just change the offset :P


Thank you very much Insane & Anonymouss =)

+rep

cheers :P
Pushes / calls you only use when you are using a FUNCTION
For an address simply use MOV as the guy up here said...
Although this doesn't help simplifying your code a thing since it will probably be compiled as a tbyte
Code:
B8 09 00 00 00; MOV EAX, 9
A3 EC 8C 09 06; MOV DWORD PTR DS[06098CEC], EAX
So nothing different.

Though nice that somebody finally takes up real coding challenges instead of making trainers all time with jorndel's class
You don't need to use inline asm... You're only making it more complicated just to set a value inside an array... You could just use this (offsets for 1.9.453):
Code:
DWORD* mapLighting = (DWORD*)0x06098CEC;

void EnableFullbright()
{
    mapLighting[0] = 4;
    mapLighting[1] = 2; // Bonus: disables fog
}

void ResetLighting()
{
    mapLighting[0] = 9;
    mapLighting[1] = 5;
}
Credits to BaberZz and CoMPStR. I only updated the address.
Quote Originally Posted by master131 View Post
You don't need to use inline asm... You're only making it more complicated just to set a value inside an array... You could just use this (offsets for 1.9.453):
Code:
DWORD* mapLighting = (DWORD*)0x06098CEC;

void EnableFullbright()
{
    mapLighting[0] = 4;
    mapLighting[1] = 2; // Bonus: disables fog
}

void ResetLighting()
{
    mapLighting[0] = 9;
    mapLighting[1] = 5;
}
Credits to BaberZz and CoMPStR. I only updated the address.
Pretty sure he knows that... he's just "practicing" his asm, which is good
Quote Originally Posted by MarkHC View Post
Pretty sure he knows that... he's just "practicing" his asm, which is good
It's always better to not use asm, if he really needs to practice asm he should practice with something that he really needs to use it lol
Posts 112 of 12 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?