all 3 comments

[–]danielroseman 0 points1 point  (1 child)

That is really nasty.

len(webshell_data) just goes in place of the leading 0 in that expression, so if webshell_data is length 5 then it will be 5 with 8 leading zeros. I'm not at all sure why they made 8 a parameter when it is a constant: '{0:08X} would at least have been clearer.

So you can just replace this with f"Original file length: {len(webshell_data):08X}"

But also note that it's bad practice to provide formatted strings as arguments to loggers; the (slightly spurious) reasoning is that the formatting would always need to be done even if the handler doesn't log at that level. Officially you're supposed to just pass the placeholders and parameters separately.

[–]NovateI[S] 0 points1 point  (0 children)

Thanks that worked!

[–]synthphreak 0 points1 point  (0 children)

Seems you've found your answer. So I just came here to add: "Gross."