#bun-memory
1 messages · Page 1 of 1 (latest)
I'm not saying that it'll be used for game cheats… but it would certainly make them a walk in the park. 😛
Nice, I wonder if you can make a cool cross platform one using the tinycc thing bun has which shoukd allow you to use low level apis without build step
I tried TCC, even the examples in the Bun docs, and none of them would compile... I have no idea what I was doing wrong.
I would copy the examples line-by-line and it would fail.
I'm interested in your findings. I would love to use it, but I'm not very good at figuring that out.
Hol on 👀
Did you ever have a chance to take a look? I’m super curious
Oh I forgot, I use macos mainly these days so needed to find windows
I should be able to look into it a little today while waiting for builds tho
Cheers, brother!
This is what I was trying:
https://bun.sh/reference/bun/ffi/cc?_gl=1*10cguca*_ga*MjA1NjU1Nzg0MS4xNzU2MDc4NTQ4*_ga_3683R8TZ5M*czE3NTgzMjUwODAkbzEyJGcxJHQxNzU4MzI1MDgyJGo1OCRsMCRoMTc0MDQ4NDgwNw..#bun:ffi.cc
error: 1 errors while compiling D:\Projects\hello.c
D:/Projects/hello.c:1: error: include file 'stdio.h' not found
Maybe you need that .h file, idk c lol
I updated methods to be more in line with Bun's FFI methods.
For example, readInt32LE is now just i32. readBigUint64LE is now just u64… etc.
If you do not provide a value, the method will read. If you provide a value, it will write:
// Read my ammo…
const ammo = cs2.i32(ammoAddress);
// Write my ammo…
const myAmmo = 99;
cs2.i32(ammoAddress, myAmmo);
String methods now use Bun's CString:
const playerName = cs2.cString(playerNameAddress);
console.log(`My name is: ${playerName}.`);
There are also new methods for array types:
// Read 32 i32s from myAddress…
const i32Array = cs2.i32Array(myAddress, 32);
// Write 32 i32s to myAddress…
const myArray = new Int32Array(32);
cs2.i32Array(myAddress, myArray);
// Read 32 Vector3s…
const vector3Array = cs2.vector3Array(myAddress, 32);
awesome, thanks for making this
I think making cheats can a super fun project and this would make it really easy to get into
Thanks for the kind words! Let me know if you need a hand or havge any questions! I can also help on where to get started!
I don't think I'll get around to using it just wanted to thank you
have really good memories of making stuff for https://assault.cubers.net
having something like this would have been really fun
Oh wicked! Cheers, brother!
Added a fully functional trigger-bot for Counter-Strike 2!
Ok but bun imgui when
for the ui
I don't do game cheating but I think of memory hacking as super cool
I have done some C++, qt and glfw stuff but never too much low level stuff
Also I saw the ticks value and thought like "that's gonna lose precision if the number gets too high" but I noticed you're resetting it every second at the end of the file
Also now deadass I want to make bun-imgui
Headers are very os specific
What happens if you run in a developer command prompt for visual studio build tools
or in a mingw environment like https://www.msys2.org/
Should work in msys not sure about visual studio build tools
oh also you will have to follow the steps on the msys site, use msys ucrt64 and install mingw gcc
Saying it might not work in vs build tools because msvc shit is a bit special at times
I actually have a bunch bun-overlay that uses OpenGL that I’ve been working on. You can draw in 2D or 3D space on the same overlay. No need for hacky worldToScreen functions. 🙂
Yea but add imgui and make it even more peak
I’m actually going to look into that. I’m curious about its performance in comparison
c-api for imgui (https://github.com/ocornut/imgui) Look at: https://github.com/cimgui for other widgets - cimgui/cimgui
Imgui itself is C++ but there are programmatically generated C bindings
It's a very good lightweight ui library
Also yea the generator is implemented in lua
If it can keep up to my bun-overlay in terms of FPS and not get me banned from CS2, I’m so down. I appreciate the links and suggestion!
So long as you use the same opengl overlay approach yea it should work
You just have to configure it's opengl renderer
Or if you want something more ridiculous there is https://github.com/mikke89/RmlUi
Has a sample opengl backend and system interface too
It's just a UI framework and a markup language mostly based on xhtml
Hopefully this gets addressed fairly quickly so that I can better implement strings:
https://github.com/oven-sh/bun/issues/22920
You can probably fix it yourself
Given bun probably already knows the length and offset but it just isn't passed to the js object
I doubt it'd be a large change
Largest thing would be compiling bun to test since zig is slooow to compile
Yeah, but unfortunately I’m not familiar at all with Zig, or I would do it myself. 😛
Added some massive performance gains for repeated loops. It now avoid a second FFI hop by using typed array scratches for common methods such as f32, f64, i16, etc.
bun update bun-memory
Just waiting for #22973 to be merged and I can put more work into strings and such!
Very nice package, btw!
Thanks, brother! I hope many find it useful!
Help me to keep more distance from windows
Added pattern searching!
// Find a byte pattern in memory (supports wildcards: ** and ??)
const needle = 'deadbeef';
// const needle = 'de**beef';
// const needle = 'de????ef';
const address = cs2.pattern(needle, 0x10000000n, 0x1000);
if (address !== -1n) {
console.log(`Found at 0x${address.toString(16)}`);
}