Four online game plug-in design methods (1) I saw someone else playing online games a few years ago, I was really uncomfortable for the programmer, I want to figure out what is going on. I took some to study, I have a personal experience, and I will share it with everyone. I don't have a few more ways (according to the difficulty of production): 1, action, so-called action, means using the API send command to the window or API control Mouse, keyboard, etc., so that the characters in the game flow or attack, the earliest "stone" plug-in is this way. (This plug-in is entirely garbage, TMD, as long as people who will know some API know what to do, but this plug-in is also entrance-level good stuff, although you can't improve your combat power, but you can improve your morale) 2 Local modification, this plug-in has some of the traditional game modifiers, doing this plug-in programming only a little understanding of the memory address and master the API can be realized, "Elf" is this way. Written, it is difficult to find those address code, find the address, usually to use the tools of others, some games have two-code check, is looking for more difficult. (This plug-in is more difficult than the previous one, but this plug-in can be used, it is also difficult ~~, this plug-in can quickly improve your understanding and application of memory address, it is you The programming technology is a good Dongdong) 3, Trojan, this plug-in purpose is to help the plug-in producer to steal the user's password (TMD, "bad" is a word, but you have to know that it is known to talk about it ~ ~), Doing this plug-in, there is a certain difficulty, you need hook or keyboard monitoring technology to make a foundation can be done, its principle is first cutting the user's account or password, and then send it to the specified mailbox. (I have written such a stuff before, but I have never used it. I know that this kind of Dongdong is very unethical, so don't use it in the future!) 4, accelerate, this plug-in can speed up the speed of the game ... (I am sorry for everyone, I don't actually have done it, so I can't be self-suited, I'm embarrassed, the first three can be better implemented in languages such as VB, Delphi, and then use VC. The next layer supports a better programming tool. The action plug-in first, first talk about the plug-in plug-in, which is the easiest way to do when I first write. I remember that I was still in the "Stone" era, I saw that someone hang a software (plug-in), I could go four outsight (I didn't know how to hang it outside), so I found this software ( After taking it, I listened to someone to say this. This is not difficult to realize it. It is not difficult to realize it. It is not difficult to see that in fact the people's walking is not the mouse, and it will be achieved. The impulsive impulsive, then ran to the MSDN and see some information, found this kind of function, only a few simple API functions can be done: 1, first we have to know the position of the mouse (for easy reducing now The location of the mouse is to use the API function getCursorpos, which is used as follows:
Bool getCursorpos (LPPOINT LPPOINT / / ADDRESS OF STRUCTURE for Cursor Position); Bool setCursorpos (int X, // horizontal position int y // vertical position); 3, analog mouse issues actions and release actions, we have to use the mouse_event function to implement, and use the method of use:
VOID mouse_event (DWORD dwFlags, // flags specifying various motion / click variantsDWORD dx, // horizontal mouse position or position changeDWORD dy, // vertical mouse position or position changeDWORD dwData, // amount of wheel movementDWORD dwExtraInfo // 32 bits of application -defined information; at its dwflags, the available events are like mobile mouseeventf_move, the left mouseeventf_leftdown, the left mouseeventf_leftup, the specific stuff is still checked MSDN ~~~~~~~ In the previous knowledge, we can take a look at how the characters are removed:
GetCursorpos (Point); SetCursorpos (Ranpoint (80, Windowx), Ranpoint (80, Windowy)); // Ranpoint is a homemade random coordinate function mouse_event (MouseEventf_leftdown, 0, 0, 0, 0); mouse_event (MouseEventf_leftup, 0, 0, 0, 0); SetCursorpos (Point.x, Point.y); Look at the above code, is it very simple to see the characters? ~~ This skill is achieved (I have said, TMD, this is the practice of garbage, I believe it ~~~), next, then look at the automatic attack in the game (required to attack the shortcut " The truth is still the same, just use the API difference ~~~, this time we want to use the keybd_event function, the usage is as follows:
VOID keybd_event (BYTE bVk, // virtual-key codeBYTE bScan, // hardware scan codeDWORD dwFlags, // flags specifying various function optionsDWORD dwExtraInfo // additional data associated with keystroke); we have to know the scan code can not be used directly to Turn the key value into a scan code with a function mappvirtualkey, and the specific usage method of MapVirtualKey is as follows:
Uint MapVirtualKey (uint ucode, // virtual-key code or scan code umapType // translation to perform); Ok, ratio, this quick pick button is Ctrl A, let us look at how the actual code is written: keybd_event (VK_CONTROL, mapvirtualkey (VK_CONTROL, 0), 0,0); keybd_event (65, mapvirtualkey (65,0), 0,0); keybd_event (65, mapvirtualkey (65,0), keyeventf_keyup, 0); keybd_event ( VK_Control, MapVirtualKey (vk_control, 0), keyeventf_keyup, 0); First simulate pressing the CTRL button, then simulates pressing the A key, then simulates the A key, finally release the CTRL button, this is an analog press shortcut cycle. (Seeing this, almost a certain understanding of the simple exterior ~~~~ Do you try? If you give an imitation, you can have a better Dongdong, this is going to see your comprehension. ~~, but don't be happy too early, this is only starting, and there will be more complex Dongdong waiting for you ~~)