Skip to content

Instantly share code, notes, and snippets.

View Jire's full-sized avatar
🇧🇷
of the jungle

Jire Jire

🇧🇷
of the jungle
View GitHub Profile
.text:6BA9ABE0 ; UINT __stdcall SendInput(UINT cInputs, LPINPUT pInputs, int cbSize)
.text:6BA9ABE0 public SendInput
.text:6BA9ABE0 SendInput proc near ; CODE XREF: keybd_event+39p
.text:6BA9ABE0 ; mouse_event+36p
.text:6BA9ABE0 ; DATA XREF: ...
.text:6BA9ABE0
.text:6BA9ABE0 cInputs = dword ptr 4
.text:6BA9ABE0 pInputs = dword ptr 8
.text:6BA9ABE0 cbSize = dword ptr 0Ch
.text:6BA9ABE0
.text:6BAF5E37 ; void __stdcall mouse_event(DWORD dwFlags, DWORD dx, DWORD dy, DWORD dwData, ULONG_PTR dwExtraInfo)
.text:6BAF5E37 public mouse_event
.text:6BAF5E37 mouse_event proc near ; DATA XREF: .text:off_6BA81028o
.text:6BAF5E37
.text:6BAF5E37 pInputs = tagINPUT ptr -1Ch
.text:6BAF5E37 dwFlags = dword ptr 8
.text:6BAF5E37 arg_4 = dword ptr 0Ch
.text:6BAF5E37 dy = dword ptr 10h
.text:6BAF5E37 dwData = dword ptr 14h
.text:6BAF5E37 dwExtraInfo = dword ptr 18h
val snapshot = JNAKernel32.CreateToolhelp32Snapshot(Tlhelp32.TH32CS_SNAPMODULE, Windows.DWORD_ZERO)
val entry = Tlhelp32.MODULEENTRY32W.ByReference()
try {
while (JNAKernel32.Module32NextW(snapshot, entry)) {
val bytes = ByteArray(256)
Psapi.GetModuleBaseNameA(snapshot.pointer, entry.pointer, bytes, bytes.size)
val name = Native.toString(bytes)
println(name)
}
throw IllegalStateException("Could not find module matching \"$moduleName\"")
enum eClientClassId
{
NextBotCombatCharacter = 0,
CAK47 = 1,
CBaseAnimating = 2,
CBaseAnimatingOverlay = 3,
CBaseAttributableItem = 4,
CBaseButton = 5,
CBaseCombatCharacter = 6,
CBaseCombatWeapon = 7,
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import org.jire.kotmem.NativeBuffer;
import org.jire.kotmem.Process;
import java.util.HashMap;
import java.util.Map;
public final class KotmemJava {
@Jire
Jire / build.gradle
Created June 21, 2016 18:53
build.gradle of Wot
group 'org.jire.wot'
version '0.1'
ext {
kotlinVersion = "1.0.2-1"
gdxVersion = '1.9.3'
roboVMVersion = '2.1.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
@Jire
Jire / Indexer.kt
Created June 8, 2016 01:30
Zero-garbage fast iteration collection
package com.acelta.util
import com.acelta.world.mob.Mob
class Indexer<T : Mob>(val capacity: Int) : MutableIterable<T> {
private inner class Iterator : MutableIterator<T> {
internal var cursor = 0
public final void updatePlayers(Buffer b, int size) {
int updateCount = 0;
b.startBitAccess(0);
currentPlane = b.readBits(2);
int tileX = b.readBits(7);
int tileY = b.readBits(7);
if (b.readBits(1) == 1) {
entityUpdateIndices[updateCount++] = LOCALPLAYER_INDEX;
package com.acelta.world.mob
import com.acelta.world.mob.player.Player
import com.acelta.world.region.lastRegionX
import com.acelta.world.region.lastRegionY
import com.acelta.packet.outgoing.rs186.sector
import it.unimi.dsi.fastutil.ints.IntArrayList
import java.lang.Math.abs
import java.lang.Math.max
@Sharable object HTTPHandler : SimpleChannelInboundHandler<HttpRequest>() {
private val files = Object2ObjectArrayMap<String, ByteBuf>(8)
override fun channelRead0(ctx: ChannelHandlerContext, msg: HttpRequest) {
val uri = msg.uri()
var buffer = files[uri]
if (buffer == null) {
val bytes = Files.readAllBytes(Paths.get(uri))
buffer = ctx.alloc().directBuffer(bytes.size)
buffer.writeBytes(bytes)