Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions src/vmaware.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4694,7 +4694,7 @@
#endif
};

thread_local u32 aux = 0;

Check warning on line 4697 in src/vmaware.hpp

View workflow job for this annotation

GitHub Actions / Analyze (cpp, gcc-14, Ninja Multi-Config, Debug, ON)

unused variable 'aux' [-Wunused-variable]
auto cpuid = [](unsigned int leaf) noexcept -> u64 {
#if (MSVC)
// make regs volatile so writes cannot be optimized out, if this isn't added and the code is compiled in release mode, cycles would be around 40 even under Hyper-V
Expand Down Expand Up @@ -4992,7 +4992,7 @@
const u64 b = t1_end.load(std::memory_order_acquire);
#ifdef __VMAWARE_DEBUG__
const u64 c = t2_start.load(std::memory_order_acquire);
const u64 d = t2_end.load(std::memory_order_acquire);

Check warning on line 4995 in src/vmaware.hpp

View workflow job for this annotation

GitHub Actions / Analyze (cpp, gcc-14, Ninja Multi-Config, Debug, ON)

unused variable 'd' [-Wunused-variable]
#endif
const u64 acc = t2_accum.load(std::memory_order_acquire);

Expand Down Expand Up @@ -5049,7 +5049,7 @@
ProcessorInformation = 11
};

const HMODULE hPowr = GetModuleHandleA("powrprof.dll");
const HMODULE hPowr = LoadLibraryA("powrprof.dll");
if (!hPowr) return 0;

const char* names[] = { "CallNtPowerInformation" };
Expand Down Expand Up @@ -11772,22 +11772,21 @@
if (flag_bit < technique_end) {
const core::technique& pair = core::technique_table[flag_bit];

if (auto run_fn = pair.run) {
if (auto run_fn = pair.run) {
core::last_detected_brand = nullptr;
core::last_detected_score = 0;
core::last_detected_score = 0;

const bool result = run_fn();

const u8 points_to_add = (core::last_detected_score > 0) ? core::last_detected_score : pair.points;
const char* detected_brand = (core::last_detected_brand) ? core::last_detected_brand : brands::NULL_BRAND;

bool result = run_fn();
if (result) {
#ifdef __VMAWARE_DEBUG__
total_points += pair.points;
#endif
detected_count_num++;
u8 points_to_add = (core::last_detected_score > 0) ? core::last_detected_score : pair.points;
const char* detected_brand = (core::last_detected_brand) ? core::last_detected_brand : brands::NULL_BRAND;

memo::cache_store(flag_bit, result, points_to_add, detected_brand);
return result;
}

memo::cache_store(flag_bit, result, result ? points_to_add : 0, detected_brand);
return result;
}
else {
throw_error("Flag is not known or not implemented");
Expand All @@ -11814,9 +11813,6 @@
// is the multiple setting flag enabled?
const bool is_multiple = core::is_enabled(flags, MULTIPLE);

// run all the techniques
const u16 score = core::run_all(flags);

// check if the result is already cached and return that instead
if (is_multiple) {
if (memo::multi_brand::is_cached()) {
Expand All @@ -11831,6 +11827,9 @@
}
}

// run all the techniques
const u16 score = core::run_all(flags);

#if (VMA_CPP <= 14)
constexpr const char* TMP_QEMU = "QEMU";
constexpr const char* TMP_KVM = "KVM";
Expand Down
Loading