Commit Graph

57 Commits

Author SHA1 Message Date
Soham Nandy
daeefb4a7f refactor(rdtsc): clean up code overall
Change type of chrono return to be auto

Co-authored-by: Maurice Heumann <MauriceHeumann@gmail.com>

simplify conditional compile and add #else to prevent clang-tidy breaking CI

Co-authored-by: Maurice Heumann <MauriceHeumann@gmail.com>
2025-04-11 06:39:01 +05:30
Soham Nandy
55f29caf0f Revert "refactor: better conditional compilation on time.hpp"
This reverts commit 3bb599d356.
2025-04-11 02:26:28 +05:30
Soham Nandy
3bb599d356 refactor: better conditional compilation on time.hpp 2025-04-11 02:21:22 +05:30
Soham Nandy
0271e39474 refactor(rdtsc): clean up tick logic,
fix intrinsics, and resolve x86 compiler issues

- fix `time.hpp` compiler warnings (errors) and use proper intrinsic for gcc
- simplify tick calculation logic
- fix: exclude intrinsics include for non x86 builds and fix style
- fix: get() on clock_ unique ptr
2025-04-11 01:46:52 +05:30
Soham Nandy
dbc1b4439e feat: spoof rdtsc timings
Previously, RDTSC in the VM always returned a constant value, which broke any non deterministic timing-based operations, or caused detections in heuristics of malware and ANTI-VM tools.

This patch introduces a spoofed rdtsc_fake counter that tracks and adjusts timing deltas to simulate realistic TSC increments. Can be extended to simulate rdtsc timings based on CPU clock speed.
2025-04-10 06:58:01 +05:30
Maurice Heumann
7222c0fc1d Add icicle mmio support 2025-04-01 15:40:53 +02:00
momo5502
7c3f848b36 Support dump generation for GDB mode 2025-03-23 13:17:23 +01:00
momo5502
2bc3cda062 Cleanup snapshot generation 2025-03-23 12:42:42 +01:00
Maurice Heumann
1a640ed6d2 Dump emulation state in analyzer (#168) 2025-03-22 14:13:58 +01:00
momo5502
b83b405309 Support std::byte in zlib 2025-03-22 13:08:54 +01:00
momo5502
456369476a Fix zlib decompression 2025-03-22 13:08:37 +01:00
momo5502
04a4da3188 Support std::byte in I/O util 2025-03-22 13:08:11 +01:00
momo5502
ef8a9dae6e Fix warnings 2025-03-18 20:08:54 +01:00
momo5502
2a9a8eda35 Fix clang-tidy warnings 2025-03-18 19:42:30 +01:00
momo5502
046e01832d Fix clang-tidy warnings 2025-03-18 19:09:21 +01:00
Maurice Heumann
2cc2137c3a Unify steady and system clock 2025-03-18 12:10:59 +01:00
Maurice Heumann
450e3c2a9c Use clock interfaces to precisely control time 2025-03-18 11:48:44 +01:00
Elias Bachaalany
c0719651d3 minor changes 2025-02-11 10:25:02 -08:00
Elias Bachaalany
1d7f841ee4 added more callbacks 2025-02-10 11:25:04 -08:00
Maurice Heumann
2686251fde Cleanup windows-emulator and extract classes 2025-02-10 13:42:49 +01:00
momo5502
063d4590a5 Fix nibble parsing 2025-02-09 10:18:35 +01:00
momo5502
27f02c74c7 Support logging actions for interesting modules 2025-02-09 09:43:19 +01:00
momo5502
edcc090181 Support silencing logging in analyzer 2025-02-08 18:05:47 +01:00
momo5502
d836567db1 Fix PE parsing 2025-01-25 07:24:01 +01:00
momo5502
24bebc4ee2 Prepare filesystem support 2025-01-25 07:24:01 +01:00
Elias Bachaalany
194a0de01e minor 2025-01-23 08:48:51 -08:00
Elias Bachaalany
5703a46e30 fix 2025-01-22 06:07:35 -08:00
Elias Bachaalany
638a720ab8 fixing CI errors 2025-01-22 05:55:46 -08:00
Elias Bachaalany
ebf563e313 fix1 2025-01-21 21:43:42 -08:00
Elias Bachaalany
5bf325c77f some refactoring with optional_function
- wrapped std::function into utils::optional_function
-- cleaned the code accordingly in windows_emulator
- using the 'emulator'/'windows_emulator' dependency implies the emulator_common as well.
2025-01-21 19:25:51 -08:00
momo5502
77b4ee5e1e Properly read and write registers 2025-01-19 10:18:45 +01:00
momo5502
9fc37fa3ef Small cleanup and utils 2025-01-18 19:36:12 +01:00
momo5502
cc252447d5 Multiple fixes 2025-01-18 12:43:55 +01:00
momo5502
5079b750cd Finish implementation 2025-01-18 11:43:54 +01:00
momo5502
b180d9629c Refactor gdb interface 2025-01-17 19:50:06 +01:00
Elias Bachaalany
bfd272e818 removed 'CHUNK' macro from global namespace 2025-01-16 12:10:33 -08:00
robert-yates
c1d7fa7e8b add compression utils 2025-01-15 20:42:02 +01:00
momo5502
b76dc7cf24 Introduce path_key util
It represents a canonical path that can be used as key
for unordered containers
2025-01-13 19:00:01 +01:00
Elias Bachaalany
0459a1d71a fix CI issues 2025-01-12 10:59:23 -08:00
Elias Bachaalany
f1f42b855b refactored into its own files ('time.hpp/.cpp') 2025-01-11 21:51:05 -08:00
Elias Bachaalany
c98260aa04 fixed styles? 2025-01-11 21:35:10 -08:00
Elias Bachaalany
4129725c97 moved some time/sync funcs/consts out from syscall_utils 2025-01-11 21:35:10 -08:00
momo5502
bff8420ffd Format all the code 2025-01-06 17:19:26 +01:00
momo5502
fdb0fafa56 Reformat code + small fixes 2025-01-06 09:36:37 +01:00
momo5502
6b172f5e78 Add macOS support 2025-01-05 17:43:17 +01:00
momo5502
f75f95cc61 Merge remote-tracking branch 'origin/main' into multi-platform-support
# Conflicts:
#	src/analyzer/main.cpp
#	src/emulator/memory_region.hpp
#	src/windows-emulator/io_device.cpp
#	src/windows-emulator/module/module_mapping.cpp
#	src/windows-emulator/process_context.hpp
#	src/windows-emulator/syscalls.cpp
#	src/windows-emulator/windows_emulator.cpp
2025-01-05 14:44:17 +01:00
robert-yates
8e049a2650 migrate to platform structures 2024-12-24 21:08:39 +01:00
momo5502
7633a4bbab Introduce string utils 2024-12-21 11:31:32 +01:00
momo5502
4b9efc825a Extract container utils 2024-11-03 11:21:21 +01:00
momo5502
2938b1bf12 Support fseek/ftell 2024-10-23 06:27:43 +02:00