Solved compare a 4byte adress value in a hook

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Icew0lf

Software Ninjaneer
Dank Tier VIP
Fleep Tier Donator
Aug 20, 2013
610
17,558
43
short question syntax related...the addys are just dummy addys..
its a teleport code.

THIS just works fine:

C++:
	if (keydown(VK_LSHIFT) && keydown(VK_F1))
	{
		myptr1 = (Store);
		*(float*)(myptr1) = *((float*)(0x12345));
		*(float*)(myptr1 + 0x04) = *((float*)(0x12345));
		*(float*)(myptr1 + 0x08) = *((float*)(0x12345));
	}
but now i want to execute it only if a certain adress (which is 4BYTE) have the value of = 1.
so i want to make a comparison.

1st try was this way:

C++:
	if (*(float*)(0x7777777) = 1)
	{
		myptr1 = (Store);
		*(float*)(myptr1) = *((float*)(0x12345));
		*(float*)(myptr1 + 0x04) = *((float*)(0x12345));
		*(float*)(myptr1 + 0x08) = *((float*)(0x12345));
	}
if i change the float to BYTE:

C++:
	if (*(BYTE*)(0x7777777) = 1)
	{
		myptr1 = (Store);
		*(float*)(myptr1) = *((float*)(0x12345));
		*(float*)(myptr1 + 0x04) = *((float*)(0x12345));
		*(float*)(myptr1 + 0x08) = *((float*)(0x12345));
	}
the result is always true, no matter if its 1 or 0 or whatever...it doesnt compare.
how can i compare the 0x7777777 to a 4byte value and execute only if its 1?

thanks to help me to get the basics down
Ice
 
Last edited:

Icew0lf

Software Ninjaneer
Dank Tier VIP
Fleep Tier Donator
Aug 20, 2013
610
17,558
43
wow thanks a lot till0sch2!!

if (*((BYTE*)(0x12345)) == 1)

solved my problem...ur awesome, saved my day!
i rise the next beer on you! learned something new, thanks!

best regards,
icew0lf
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods