mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-22 08:08:10 +00:00
Merge pull request #3146 from matrix/backendInfo_add_sysinfo
Added generic system info to backend_info()
This commit is contained in:
commit
e971a6e095
@ -21,6 +21,13 @@
|
||||
#endif // __APPLE__
|
||||
#endif // _WIN
|
||||
|
||||
#if !defined (_WIN) && !defined (__CYGWIN__) && !defined (__MSYS__)
|
||||
#include <sys/utsname.h>
|
||||
#if !defined (__linux__)
|
||||
#include <sys/sysctl.h>
|
||||
#endif // ! __linux__
|
||||
#endif // ! _WIN && | __CYGWIN__ && ! __MSYS__
|
||||
|
||||
void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag);
|
||||
void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop);
|
||||
|
||||
|
@ -801,6 +801,62 @@ void backend_info (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
const backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;
|
||||
|
||||
event_log_info (hashcat_ctx, "System Info:");
|
||||
event_log_info (hashcat_ctx, "============");
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
|
||||
#if defined (_WIN) || defined (__CYGWIN__) || defined (__MSYS__)
|
||||
// TODO
|
||||
event_log_info (hashcat_ctx, "OS.Name......: N/A");
|
||||
event_log_info (hashcat_ctx, "OS.Release...: N/A");
|
||||
event_log_info (hashcat_ctx, "HW.Platform..: N/A");
|
||||
event_log_info (hashcat_ctx, "HW.Model.....: N/A");
|
||||
#else
|
||||
struct utsname utsbuf;
|
||||
|
||||
bool rc_uname = false;
|
||||
bool rc_sysctl = false;
|
||||
|
||||
char *hw_model = NULL;
|
||||
size_t hw_model_len = 0;
|
||||
|
||||
#if !defined (__linux__)
|
||||
|
||||
if (sysctlbyname ("hw.model", NULL, &hw_model_len, NULL, 0) == 0 && hw_model_len > 0)
|
||||
{
|
||||
hw_model = (char *) hcmalloc (hw_model_len);
|
||||
|
||||
if (sysctlbyname ("hw.model", hw_model, &hw_model_len, NULL, 0) != 0)
|
||||
{
|
||||
hw_model = NULL;
|
||||
hw_model_len = 0;
|
||||
|
||||
hcfree (hw_model);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc_sysctl = true;
|
||||
}
|
||||
}
|
||||
#endif // ! __linux__
|
||||
|
||||
if (uname (&utsbuf) == 0)
|
||||
{
|
||||
rc_uname = true;
|
||||
}
|
||||
|
||||
event_log_info (hashcat_ctx, "OS.Name......: %s", (rc_uname == true) ? utsbuf.sysname : "N/A");
|
||||
event_log_info (hashcat_ctx, "OS.Release...: %s", (rc_uname == true) ? utsbuf.release : "N/A");
|
||||
event_log_info (hashcat_ctx, "HW.Model.....: %s", (rc_sysctl == true) ? hw_model : "N/A");
|
||||
event_log_info (hashcat_ctx, "HW.Platform..: %s", (rc_uname == true) ? utsbuf.machine : "N/A");
|
||||
event_log_info (hashcat_ctx, NULL);
|
||||
|
||||
if (rc_sysctl == true)
|
||||
{
|
||||
hcfree (hw_model);
|
||||
}
|
||||
#endif // _WIN || __CYGWIN__ || __MSYS__
|
||||
|
||||
if (backend_ctx->cuda)
|
||||
{
|
||||
event_log_info (hashcat_ctx, "CUDA Info:");
|
||||
|
Loading…
Reference in New Issue
Block a user