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++ TLS callbacks ... (reworked code of: ap0x and samael)

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

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Sun Dec 28, 2008 8:52 pm    Post subject: C++ TLS callbacks ... (reworked code of: ap0x and samael) Reply with quote

origanil ASM can be Found by googling WinAsm TLS Callbacks

anyways here my redo in C++
Code:

void Act_DebugDetect(PVOID,DWORD,PVOID);
BYTE Signature[7] = { 0x33, 0xED, 0x53, 0x50, 0x6A, 0x00, 0xE9};
DWORD CALL_BACK_ARRAY[2] = {(DWORD)Act_DebugDetect,0};
BYTE TLS_TABLE_MARKER[8] = { 0x0E, 0x0F, 0x05, 0x07, 0x11, 0x01, 0x00, 0x05 };
DWORD TLS_INDEX = NULL;
TLS_DIRECTORY TLS = {0,0,&TLS_INDEX,&CALL_BACK_ARRAY,NULL,NULL};

void Act_DebugDetect(PVOID a,DWORD b,PVOID c)
{
   DWORD IsDebugged;
   NtQueryInformationProcess(GetCurrentProcess,0x7,&IsDebugged,4,0);
   if(IsDebugged)
   {
      ExitProcess(-1);
   }
}
int Main(void)
{
      Sleep(INFINITE);
      return 0;
}


using the tool to update the TLS_DIRECTORY provided by samael on Winasm.net (i will provide it here) but i give props to him.

please post questions but before you do update yourself on what TLS callbacks are Smile

regards BanMe



The Extension 'zip' was deactivated by an board admin, therefore this Attachment is not displayed.

Back to top
View user's profile Send private message MSN Messenger
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Wed Dec 31, 2008 1:37 pm    Post subject: Reply with quote

This is why I like fasm; it's a few lines of code for a structure to implement a TLS callback. Razz
Back to top
View user's profile Send private message
Ramiz
How do I cheat?
Reputation: 0

Joined: 03 Nov 2009
Posts: 2

PostPosted: Tue Nov 03, 2009 7:10 pm    Post subject: Reply with quote

Hello
thanks for BanME about this code and the tool
but i want to know what we can do with this code ??
we can put it in the tls ??
and how we can do that if we can ?
thanks Smile
Back to top
View user's profile Send private message
Bswap
Newbie cheater
Reputation: 0

Joined: 18 Aug 2009
Posts: 21

PostPosted: Wed Nov 04, 2009 2:38 am    Post subject: re: Reply with quote

@BanMe: Take no offence to the following.

@Ramiz: You're thanking BanMe for some code, of which you have zero idea of how to use or what it does. For all you know, this could reformat your computer, and yet you're thanking him.

Very strange behaviour.

I can't help but think you're spamming so you reach 10 posts and 'earn' the option of changing your avatar... maybe i'm wrong, I hope so.
Back to top
View user's profile Send private message
Ramiz
How do I cheat?
Reputation: 0

Joined: 03 Nov 2009
Posts: 2

PostPosted: Wed Nov 04, 2009 5:23 am    Post subject: Reply with quote

@Bswap i know what u did not know maybe u will know after 100 year Very Happy
i am asking a question if u have answer then post if u do not have then shut up
Back to top
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Wed Nov 04, 2009 4:54 pm    Post subject: Reply with quote

Would it be valid to run your entire program from a TLS Callback?
So have the main thread sleep for an infinite time and have everything in the TLS Callback thread? Are there any restrictions on what can be done in such a function? (Like there are restrictions in DllMain)
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