diff options
author | Malfurious <m@lfurio.us> | 2021-12-14 04:42:37 -0500 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2021-12-17 22:19:32 -0500 |
commit | adad3ce320aa774ff274965e001bea5a096a879b (patch) | |
tree | 7df681c6639c81bb97c1ad6a0cd4a76e346ee385 /tools/hexbin.c | |
parent | eb3933d26ec97d88472f7ff1eefde06b3c9c3e8a (diff) | |
download | lib-des-gnux-adad3ce320aa774ff274965e001bea5a096a879b.tar.gz lib-des-gnux-adad3ce320aa774ff274965e001bea5a096a879b.zip |
sploit: Rework logger
The log module is updated to support binary encodings, colors, and for
improved compatibility with Python's print() builtin.
Encoding semantics are switched up, since it seems like some of the more
interesting encoding modes (from a CTF perspective) actually use
bytes-like objects as their high-level form (that is, bytes are encoded
to another form, such as hex, then decoded back to the original form).
So the logged value is now passed to encode instead of decode, and only
if the object is of type 'bytes', as unicode strings are now considered
out-of-scope for this operation. Additionally, the bytes wrapper (b'')
is no longer visible in the logged content.
For readability, several standard colors have been defined for use
within Sploit:
- RED: Errors
- YELLOW: Warnings
- GREEN: Status messages / Startup messages
- WHITE: Target output
- GRAY: User output / Alt text
Logging functions now support an optional color option to select the
desired color, and have specific defaults based on who is invoking the
log (see below...)
Logging functions are now also fully compatible with the builtin print()
function. This is because Sploit now replaces the standard print() with
a logging function within the user's script (which is done to maintain
additional consistency of messages displayed in the console).
Function ilog (internal log) has default values tuned for the library's
convenience: Text goes to stderr, and is presented as status messages
(green).
Function elog (external log) has default values tuned for the user: Text
goes to stdout, and is presented as alt text to distinguish it from data
read from the target. Within the user context, 'print' refers to this
function.
Signed-off-by: Malfurious <m@lfurio.us>
Signed-off-by: dusoleil <howcansocksbereal@gmail.com>
Diffstat (limited to 'tools/hexbin.c')
0 files changed, 0 insertions, 0 deletions