#Implementing uleb128_33

1 messages ยท Page 1 of 1 (latest)

neat ridge
#

Hello, newbie here. I'm trying to parse the LuaJit bytecode. They have this type called uleb128_33 as seen here (1, 2).

I understand their code but how can I implement this in the pattern language? I'm browsing the patterns repo for reference but the thing is I don't exactly know what it's supposed to look like.

GitHub

Mirror of the LuaJIT git repository. Contribute to LuaJIT/LuaJIT development by creating an account on GitHub.

GitHub

LuaJIT bytecode decompiler. Contribute to marsinator358/luajit-decompiler-v2 development by creating an account on GitHub.

nocturne onyx
nocturne onyx
#

There is also a lua54 pattern used to analyze lua byte code that uses a variable called leb128. A cursory glance reveals code similar to what you posted so even if it is not exactly what you want it may help you get started.

neat ridge
#

Yep I think I get it now. I've re-read the docs a couple of times and the Lua54 hexpat now makes more sense to me. I've actually seen it prior, it just didn't register to my brain what it's actually doing. The thing that I missed was how attributes are actually useful (I thought they were useless for some reason).