hugsy / gef-extras

Extra goodies for GEF to (try to) make GDB suck even less
https://hugsy.github.io/gef-extras
MIT License
148 stars 50 forks source link

Prettify retdec output #43

Closed caprinux closed 2 years ago

caprinux commented 2 years ago

Addresses #42 Tested on python versions 2.7.18 and 3.11.

  1. Used rstrip instead of strip to prevent stripping indentation
  2. Instead of removing all commented lines, I removed only the retdec watermark and the last 5 lines of metainfo

retdec GEF output before: image

retdec GEF output after: image

caprinux commented 2 years ago

Thanks for the suggestions! Looks better now :)

Grazfather commented 2 years ago

Looks good!

hugsy commented 2 years ago

@caprinux Have you thought about using Pygments for a more granular control over the produced C code ? In gef-extras we don't worry too much about adding external librairies, and this case seems like a perfect candidate for Pygments.

caprinux commented 2 years ago

@hugsy Yes I was actually thinking about it but was worried about the external library part of it. I've never worked with pygments before but I'll go figure it out :)

hugsy commented 2 years ago

No problem at all, that's what the repo is for :) just remember to add it to the requirements.txt file

Grazfather commented 2 years ago

We can squash and merge this since it’s a nice simple improvement and add syntax highlighting later

On Wed, Oct 27, 2021 at 9:17 PM hugsy @.***> wrote:

No problem at all, that's what the repo is for :) just remember to add it to the requirements.txt file

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/hugsy/gef-extras/pull/43#issuecomment-953424146, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADZNHTXUXUXD5GFAEI3YS3UJCQC5ANCNFSM5GZKTDRQ .

-- Thanks,

G

caprinux commented 2 years ago

Changelog:

Please let me know if there's anything I could improve on :)

I'll leave some images I added to the docs here for viewing  

-- gef-retdec-full

-- gef-retdec-symbol-main