diff options
author | sss <sss@dark-alexandr.net> | 2023-01-17 00:38:19 +0300 |
---|---|---|
committer | sss <sss@dark-alexandr.net> | 2023-01-17 00:38:19 +0300 |
commit | cc3f33db7a8d3c4ad373e646b199808e01bc5d9b (patch) | |
tree | ec09d690c7656ab5f2cc72607e05fb359c24d8b2 /src/core/utilities.h |
added webrdp public code
Diffstat (limited to 'src/core/utilities.h')
-rw-r--r-- | src/core/utilities.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/utilities.h b/src/core/utilities.h new file mode 100644 index 0000000..ee2c6eb --- /dev/null +++ b/src/core/utilities.h @@ -0,0 +1,28 @@ +/* BSD-2-Clause license + * + * Copyright (c) 2018-2023 NST <www.newinfosec.ru>, sss <sss at dark-alexandr dot net>. + * + */ + +#pragma once + +/* check if destination path is regular file */ +bool is_regular_file(const char *path); + +/* check if destination path is directory */ +bool is_directory(const char *path); + +/* calculate sha1 hash of src */ +bool sha1(uint8_t *dst, const uint8_t *src, size_t src_length); + +/* print hex representation of buf to stdout */ +void hex_print(const uint8_t *buf, size_t buf_len); + +/* get one random ascii character */ +char random_ascii_character(); + +/* get random string of ascii characters with length of 'len' + * and store intopointed buffer */ +char *random_ascii_string(char *buf, const size_t buf_size); + +void random_bytes(uint8_t *buf, size_t buf_len); |