Closed svidovich closed 4 years ago
Hi @svidovich thanks for the PR, please submit this PR on the 'dev' branch.
I have made changes as requested, and the code still runs quite well locally for me. Let me know if it gives you any difficulties, or if you'd like more changes. Thank you!
Merged, thanks for the pr.
Hello! I've prepared a PR as a potential improvement. This began as minor fixes to make vxhunter work with a particular VxWorks binary that wouldn't run all the way through.
This ended up being an out-of-range access problem due to logging in the
_check_fix
function invxhunter_core
. I fixed this problem, and on the way, added a ton of logging, and clarity around the logs.Another problem was that logging in
vxhunter_symbol
didn't really work out of the box, so I addedbasicConfig
to that module which can be turned on as desired. Some unnecessary exception handling was removed fromvxhunter_symbol
as well.While digging around, I noticed that you had a
TODO
around improving the performance of the function called_check_is_func_name
invxhunter_core
. I improved the logic to use regex instead of a list iteration for checking whether or not any of the characters matched a 'bad list', which you had provided before. I renamed the_check_is_func_name
to_is_func_name
for clarity, since it returns a boolean value. Using the new logic, this function will run faster, and if a failure occurs, will fail faster.Also, the static
_is_printable
method of theVxTarget
class now works on both strings and characters, which should help writing performance improvements around this in the future. Instead of checking whether each character of a string is within ascii range, we can simply try to decode it to ascii. If an exception occurs, the function will return false; otherwise it will return true.At times, I noticed that
*
imports lead to confusion, so where I could, I eliminated these in place of explicit imports from given modules.Other changes you'll notice are mostly due to autoformatting, such as indentation, spacing, etc.
I have found that with my changes, firmwares old and new run through successfully. I hope this finds you well!