Skip to content

Commit fd3bdc7

Browse files
committed
Some stuff that might help with reversing noita
1 parent e036116 commit fd3bdc7

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

ewext/src/lib.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ fn test_fn(_lua: LuaState) -> eyre::Result<()> {
251251
Ok(())
252252
}
253253

254+
fn probe(_lua: LuaState) {
255+
backtrace::trace(|frame| {
256+
let ip = frame.ip() as usize;
257+
println!("Probe: 0x{ip:x}");
258+
false
259+
});
260+
}
261+
254262
fn __gc(_lua: LuaState) {
255263
println!("ewext collected in thread {:?}", thread::current().id());
256264
NETMANAGER.lock().unwrap().take();
@@ -265,6 +273,15 @@ fn __gc(_lua: LuaState) {
265273
pub unsafe extern "C" fn luaopen_ewext0(lua: *mut lua_State) -> c_int {
266274
println!("Initializing ewext");
267275

276+
println!(
277+
"lua_call: 0x{:x}",
278+
(*LUA.lua_call.as_ref().unwrap()) as usize
279+
);
280+
println!(
281+
"lua_pcall: 0x{:x}",
282+
(*LUA.lua_pcall.as_ref().unwrap()) as usize
283+
);
284+
268285
unsafe {
269286
LUA.lua_createtable(lua, 0, 0);
270287

@@ -284,6 +301,7 @@ pub unsafe extern "C" fn luaopen_ewext0(lua: *mut lua_State) -> c_int {
284301
add_lua_fn!(on_world_initialized);
285302
add_lua_fn!(test_fn);
286303
add_lua_fn!(bench_fn);
304+
add_lua_fn!(probe);
287305

288306
add_lua_fn!(netmanager_connect);
289307
add_lua_fn!(netmanager_recv);

shared/Cargo.lock

Lines changed: 107 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)