Hello everyone, today I decided to write a bot for the game, just using the class

SendKeys 

So when the time comes to use an error appears, it is forbidden to create cheats ... tell me how to get around this?

PS

The question is, why minus? In recent times, I noticed that a lot of questions started just minusovat ... what kind of nonsense?

  • catching cheaters on the bot creation process =)))) - Gorets
  • So why did they do it? It's just a program that emulates pressing buttons no more ... - Angus123
  • Yes, damn me at all for the wrong answer as much straightforwardly pereminusovali (-6) absolutely not why I could not answer the question at all! After solid minuses without a reason I do not want to participate in the forum! - Rules
  • five
    @Rules - Well, do not participate. You have written a full hat in response to -6 , and you deservedly got it. - In general, it is hardly worth answering the question if you do not thoroughly understand the topic, because it is better to remain silent than to misinform a person. - Costantino Rupert
  • 7
    @ Angus123 - And about the minuses for the questions - personally, to my mind, you should spend a little more time on independent research of the problem. - If for some reason it does not work out on its own, then at least take the time to arrange the question well. All the same, this very question you write once, and read it 50+ times, so it makes sense to write it so that it is more convenient for reading people. - Costantino Rupert

1 answer 1

  • One of the easiest ways to write a bypass for this kind of protection is to create an asm trampoline .

The point is to call the function not using call X , but using call X + t , emulating the missing t instructions yourself. In the case of not the most complex defenses, this is quite enough.

  • At one time, I circumvented the protection hooks on the WinAPI functions with the help of the following code (syntax _declspec (naked) and assembler inserts specific to Visual Studio ) :

     DWORD TrampolinedPostMessage = (DWORD)GetProcAddress(LoadLibrary("user32.dll"), "PostMessageA") + 5; _declspec(naked) BOOL PostMessageSilently( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { _asm { mov edi, edi push ebp mov ebp, esp jmp[TrampolinedPostMessage] } } 
  • Then you can use the function with asm trampoline to send a keystroke:

     void SendKeySilently(HWND hWnd, CHAR keyCode) { PostMessageSilently(hWnd, WM_KEYDOWN, keyCode, 0); PostMessageSilently(hWnd, WM_KEYUP, keyCode, 0); } 
  • But generally speaking, drop this thing :)

  • 2
    Why quit? While you are doing your homework, the program beats the mobs for you :) - Angus123