About the game plug a Post

Source: Internet
Author: User

//-------------

I mainly to plug the technology to analyze, as for the internal structure of the game is not the same, here is not to do the explanation, I am not so powerful, all know, hehe!

1 first game Plug the principle

Plug now divided into a number of kinds, such as analog keyboard, mouse, modify the packet, and modify the local memory, but it seems not to modify the server memory Oh! In fact, modify the server is also a way, but the technology is too high general people do not have the means to start it! (for example, please GM to nightclubs, gifts, money, etc.) can modify server data, haha)

Modify the game is nothing more than to modify the local memory data, or intercept API functions, and so on, here I can think of the method to make an introduction, I hope we can make a good plug-in to enable the game manufacturers better improve their own technology.

I saw an article about the Magic Baby's theoretical analysis, write well, probably that way.

Down I will explain the technical aspects, for the use of jade.

2 Technical Analysis Section

1 simulate a keyboard or mouse response

We generally use uint sendinput (

UINT nInputs,   // count of input events
  LPINPUT pInputs, // array of input events
  int cbSize    // size of structure
);
API functions

The first parameter is the dimension of the matrix that describes the second parameter, and the second parameter contains the response event, which can be populated on its own, and finally the size of the structure, very simple, which is the simplest way to simulate a keyboard mouse, hehe

Note: This function also has an alternate function:

VOID keybd_event(
  BYTE bVk,        // 虚拟键码
  BYTE bScan,       // 扫描码
  DWORD dwFlags,
  ULONG_PTR dwExtraInfo  // 附加键状态
);和
VOID mouse_event(
  DWORD dwFlags,     // motion and click options
  DWORD dx,       // horizontal position or change
  DWORD dy,       // vertical position or change
  DWORD dwData,     // wheel movement
  ULONG_PTR dwExtraInfo // application-defined information
);

These two functions are very simple, I think those key wizard is the use of this bar, hehe, the above is an analog keyboard, the following is the simulation of the mouse.

This is just a simulation part, to play with the game we also need to find the window of the game, or include shortcuts, like the button Wizard that activates the key, we can use the GetWindow function to enumerate the window, you can use the FindWindow function to find the established window ( Note that there is also a FindWindowEx), FindWindowEx can find the window of the child window, such as buttons, and so on. When the game switches the scene we can use FindWindowEx to determine the characteristics of some of the current window, so as to determine whether the scene, A lot of ways, such as can getwindowinfo to determine something, such as when a button is not found to show that the game scene has been switched, and so on. Some games have no control in the inside, this is to do coordinate transformation of the image, This approach is bound to be limited. This requires that we use other methods to assist the analysis.

As for the shortcut keys we have to use Dynamic connection library to achieve, the inside to use hook technology, this is also very simple, we may be, in fact, is a global hook object and then Setwindowhook on it, callback functions are ready-made, and now the example of a lot of online, This implementation is already very common in the plug-in. If anyone else doesn't understand, check out the MSDN Lookup Setwindowhook.

This dynamic connection library's role is very large, do not underestimate oh, it can cut into all the process space, that is, can be loaded into all the games inside oh, as long as the use of right, you will find very useful!

This need you to review the basic knowledge of Win32 programming, OH, hurry to read it!

2 Intercept Message

Some of the game's response mechanism is relatively simple, is based on the message, or with what timer things, this time you can use intercepting messages to achieve some interesting features.

We intercept the message used is also hook technology, which includes keyboard messages, mouse messages, system messages, logs, etc., we do not have any big use, we only intercept the message callback function on it, this will not let me write examples, in fact this and above the same, All are written with Setwindowhook, see to understand very simple.

As for the interception of what to do is your business, such as in each timer message inside some of our data to judge, or in the timer in the simulation of a timer, then some data will be processed two times, oh, the consequences, not necessarily a good thing oh, hehe, However, if the data calculation on the client's game can really change the data, oh, try it! There are many uses, I think can also think out, hehe!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.