I have seen the online game plug-in production (5)

zhaozj2021-02-16  49

I haven't figured out how to make acceleration plug-in, until the second half of the 2001 second half of the 2001 "" Transmission gear "research incorporated" "Transmission gear" student "reassembled, only one I was aware of it, followed by Delphi, I will talk about my experience to everyone, and thank the "Transmission gear" study "author Yan Rui gave a prompt. I will not say nonsense, then began magical accelerated plug-in experience! Originally I always thought that accelerated pluging was written for a game. Later, I found that this concept is wrong. The so-called acceleration plug is actually the purpose of modifying clock frequencies to acceleration. In the past DOS era, people played programming immediately thought that this is very simple, it is not to change the 8253 register. This may be able to travel in the previous DOS era, but Windows is not.

Windows is a 32-bit operating system, isn't you want to change? (Microsoft's stuff is so domineering, say no change to you, do not change it to you, but do not impossible We can implement two ways: the first is to write a hardware driver to complete, the second is to implement it with RING0 (this method is the author of CIH Chen Yinghao first, its principle is to modify the IDE table -> Create a interrupt gate -> Enter Ring0-> Call the interrupt modification vector, but there is no way to use ASM assembly to achieve this * _ *, as a high-level language user!), Use the first method to trouble with the first method So we use the second method here ~~~ We will come to think about our ideas before implementation: 1. Let's first write a process to embed the assembly language in this process to achieve the IDE table, create interrupt gate , Modify the vector and other work 2, call this process to achieve the acceleration function, now there is, we will see the code while explaining: First we build a process, this process is the core part of this program: Procedure setRing Value: word); stdcall; const zdh = $ 03; // set a interrupt number VAR IDT: array [0..5] of byte; // Save the IDT table OG: dword; // Store the old vector Begin ASM PUSH EBX SIDT IDT // Read Interrupt Description Table MOV EBX, DWORD PTR [IDT 2] // IDT Subterite Add EBX, 8 * ZDH // Calculation Interrupt in the Interrupt Descriptor Table CLI // Off Interrupt MOV DX , Word PTR [EBX 6] SHL EDX, 16D MOV DX, Word PTR [EBX] MOV [OG], EDX MOV EAX, OFFSET @@ Ring0 // Pointing Ring0 Grade Dip MOV Word PTR [EBX], AX // Low 16 digits, save at 1, 2-bit SHR EAX, 16D MOV Word PTR [EBX 6], AX // High 16-bit, save at 6, 7-bit int zdh // interrupt MO V EBX, DWORD PTR [IDT 2] // Reposition Add EBX, 8 * ZDH MOV EDX, [OG] MOV WORD PTR [EBX], DX SHR EDX, 16D MOV Word PTR [EBX 6], DX // Recovered the changed vector POP EBX JMP @@ EXISM / / 到 EXITASM @@ ring0: // Ring0, this is also the most core Dongdong MOV Al, $ 34 //

Write 8253 Control Register OUT $ 43, Al Mov AX, VALUE // Write Time Value OUT $ 40, Al // Write Time Value Low MOV AL, AH OUT $ 40, Al // Write Value High IRETD / / Return @@ EXISM : End; end; the most core thing has been finished, most readers know that I don't know how it is, huh, I don't know how it happened. Let's try to use this process to do a place similar to the "shifting gear"! Put a window first, put a TrackBar control on the window to set it to 20, MIN is set to 1, set the position to 10, write on this control: setring (string ('$' INTOSTR) (1742 (10-TRACKBAR1.POSITION) * 160)))))))

Because the default value of Windows is $ 1742, we use the 1742 as the base, but because the value is, the faster, the thicker is the slower principle, so write such a formula, which is a "shifting gear" a Delphi ASM version (Only for Win9X), huh, try it, this will help you, huh, huh.

Copyright Description: You can copy, distribute, download this document freely. However, you may not take it, change this article, or use this article to see any form of interest.

转载请注明原文地址:https://www.9cbs.com/read-25307.html

New Post(0)