Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++ some problems

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Sat Oct 04, 2008 11:29 pm    Post subject: C++ some problems Reply with quote

so im trying to use FillConsoleOutputCharacter with the value of a dword, but with no success, i tried converting it to a char array

Code:
DWORD myte;

myte = 9;

char *mystring = (char*)&myte
FillConsoleOutputCharacter(outputhandle, mystring[1], 1, spot, &charwritten)


but it didnt work, it prints an empty space
i know the actual writing is not the problem, since i have used many times before, but the converting doesnt seem to work properly


i also have a problem wiht this code:
Code:
DWORD PMA = (DWORD)GetProcAddress(LoadLibrary("USER32.DLL"), "PostMessageA")+5;
_declspec(naked) BOOL PostMessageX(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) {
   _asm {
      mov edi, edi
      push ebp
      mov ebp, esp
      jmp[PMA]
  }
}


it says inline asm error, no opcode found in ebp, any ideas?

_________________
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Sun Oct 05, 2008 11:14 am    Post subject: Reply with quote

You cannot just assign the string as the DWORD value, you must use a converting function.
_itot, _ltot, _itoa, etc.

And the inline asm error is coming from the fact that you don't have a space between "jmp" and "[PMA]"

Code:
mov    edi, edi
push   ebp
mov    ebp, esp
jmp    dword ptr ds:[PMA]

_________________
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Thu Oct 09, 2008 10:52 pm    Post subject: Reply with quote

ahh, i thought i would have to do something like that, though i never found the right one

thanks for the help (repped)

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites