import com.sun.jna.Native;
import com.sun.jna.platform.win32.User32;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinDef.RECT;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.win32.StdCallLibrary;

public interface Kernel32 extends StdCallLibrary {
    Kernel32 INSTANCE = Native.load("kernel32", Kernel32.class);

    int OpenProcess(int dwDesiredAccess, boolean bInheritHandle, int dwProcessId);
    boolean ReadProcessMemory(int hProcess, long lpBaseAddress, byte[] lpBuffer, int nSize, IntByReference lpNumberOfBytesRead);
    boolean CloseHandle(int hObject);
}
public class StrongAimbot {
    private static final int PROCESS_VM_READ = 0x0010;
    private static final int PROCESS_VM_WRITE = 0x0020;
    private static final int PROCESS_VM_OPERATION = 0x0008;
    public static void main(String[] args) throws InterruptedException {
        HWND hWnd = User32.INSTANCE.FindWindow(null, "和平精英");
        if (hWnd == null) {
            System.out.println;
            return;
        }
        IntByReference pid = new IntByReference();
        User32.INSTANCE.GetWindowThreadProcessId(hWnd, pid);
        int processId = pid.getValue();
        int hProcess = Kernel32.INSTANCE.OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, false, processId);
        if (hProcess == 0) {
            System.out.println;
            return;
        }
        while (true) {
            RECT rect = new RECT();
            User32.INSTANCE.GetClientRect(hWnd, rect);
            int windowWidth = rect.right - rect.left;
            int windowHeight = rect.bottom - rect.top;
            int enemyX = 960;
            int enemyY = 540；
            int mouseX = windowWidth / 2;
            int mouseY = windowHeight / 2;
            int deltaX = enemyX - mouseX;
            int deltaY = enemyY - mouseX；
            int sensitivity = 2000 + (int)(Math.random() * 500);
            deltaX = deltaX * sensitivity / 1000;
            deltaY = deltaY * sensitivity / 1000
            int shakeX = (int)(Math.random() * 5) - 2;
            int shakeY = (int)(Math.random() * 5) - 2;
            deltaX += shakeX;
            deltaY += shakeY;
            User32.INSTANCE.mouse_event(User32.MOUSEEVENTF_MOVE, deltaX, deltaY, 0, 0);
            Thread.sleep(10 + (int)(Math.random() * 20)); 
        }
    }
}
