m4b / goblin

An impish, cross-platform binary parsing crate, written in Rust
MIT License
1.17k stars 156 forks source link

PE: preparations for a writer outside of Goblin #389

Open RaitoBezarius opened 6 months ago

RaitoBezarius commented 6 months ago

Hi there @m4b, as we discussed it in #381. Here's are commits, more in the mind of:

For now, I will focus on making it possible to write final executables, not object files. I believe this may require more efforts from someone who is really interested into writing a PE compiler or PE object files with this ecosystem.

This is a bunch of QoL improvements for the writer that I'm preparing in another repo, if it's good, and I get myself to 0.x something, I will try to see if it makes sense to send it to faerie or something that would be the good place for such a thing.

In the time being, to unblock on the reviews and merging, here's a bunch of easy things.

I make some stuff pub on purpose because I don't believe it's a big deal to let the user observe it, please correct me if you disagree, and I can try to find a way to make it better.

As far as I can tell, this PR has no breaking changes. I have more in stock which I am fleshing out to make this easy for you.

RaitoBezarius commented 6 months ago

https://github.com/RaitoBezarius/ifrit will be my model for the meta writer PE, if it graduates, I will send it your way in faerie if it makes sense. :)

m4b commented 5 months ago

lol i love the name :) so just catching up here again, iiuc, this has no breaking changes, but you'd like this patch merged right?

RaitoBezarius commented 5 months ago

Addressed your comments @m4b, please take a look again.

Right now, it's mostly working, except I'm chasing an alignment issue somewhere... which appeared since the split.

m4b commented 5 months ago

Cool let me know when you found it ! otherwise this is looking pretty good :)

RaitoBezarius commented 5 months ago

@m4b I believe we are ready to go, I tracked the last bug which was not a bug in Goblin but my tests being overzealous and wanting equality between unaligned certificates and aligned certificates, so I forked out to this sort of things: https://github.com/nix-community/goblin-signing/pull/6/files#diff-85ad85dc9b5387ec57ec5c58ab8880b11f7897b4e4cf3bb78f02907e630891d3R26-R53

JohnScience commented 4 months ago

Hi there @m4b, as we discussed it in #381. Here's are commits, more in the mind of:

  • Preparations for 1.0 and breaking changes: this PR should be good to go for a patch release I'd say.
  • Enable to write an external writer given enough data

For now, I will focus on making it possible to write final executables, not object files. I believe this may require more efforts from someone who is really interested into writing a PE compiler or PE object files with this ecosystem.

This is a bunch of QoL improvements for the writer that I'm preparing in another repo, if it's good, and I get myself to 0.x something, I will try to see if it makes sense to send it to faerie or something that would be the good place for such a thing.

In the time being, to unblock on the reviews and merging, here's a bunch of easy things.

I make some stuff pub on purpose because I don't believe it's a big deal to let the user observe it, please correct me if you disagree, and I can try to find a way to make it better.

As far as I can tell, this PR has no breaking changes. I have more in stock which I am fleshing out to make this easy for you.

Since you mention breaking changes, there are many that should be made for goblin::pe, in my opinion. Right now, I'm documenting everything there and pointing out stuff that in my opinion is a bad idea. There are many such things.

m4b commented 4 months ago

Hi there @m4b, as we discussed it in #381. Here's are commits, more in the mind of:

  • Preparations for 1.0 and breaking changes: this PR should be good to go for a patch release I'd say.
  • Enable to write an external writer given enough data

For now, I will focus on making it possible to write final executables, not object files. I believe this may require more efforts from someone who is really interested into writing a PE compiler or PE object files with this ecosystem. This is a bunch of QoL improvements for the writer that I'm preparing in another repo, if it's good, and I get myself to 0.x something, I will try to see if it makes sense to send it to faerie or something that would be the good place for such a thing. In the time being, to unblock on the reviews and merging, here's a bunch of easy things. I make some stuff pub on purpose because I don't believe it's a big deal to let the user observe it, please correct me if you disagree, and I can try to find a way to make it better. As far as I can tell, this PR has no breaking changes. I have more in stock which I am fleshing out to make this easy for you.

Since you mention breaking changes, there are many that should be made for goblin::pe, in my opinion. Right now, I'm documenting everything there and pointing out stuff that in my opinion is a bad idea. There are many such things.

@JohnScience if you have some suggestions here feel free to open up a tracker issue/wishlist/things you think are wrong and we can investigate :) especially if you think there are crucial things that need fixing and will break backwards compat, now is the time; if they are large overarching changes to the architecture of goblin's PE though, there is realistically not a good chance it will be merged, but hard to say :)