-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version
5.0.0
: massively improved performance by utilizing Project …
…Panama rather than JNA for keystate/interception calls, and improved `AimBotThread` sleeping to be more precise
- Loading branch information
Showing
14 changed files
with
218 additions
and
97 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/kotlin/org/jire/overwatcheat/nativelib/User32Panama.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Free, open-source undetected color cheat for Overwatch! | ||
* Copyright (C) 2017 Thomas G. Nappo | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.jire.overwatcheat.nativelib | ||
|
||
import java.lang.foreign.* | ||
|
||
object User32Panama { | ||
|
||
val linker = Linker.nativeLinker() | ||
val user32 = SymbolLookup.libraryLookup("User32", MemorySession.global()) | ||
val getKeyState = linker.downcallHandle( | ||
user32.lookup("GetKeyState").get(), | ||
FunctionDescriptor.of(ValueLayout.JAVA_SHORT, ValueLayout.JAVA_INT) | ||
) | ||
|
||
fun GetKeyState(nVirtKey: Int): Short = getKeyState.invokeExact(nVirtKey) as Short | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
src/main/kotlin/org/jire/overwatcheat/nativelib/interception/InterceptionPanama.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Free, open-source undetected color cheat for Overwatch! | ||
* Copyright (C) 2017 Thomas G. Nappo | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.jire.overwatcheat.nativelib.interception | ||
|
||
import java.lang.foreign.* | ||
|
||
object InterceptionPanama { | ||
|
||
val linker = Linker.nativeLinker() | ||
val interception = SymbolLookup.libraryLookup("interception", MemorySession.global()) | ||
|
||
private val interception_create_context = linker.downcallHandle( | ||
interception.lookup("interception_create_context").get(), | ||
FunctionDescriptor.of(ValueLayout.ADDRESS) | ||
) | ||
|
||
fun interception_create_context() = interception_create_context.invokeExact() as MemoryAddress | ||
|
||
val interceptionMouseStrokeLayout: GroupLayout = MemoryLayout.structLayout( | ||
ValueLayout.JAVA_SHORT, | ||
ValueLayout.JAVA_SHORT, | ||
ValueLayout.JAVA_SHORT, | ||
ValueLayout.JAVA_INT, | ||
ValueLayout.JAVA_INT, | ||
ValueLayout.JAVA_INT | ||
) | ||
|
||
private val interception_send = linker.downcallHandle( | ||
interception.lookup("interception_send").get(), | ||
FunctionDescriptor.of( | ||
ValueLayout.JAVA_INT, | ||
ValueLayout.ADDRESS, ValueLayout.JAVA_INT, interceptionMouseStrokeLayout, ValueLayout.JAVA_INT | ||
) | ||
) | ||
|
||
fun interception_send(context: Addressable, device: Int, stroke: MemorySegment, nstroke: Int) = | ||
interception_send.invokeExact( | ||
context, | ||
device, | ||
stroke, | ||
nstroke | ||
) as Int | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Free, open-source undetected color cheat for Overwatch! | ||
* Copyright (C) 2017 Thomas G. Nappo | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.jire.overwatcheat.util | ||
|
||
object Threads { | ||
|
||
fun preciseSleep(totalNanos: Long) { | ||
val startTime = System.nanoTime() | ||
|
||
// busy-waiting | ||
while (System.nanoTime() - startTime < totalNanos) { | ||
Thread.onSpinWait() | ||
} | ||
} | ||
|
||
} |