I display a lot of decompiled code in my blog when writing up research on compiled binaries. Over the years I’ve bounced between screenshots (pain in the ass) to copied HLIL/pseudo-c without address (loses valuable context but looks pretty) to HLIL/pseudo-c (easy, highlights kinda ugly).
This isn’t particularly high-quality or production grade code — it was the result of an afternoon yak shave that was Good Enough for my use case and I haven’t thought about it since — I mention it here because of marginally higher discovery on my blog than a random GitHub repo.
you can find it here :) do let me know if there are any edge cases or low hanging fruit improvements that would help your use case and I’d be happy to work on it more.
1000011a9 void* clap(int64_t arg1, int64_t arg2)2
3000011eb *(arg1 + &data) = *(arg1 + &data) ^ *(arg2 + &data)40000121f *(arg2 + &data) = *(arg2 + &data) ^ *(arg1 + &data)500001253 *(arg1 + &data) = *(arg1 + &data) ^ *(arg2 + &data)600001257 return arg1 + &data7
800001258 int32_t main(int32_t argc, char** argv, char** envp)9
1000001264 void* fsbase1100001264 int64_t rax = *(fsbase + 0x28)120000127d puts(str: &__art)130000128c puts(str: "\x1b[0;33mEven this cursed spiri…")1400001303 while (data != 0)1500001293 int64_t var_18 = 016000012b4 printf(format: "\n\x1b[31;49;1;4m%s\x1b[0m\n\n\n", &data)17000012c3 puts(str: "The sound of \x1b[0;33mgion shoj…")18000012e2 int64_t var_2019000012e2 __isoc99_scanf(format: "%zu %zu", &var_20, &var_18)20000012f5 clap(var_20, var_18)210000130e *(fsbase + 0x28)2200001317 if (rax == *(fsbase + 0x28))230000131f return 02400001319 __stack_chk_fail()2500001319 noreturn
1000011a9 void* clap(int64_t arg1, int64_t arg2)2
3000011eb *(arg1 + &data) = *(arg1 + &data) ^ *(arg2 + &data)40000121f *(arg2 + &data) = *(arg2 + &data) ^ *(arg1 + &data)500001253 *(arg1 + &data) = *(arg1 + &data) ^ *(arg2 + &data)600001257 return arg1 + &data7
800001258 int32_t main(int32_t argc, char** argv, char** envp)9
1000001264 void* fsbase1100001264 int64_t rax = *(fsbase + 0x28)120000127d puts(str: &__art)130000128c puts(str: "\x1b[0;33mEven this cursed spiri…")1400001303 while (data != 0)1500001293 int64_t var_18 = 016000012b4 printf(format: "\n\x1b[31;49;1;4m%s\x1b[0m\n\n\n", &data)17000012c3 puts(str: "The sound of \x1b[0;33mgion shoj…")18000012e2 int64_t var_2019000012e2 __isoc99_scanf(format: "%zu %zu", &var_20, &var_18)20000012f5 clap(var_20, var_18)210000130e *(fsbase + 0x28)2200001317 if (rax == *(fsbase + 0x28))230000131f return 02400001319 __stack_chk_fail()2500001319 noreturn
1// pnpm add tsheinen/tm_hlil2import { defineConfig } from 'astro/config';3import { hlil } from 'tm_hlil';4
5// https://astro.build/config6export default defineConfig({7 site: 'https://example.com',8 markdown: {9 shikiConfig: {10 langs: [hlil]11 }12 }13});