|
func BinaryMagic(buf []byte) (int, error) { |
So here is my suggestion if you like it I am happy to implement it and make a PR:
My suggestion is to look for the architecture type 32 or 64 bit in the magic header in addition to the file type.
After looking at this three sites I am confident that this is an very easy task:
I think because of backwards compatibility it is not a viable option to extend the BinaryMagic function therefor I would implement this feature in a new function ArchType or so.
I got to this issue because I read the injection code for executable files in the backdoorfactory repo and stumbled upon a todo-comment with the arch type.
I will fix that too just thought I can start here to make it a nicer fix 😄.
binjection/bj/utils.go
Line 50 in 605d46e
So here is my suggestion if you like it I am happy to implement it and make a PR:
My suggestion is to look for the architecture type 32 or 64 bit in the magic header in addition to the file type.
After looking at this three sites I am confident that this is an very easy task:
I think because of backwards compatibility it is not a viable option to extend the
BinaryMagicfunction therefor I would implement this feature in a new functionArchTypeor so.I got to this issue because I read the injection code for executable files in the backdoorfactory repo and stumbled upon a todo-comment with the arch type.
I will fix that too just thought I can start here to make it a nicer fix 😄.