{"id":23952,"date":"2009-11-27T00:02:16","date_gmt":"2009-11-27T00:02:16","guid":{"rendered":"https:\/\/scannn.com\/patchrequest-busywork-sleep-replacement-that-executes-real-varied-work-to-break-behavioral-pattern-matching-by-edr-and-anti-cheat-systems-%c2%b7-github\/"},"modified":"2009-11-27T00:02:16","modified_gmt":"2009-11-27T00:02:16","slug":"patchrequest-busywork-sleep-replacement-that-executes-real-varied-work-to-break-behavioral-pattern-matching-by-edr-and-anti-cheat-systems-%c2%b7-github","status":"publish","type":"post","link":"https:\/\/scannn.com\/lv\/patchrequest-busywork-sleep-replacement-that-executes-real-varied-work-to-break-behavioral-pattern-matching-by-edr-and-anti-cheat-systems-%c2%b7-github\/","title":{"rendered":"PatchRequest\/BusyWork: Sleep replacement that executes real, varied work to break behavioral pattern matching by EDR and anti-cheat systems \u00b7 GitHub"},"content":{"rendered":"\n<div id=\"\">\n<p dir=\"auto\">A Rust library that replaces <code>sleep()<\/code> with real, varied work to <strong>evade behavioral pattern matching<\/strong> by EDR, anti-cheat, and dynamic analysis systems.<\/p>\n<p dir=\"auto\">Every call executes a <strong>completely different code path<\/strong> \u2014 random category, random task, random iteration counts. No two calls produce the same syscall sequence, instruction trace, or API call pattern.<\/p>\n<p dir=\"auto\"><code>sleep()<\/code> is one of the most commonly hooked and monitored functions. EDR and anti-cheat systems flag predictable idle-then-act patterns as suspicious. Even if <code>sleep()<\/code> itself isn&#8217;t hooked, the behavioral signature of &#8220;do X, idle N ms, do X again&#8221; is trivial to fingerprint.<\/p>\n<p dir=\"auto\">BusyWork fills those gaps with <strong>genuine, varied activity<\/strong> \u2014 real syscalls, real computations, real I\/O \u2014 that looks like normal application behavior under dynamic analysis. The execution profile changes on every call, defeating both signature-based and heuristic-based detection.<\/p>\n<p dir=\"auto\"><strong>Zero time objects<\/strong> in the library binary. No <code>Duration<\/code>, no <code>Instant<\/code>, no <code>SystemTime<\/code>. Nothing for static analysis to latch onto as a timing mechanism.<\/p>\n<p dir=\"auto\">Add to your <code>Cargo.toml<\/code>:<\/p>\n<div class=\"highlight highlight-source-toml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[dependencies]&#10;busywork = &quot;0.1&quot;\">\n<pre>[<span class=\"pl-en\">dependencies<\/span>]\n<span class=\"pl-smi\">busywork<\/span> = <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>0.1<span class=\"pl-pds\">\"<\/span><\/span><\/pre>\n<\/div>\n<p dir=\"auto\">Or with only specific categories (faster compile, smaller binary):<\/p>\n<div class=\"highlight highlight-source-toml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[dependencies]&#10;busywork = { version = &quot;0.1&quot;, default-features = false, features = [&quot;cat-compute&quot;, &quot;cat-memory&quot;, &quot;cat-winapi&quot;] }\">\n<pre>[<span class=\"pl-en\">dependencies<\/span>]\n<span class=\"pl-smi\">busywork<\/span> = { <span class=\"pl-smi\">version<\/span> = <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>0.1<span class=\"pl-pds\">\"<\/span><\/span>, <span class=\"pl-smi\">default-features<\/span> = <span class=\"pl-c1\">false<\/span>, <span class=\"pl-smi\">features<\/span> = [<span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>cat-compute<span class=\"pl-pds\">\"<\/span><\/span>, <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>cat-memory<span class=\"pl-pds\">\"<\/span><\/span>, <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>cat-winapi<span class=\"pl-pds\">\"<\/span><\/span>] }<\/pre>\n<\/div>\n<div class=\"highlight highlight-source-rust notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"use busywork::{busywork, busywork_with, BusyWork, Categories, Intensity};&#10;&#10;\/\/ Simple \u2014 random tasks across all categories&#10;busywork(Intensity::Medium);&#10;&#10;\/\/ Pick specific categories&#10;busywork_with(Intensity::High, Categories::COMPUTE | Categories::WINAPI);&#10;&#10;\/\/ Builder for full control&#10;BusyWork::new(Intensity::Ultra)&#10;    .allow(Categories::COMPUTE | Categories::FILESYSTEM)&#10;    .deny(Categories::NETWORK)&#10;    .jitter(true)&#10;    .run();\">\n<pre><span class=\"pl-k\">use<\/span> busywork<span class=\"pl-kos\">::<\/span><span class=\"pl-kos\">{<\/span>busywork<span class=\"pl-kos\">,<\/span> busywork_with<span class=\"pl-kos\">,<\/span> <span class=\"pl-v\">BusyWork<\/span><span class=\"pl-kos\">,<\/span> <span class=\"pl-v\">Categories<\/span><span class=\"pl-kos\">,<\/span> <span class=\"pl-v\">Intensity<\/span><span class=\"pl-kos\">}<\/span><span class=\"pl-kos\">;<\/span>\n\n<span class=\"pl-c\">\/\/ Simple \u2014 random tasks across all categories<\/span>\n<span class=\"pl-en\">busywork<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Intensity<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">Medium<\/span><span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span>\n\n<span class=\"pl-c\">\/\/ Pick specific categories<\/span>\n<span class=\"pl-en\">busywork_with<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Intensity<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">High<\/span><span class=\"pl-kos\">,<\/span> <span class=\"pl-smi\">Categories<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">COMPUTE<\/span> | <span class=\"pl-smi\">Categories<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">WINAPI<\/span><span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span>\n\n<span class=\"pl-c\">\/\/ Builder for full control<\/span>\n<span class=\"pl-smi\">BusyWork<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-en\">new<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Intensity<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">Ultra<\/span><span class=\"pl-kos\">)<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">allow<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Categories<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">COMPUTE<\/span> | <span class=\"pl-smi\">Categories<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">FILESYSTEM<\/span><span class=\"pl-kos\">)<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">deny<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Categories<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">NETWORK<\/span><span class=\"pl-kos\">)<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">jitter<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-c1\">true<\/span><span class=\"pl-kos\">)<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">run<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span><\/pre>\n<\/div>\n<p dir=\"auto\">Busywork blocks can blend into surrounding code by processing <strong>your variables<\/strong>. Feed any data from the current scope \u2014 tasks will weave it into their control flow (hashing it, sorting it, using it as loop bounds), making the block indistinguishable from real data processing to static or dynamic analysis.<\/p>\n<p dir=\"auto\">All data is <strong>cloned on feed<\/strong> \u2014 originals are never modified.<\/p>\n<div class=\"highlight highlight-source-rust notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"let session_id: u64 = 0xDEADBEEF;&#10;let payload = vec![0x41u8; 1024];&#10;let user_name = &quot;admin&quot;;&#10;let packet_count: u32 = 147;&#10;&#10;BusyWork::new(Intensity::Medium)&#10;    .allow(Categories::COMPUTE | Categories::MEMORY)&#10;    .feed(&amp;session_id)      \/\/ integers, floats, bools&#10;    .feed(&amp;payload)          \/\/ Vec&lt;u8&gt;, &amp;[u8], [u8; N]&#10;    .feed(user_name)         \/\/ &amp;str, String&#10;    .feed(&amp;packet_count)     \/\/ unlimited parameters&#10;    .run();\">\n<pre><span class=\"pl-k\">let<\/span> session_id<span class=\"pl-kos\">:<\/span> <span class=\"pl-smi\">u64<\/span> = <span class=\"pl-c1\">0xDEADBEEF<\/span><span class=\"pl-kos\">;<\/span>\n<span class=\"pl-k\">let<\/span> payload = <span class=\"pl-en\">vec<\/span><span class=\"pl-en\">!<\/span><span class=\"pl-kos\">[<\/span><span class=\"pl-c1\">0x41u8<\/span><span class=\"pl-kos\">;<\/span> <span class=\"pl-c1\">1024<\/span><span class=\"pl-kos\">]<\/span><span class=\"pl-kos\">;<\/span>\n<span class=\"pl-k\">let<\/span> user_name = <span class=\"pl-s\">\"admin\"<\/span><span class=\"pl-kos\">;<\/span>\n<span class=\"pl-k\">let<\/span> packet_count<span class=\"pl-kos\">:<\/span> <span class=\"pl-smi\">u32<\/span> = <span class=\"pl-c1\">147<\/span><span class=\"pl-kos\">;<\/span>\n\n<span class=\"pl-smi\">BusyWork<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-en\">new<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Intensity<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">Medium<\/span><span class=\"pl-kos\">)<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">allow<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Categories<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">COMPUTE<\/span> | <span class=\"pl-smi\">Categories<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">MEMORY<\/span><span class=\"pl-kos\">)<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">feed<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-c1\">&amp;<\/span>session_id<span class=\"pl-kos\">)<\/span>      <span class=\"pl-c\">\/\/ integers, floats, bools<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">feed<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-c1\">&amp;<\/span>payload<span class=\"pl-kos\">)<\/span>          <span class=\"pl-c\">\/\/ Vec&lt;u8&gt;, &amp;[u8], [u8; N]<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">feed<\/span><span class=\"pl-kos\">(<\/span>user_name<span class=\"pl-kos\">)<\/span>         <span class=\"pl-c\">\/\/ &amp;str, String<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">feed<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-c1\">&amp;<\/span>packet_count<span class=\"pl-kos\">)<\/span>     <span class=\"pl-c\">\/\/ unlimited parameters<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">run<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span><\/pre>\n<\/div>\n<p dir=\"auto\">Without <code>.feed()<\/code>, tasks generate random input data \u2014 detectable as isolated noise blocks with no data dependency on the surrounding program. With <code>.feed()<\/code>, the busywork reads and processes the same variables as your real code. A data-flow analyzer cannot determine which computations are &#8220;real&#8221; and which are busywork.<\/p>\n<p dir=\"auto\"><strong>Works with custom types<\/strong> \u2014 implement <code>FeedWork<\/code> for your own structs:<\/p>\n<div class=\"highlight highlight-source-rust notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"use busywork::FeedWork;&#10;&#10;struct GameState { x: f32, y: f32, hp: u32 }&#10;&#10;impl FeedWork for GameState {&#10;    fn write_work_bytes(&amp;self, out: &amp;mut Vec&lt;u8&gt;) {&#10;        self.x.write_work_bytes(out);&#10;        self.y.write_work_bytes(out);&#10;        self.hp.write_work_bytes(out);&#10;    }&#10;}&#10;&#10;BusyWork::new(Intensity::Low)&#10;    .feed(&amp;game_state)&#10;    .run();\">\n<pre><span class=\"pl-k\">use<\/span> busywork<span class=\"pl-kos\">::<\/span><span class=\"pl-v\">FeedWork<\/span><span class=\"pl-kos\">;<\/span>\n\n<span class=\"pl-k\">struct<\/span> <span class=\"pl-smi\">GameState<\/span> <span class=\"pl-kos\">{<\/span> <span class=\"pl-c1\">x<\/span><span class=\"pl-kos\">:<\/span> <span class=\"pl-smi\">f32<\/span><span class=\"pl-kos\">,<\/span> <span class=\"pl-c1\">y<\/span><span class=\"pl-kos\">:<\/span> <span class=\"pl-smi\">f32<\/span><span class=\"pl-kos\">,<\/span> <span class=\"pl-c1\">hp<\/span><span class=\"pl-kos\">:<\/span> <span class=\"pl-smi\">u32<\/span> <span class=\"pl-kos\">}<\/span>\n\n<span class=\"pl-k\">impl<\/span> <span class=\"pl-smi\">FeedWork<\/span> <span class=\"pl-k\">for<\/span> <span class=\"pl-smi\">GameState<\/span> <span class=\"pl-kos\">{<\/span>\n    <span class=\"pl-k\">fn<\/span> <span class=\"pl-en\">write_work_bytes<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-c1\">&amp;<\/span><span class=\"pl-smi\">self<\/span><span class=\"pl-kos\">,<\/span> <span class=\"pl-s1\">out<\/span><span class=\"pl-kos\">:<\/span> <span class=\"pl-c1\">&amp;<\/span><span class=\"pl-k\">mut<\/span> <span class=\"pl-smi\">Vec<\/span><span class=\"pl-kos\">&lt;<\/span><span class=\"pl-smi\">u8<\/span><span class=\"pl-kos\">&gt;<\/span><span class=\"pl-kos\">)<\/span> <span class=\"pl-kos\">{<\/span>\n        <span class=\"pl-smi\">self<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-c1\">x<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-en\">write_work_bytes<\/span><span class=\"pl-kos\">(<\/span>out<span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span>\n        <span class=\"pl-smi\">self<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-c1\">y<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-en\">write_work_bytes<\/span><span class=\"pl-kos\">(<\/span>out<span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span>\n        <span class=\"pl-smi\">self<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-c1\">hp<\/span><span class=\"pl-kos\">.<\/span><span class=\"pl-en\">write_work_bytes<\/span><span class=\"pl-kos\">(<\/span>out<span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span>\n    <span class=\"pl-kos\">}<\/span>\n<span class=\"pl-kos\">}<\/span>\n\n<span class=\"pl-smi\">BusyWork<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-en\">new<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Intensity<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">Low<\/span><span class=\"pl-kos\">)<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">feed<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-c1\">&amp;<\/span>game_state<span class=\"pl-kos\">)<\/span>\n    <span class=\"pl-kos\">.<\/span><span class=\"pl-en\">run<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span><\/pre>\n<\/div>\n<p dir=\"auto\">Every <code>run()<\/code> call maintains a <strong>256-byte scratch buffer<\/strong> that flows through all tasks sequentially. Each task reads from the scratch buffer (blending it into its computation) and writes its results back. Task N&#8217;s SHA-256 output becomes part of task N+1&#8217;s sort input, which feeds task N+2&#8217;s compression.<\/p>\n<p dir=\"auto\">This creates a <strong>data-dependency chain<\/strong> across the entire execution \u2014 an analyzer cannot isolate individual tasks as independent noise blocks, because each task&#8217;s behavior genuinely depends on what came before it.<\/p>\n<div class=\"highlight highlight-source-rust notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"loop {&#10;    do_real_work();&#10;    busywork(Intensity::Medium); \/\/ different execution path every time&#10;}\">\n<pre><span class=\"pl-k\">loop<\/span> <span class=\"pl-kos\">{<\/span>\n    <span class=\"pl-en\">do_real_work<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span>\n    <span class=\"pl-en\">busywork<\/span><span class=\"pl-kos\">(<\/span><span class=\"pl-smi\">Intensity<\/span><span class=\"pl-kos\">::<\/span><span class=\"pl-v\">Medium<\/span><span class=\"pl-kos\">)<\/span><span class=\"pl-kos\">;<\/span> <span class=\"pl-c\">\/\/ different execution path every time<\/span>\n<span class=\"pl-kos\">}<\/span><\/pre>\n<\/div>\n<p dir=\"auto\">No timers \u2014 just work volume:<\/p>\n<p><markdown-accessiblity-table><\/p>\n<table>\n<thead>\n<tr>\n<th>Level<\/th>\n<th>Tasks\/call<\/th>\n<th>Iterations<\/th>\n<th>Buffer size<\/th>\n<th>Call depth<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>Low<\/code><\/td>\n<td>2<\/td>\n<td>50<\/td>\n<td>1 KB<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td><code>Medium<\/code><\/td>\n<td>5<\/td>\n<td>500<\/td>\n<td>16 KB<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td><code>High<\/code><\/td>\n<td>10<\/td>\n<td>5,000<\/td>\n<td>256 KB<\/td>\n<td>8<\/td>\n<\/tr>\n<tr>\n<td><code>Ultra<\/code><\/td>\n<td>20<\/td>\n<td>50,000<\/td>\n<td>1 MB<\/td>\n<td>16<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/markdown-accessiblity-table><\/p>\n<p dir=\"auto\">Jitter (on by default) randomizes all parameters by \u00b130%, so two consecutive calls at the same intensity produce different instruction traces.<\/p>\n<p dir=\"auto\">SHA-256 hash chains, MD5 hash chains, prime sieve (Eratosthenes), matrix multiplication, array sorting, deflate compress\/decompress, Fibonacci sequence, XOR cipher rounds, Collatz conjecture, string operations, bubble sort, bitwise operations, pi approximation (Leibniz), permutation generation (Heap&#8217;s algorithm).<\/p>\n<p dir=\"auto\">Alloc\/touch\/free pages, memcpy chains, sort random data, pattern fill &amp; verify, heap fragmentation (many small allocs), ring buffer simulation, repeated binary search, buffer reversal, buffer interleaving, scatter\/gather access patterns.<\/p>\n<p dir=\"auto\">Enumerate System32, temp dir, Program Files, fonts, drivers, prefetch, logs, user profile. Stat system files &amp; DLLs. Read hosts, services, win.ini, system.ini. All <strong>read-only<\/strong> \u2014 no files created or modified.<\/p>\n<p dir=\"auto\">Read installed software, system info (ProductName, CurrentBuild), services, timezone, environment variables, network config (TCP\/IP parameters), CPU hardware info, font list, startup programs (Run keys), file associations (HKCR). All <strong>KEY_READ<\/strong> \u2014 no writes.<\/p>\n<p dir=\"auto\">Enumerate windows (EnumWindows + GetWindowTextW), enumerate processes (ToolHelp32 snapshot), system info (GetSystemInfo, GlobalMemoryStatusEx), clipboard read, system metrics (10 indices), foreground window, cursor position, desktop window, logical drives + drive types, volume info, disk free space, FindFirstFile\/FindNextFile, module handles (12 DLLs), VirtualQuery memory walk, system\/Windows directories, process\/thread IDs.<\/p>\n<p dir=\"auto\">DNS lookups (24 hosts), HTTP GET (11 endpoints), NTP queries (7 servers), HTTP HEAD requests, TCP connect probes (10 host:port targets), DNS with varied ports, HTTP POST\/PUT to echo endpoints. Socket timeouts via raw <code>setsockopt<\/code> \u2014 no <code>Duration<\/code> type.<\/p>\n<p dir=\"auto\">BCryptGenRandom (system CSPRNG), BCrypt SHA-256 hashing, BCrypt SHA-512, BCrypt MD5, BCrypt SHA-1, AES-256 symmetric encrypt, RNG algorithm providers (RNG, FIPS186DSARNG, DUALECRNG).<\/p>\n<p dir=\"auto\">WMI queries via COM automation: Win32_Process (process enumeration), Win32_OperatingSystem (OS info), Win32_ComputerSystem (computer\/domain info), Win32_NetworkAdapterConfiguration (network adapters), Win32_LogicalDisk (disk info), Win32_Service (services), Win32_BIOS (BIOS info), Win32_Processor (CPU info). All <strong>read-only<\/strong> WQL SELECT queries.<\/p>\n<p dir=\"auto\">Measured on Windows 11, debug build, 5 runs each:<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\">By Intensity (all categories)<\/h3>\n<p><a id=\"user-content-by-intensity-all-categories\" class=\"anchor\" aria-label=\"Permalink: By Intensity (all categories)\" href=\"#by-intensity-all-categories\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\/><\/svg><\/a><\/div>\n<p><markdown-accessiblity-table><\/p>\n<table>\n<thead>\n<tr>\n<th>Level<\/th>\n<th>Min<\/th>\n<th>Avg<\/th>\n<th>Max<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>Low<\/code><\/td>\n<td>0.10 ms<\/td>\n<td>0.19 ms<\/td>\n<td>0.33 ms<\/td>\n<\/tr>\n<tr>\n<td><code>Medium<\/code><\/td>\n<td>3.26 ms<\/td>\n<td>941 ms<\/td>\n<td>3,064 ms<\/td>\n<\/tr>\n<tr>\n<td><code>High<\/code><\/td>\n<td>133 ms<\/td>\n<td>1,855 ms<\/td>\n<td>6,322 ms<\/td>\n<\/tr>\n<tr>\n<td><code>Ultra<\/code><\/td>\n<td>4,439 ms<\/td>\n<td>58,450 ms<\/td>\n<td>176,147 ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/markdown-accessiblity-table><\/p>\n<p dir=\"auto\">The wide min\/max spread is intentional \u2014 each call picks different tasks with different costs.<\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\">By Category (Medium intensity)<\/h3>\n<p><a id=\"user-content-by-category-medium-intensity\" class=\"anchor\" aria-label=\"Permalink: By Category (Medium intensity)\" href=\"#by-category-medium-intensity\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\/><\/svg><\/a><\/div>\n<p><markdown-accessiblity-table><\/p>\n<table>\n<thead>\n<tr>\n<th>Category<\/th>\n<th>Min<\/th>\n<th>Avg<\/th>\n<th>Max<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>COMPUTE<\/td>\n<td>14.69 ms<\/td>\n<td>499 ms<\/td>\n<td>1,256 ms<\/td>\n<\/tr>\n<tr>\n<td>MEMORY<\/td>\n<td>14.93 ms<\/td>\n<td>123 ms<\/td>\n<td>242 ms<\/td>\n<\/tr>\n<tr>\n<td>FILESYSTEM<\/td>\n<td>0.81 ms<\/td>\n<td>21.2 ms<\/td>\n<td>48.0 ms<\/td>\n<\/tr>\n<tr>\n<td>REGISTRY<\/td>\n<td>0.93 ms<\/td>\n<td>4.64 ms<\/td>\n<td>17.8 ms<\/td>\n<\/tr>\n<tr>\n<td>WINAPI<\/td>\n<td>0.28 ms<\/td>\n<td>5.01 ms<\/td>\n<td>19.1 ms<\/td>\n<\/tr>\n<tr>\n<td>NETWORK<\/td>\n<td>1,188 ms<\/td>\n<td>3,350 ms<\/td>\n<td>6,318 ms<\/td>\n<\/tr>\n<tr>\n<td>CRYPTO<\/td>\n<td>5.47 ms<\/td>\n<td>8.77 ms<\/td>\n<td>12.8 ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/markdown-accessiblity-table><\/p>\n<p dir=\"auto\">Each category is a cargo feature, all on by default:<\/p>\n<div class=\"highlight highlight-source-toml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"[dependencies]&#10;busywork = &quot;0.1&quot;&#10;&#10;# Or cherry-pick:&#10;busywork = { version = &quot;0.1&quot;, default-features = false, features = [&quot;cat-compute&quot;, &quot;cat-memory&quot;] }\">\n<pre>[<span class=\"pl-en\">dependencies<\/span>]\n<span class=\"pl-smi\">busywork<\/span> = <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>0.1<span class=\"pl-pds\">\"<\/span><\/span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> Or cherry-pick:<\/span>\n<span class=\"pl-smi\">busywork<\/span> = { <span class=\"pl-smi\">version<\/span> = <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>0.1<span class=\"pl-pds\">\"<\/span><\/span>, <span class=\"pl-smi\">default-features<\/span> = <span class=\"pl-c1\">false<\/span>, <span class=\"pl-smi\">features<\/span> = [<span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>cat-compute<span class=\"pl-pds\">\"<\/span><\/span>, <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>cat-memory<span class=\"pl-pds\">\"<\/span><\/span>] }<\/pre>\n<\/div>\n<p><markdown-accessiblity-table><\/p>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>Dependencies<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>cat-compute<\/code><\/td>\n<td>sha2, md-5, flate2<\/td>\n<td>Pure CPU work<\/td>\n<\/tr>\n<tr>\n<td><code>cat-memory<\/code><\/td>\n<td>\u2014<\/td>\n<td>Allocation patterns<\/td>\n<\/tr>\n<tr>\n<td><code>cat-filesystem<\/code><\/td>\n<td>\u2014<\/td>\n<td>Read-only filesystem I\/O<\/td>\n<\/tr>\n<tr>\n<td><code>cat-registry<\/code><\/td>\n<td>windows<\/td>\n<td>Windows Registry reads<\/td>\n<\/tr>\n<tr>\n<td><code>cat-winapi<\/code><\/td>\n<td>windows<\/td>\n<td>Win32 API calls<\/td>\n<\/tr>\n<tr>\n<td><code>cat-network<\/code><\/td>\n<td>\u2014<\/td>\n<td>DNS, HTTP, NTP<\/td>\n<\/tr>\n<tr>\n<td><code>cat-crypto<\/code><\/td>\n<td>windows<\/td>\n<td>Windows CNG (BCrypt) crypto<\/td>\n<\/tr>\n<tr>\n<td><code>cat-com<\/code><\/td>\n<td>windows<\/td>\n<td>COM\/WMI queries<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/markdown-accessiblity-table><\/p>\n<p dir=\"auto\">Every design decision optimizes for evasion:<\/p>\n<p><markdown-accessiblity-table><\/p>\n<table>\n<thead>\n<tr>\n<th>Technique<\/th>\n<th>What it defeats<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Random task selection per call<\/strong><\/td>\n<td>Behavioral sequence matching \u2014 no two calls produce the same API call order<\/td>\n<\/tr>\n<tr>\n<td><strong>\u00b130% jitter on all parameters<\/strong><\/td>\n<td>Timing heuristics \u2014 iteration counts, buffer sizes, call depths all vary<\/td>\n<\/tr>\n<tr>\n<td><strong>Data flow integration via <code>.feed()<\/code><\/strong><\/td>\n<td>Data-flow analysis \u2014 busywork operates on the same variables as surrounding code, preventing isolation as &#8220;noise blocks&#8221;<\/td>\n<\/tr>\n<tr>\n<td><strong>Inter-task scratch buffer chaining<\/strong><\/td>\n<td>Block isolation analysis \u2014 each task&#8217;s output feeds the next task&#8217;s input, creating a connected data-dependency graph across the entire run<\/td>\n<\/tr>\n<tr>\n<td><strong>Task registry rebuilt per call<\/strong><\/td>\n<td>Static analysis \u2014 no stable global function pointer table to fingerprint<\/td>\n<\/tr>\n<tr>\n<td><strong>Function pointers, not trait objects<\/strong><\/td>\n<td>Vtable signature detection \u2014 each task is a direct call to a unique address<\/td>\n<\/tr>\n<tr>\n<td><strong><code>black_box<\/code> on all results<\/strong><\/td>\n<td>Dead-code elimination \u2014 compiler can&#8217;t optimize away the work<\/td>\n<\/tr>\n<tr>\n<td><strong>No time objects in binary<\/strong><\/td>\n<td>String\/import scanning \u2014 <code>Duration<\/code>, <code>Instant<\/code>, <code>SystemTime<\/code> are absent<\/td>\n<\/tr>\n<tr>\n<td><strong>Real syscalls across categories<\/strong><\/td>\n<td>Syscall sequence analysis \u2014 mixes NtReadFile, NtQueryKey, NtDeviceIoControl, etc.<\/td>\n<\/tr>\n<tr>\n<td><strong>Read-only filesystem\/registry ops<\/strong><\/td>\n<td>Behavioral red flags \u2014 no writes, no creates, no deletes<\/td>\n<\/tr>\n<tr>\n<td><strong>Legitimate API call targets<\/strong><\/td>\n<td>API monitoring \u2014 calls the same APIs that normal applications use<\/td>\n<\/tr>\n<tr>\n<td><strong>COM\/WMI queries<\/strong><\/td>\n<td>Process behavioral profiling \u2014 WMI queries are one of the most common Windows API patterns in legitimate software<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/markdown-accessiblity-table><\/p>\n<div class=\"markdown-heading\" dir=\"auto\">\n<h3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\">What it looks like under analysis<\/h3>\n<p><a id=\"user-content-what-it-looks-like-under-analysis\" class=\"anchor\" aria-label=\"Permalink: What it looks like under analysis\" href=\"#what-it-looks-like-under-analysis\"><svg data-component=\"Octicon\" class=\"octicon octicon-link\" viewbox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\/><\/svg><\/a><\/div>\n<p dir=\"auto\">A process calling <code>busywork(Medium)<\/code> in a loop produces traces like:<\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"Call 1: RegOpenKeyEx \u2192 RegEnumKeyEx \u00d7 3 \u2192 RegCloseKey \u2192 SHA256 \u00d7 200 \u2192 ReadFile(hosts)&#10;Call 2: EnumWindows \u2192 GetWindowText \u00d7 15 \u2192 GlobalMemoryStatusEx \u2192 sort(50KB)&#10;Call 3: connect(httpbin.org:80) \u2192 send(GET) \u2192 recv \u2192 BCryptGenRandom \u00d7 8&#10;Call 4: FindFirstFile(*.dll) \u00d7 40 \u2192 GetVolumeInformation \u2192 memcpy(16KB) \u00d7 300&#10;Call 5: CoCreateInstance(WbemLocator) \u2192 ExecQuery(Win32_Process) \u2192 enumerate \u00d7 50\">\n<pre class=\"notranslate\"><code>Call 1: RegOpenKeyEx \u2192 RegEnumKeyEx \u00d7 3 \u2192 RegCloseKey \u2192 SHA256 \u00d7 200 \u2192 ReadFile(hosts)\nCall 2: EnumWindows \u2192 GetWindowText \u00d7 15 \u2192 GlobalMemoryStatusEx \u2192 sort(50KB)\nCall 3: connect(httpbin.org:80) \u2192 send(GET) \u2192 recv \u2192 BCryptGenRandom \u00d7 8\nCall 4: FindFirstFile(*.dll) \u00d7 40 \u2192 GetVolumeInformation \u2192 memcpy(16KB) \u00d7 300\nCall 5: CoCreateInstance(WbemLocator) \u2192 ExecQuery(Win32_Process) \u2192 enumerate \u00d7 50\n<\/code><\/pre>\n<\/div>\n<p dir=\"auto\">No repeating pattern. Each call exercises different subsystems, different buffer sizes, different iteration counts. To an EDR, it looks like a normal application doing normal things.<\/p>\n<p dir=\"auto\">With <code>.feed()<\/code>, the data flowing through these operations comes from your actual program variables \u2014 hash chains process your session tokens, sorts operate on your counters, crypto operations encrypt your payloads. A taint-tracking analyzer following your variables will see them consumed by what appears to be legitimate processing. The scratch buffer chains these operations together so even cross-task data flow looks organic.<\/p>\n<p dir=\"auto\">185 tests across 5 test suites, verified with full untruncated output:<\/p>\n<p><markdown-accessiblity-table><\/p>\n<table>\n<thead>\n<tr>\n<th>Suite<\/th>\n<th>Tests<\/th>\n<th>What it covers<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>workdata::tests<\/code><\/td>\n<td>52<\/td>\n<td>Every <code>FeedWork<\/code> type, <code>blend_into<\/code> XOR correctness, <code>blend_seed<\/code>\/<code>derive_usize<\/code> determinism, clone independence, empty\/zero edge cases<\/td>\n<\/tr>\n<tr>\n<td><code>tasks::tests<\/code><\/td>\n<td>24<\/td>\n<td>ScratchBuffer mechanics (seed, absorb, chain accumulation). Every registered task function called directly with 14 work-data shapes \u00d7 parameter extremes (zero, min, large) \u2014 1,176 task invocations. Registry completeness (84 tasks across 8 categories, no duplicates)<\/td>\n<\/tr>\n<tr>\n<td><code>tasks::compute::tests<\/code><\/td>\n<td>19<\/td>\n<td>Mirror tests proving work data changes computation: hash inputs differ, fibonacci starting values shift, sieve limits get bias, cipher keys incorporate fed data, distinct inputs produce distinct seeds<\/td>\n<\/tr>\n<tr>\n<td><code>tasks::memory::tests<\/code><\/td>\n<td>9<\/td>\n<td>Mirror tests proving work data flows into memory tasks: buffers modified, patterns XOR&#8217;d, ring buffers seeded, reversibility verified<\/td>\n<\/tr>\n<tr>\n<td>\u2014<\/td>\n<td>\u2014<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td><code>tests\/smoke.rs<\/code><\/td>\n<td>10<\/td>\n<td>Basic API smoke tests, category filtering (including COM), jitter toggle<\/td>\n<\/tr>\n<tr>\n<td><code>tests\/bench.rs<\/code><\/td>\n<td>4<\/td>\n<td>Intensity\/category benchmarks, jitter variance measurement<\/td>\n<\/tr>\n<tr>\n<td><code>tests\/feed.rs<\/code><\/td>\n<td>64<\/td>\n<td>Data isolation (15 types verified untouched after run), per-category with feed (all 8 categories), intensity levels, edge cases (NaN, Unicode, 64KB), builder combinations, type coverage<\/td>\n<\/tr>\n<tr>\n<td><code>tests\/robustness.rs<\/code><\/td>\n<td>23<\/td>\n<td>Stress (500 rapid calls, 10k small feeds, 1MB feed), custom <code>FeedWork<\/code> impl, regression patterns (empty\u2192real, alternating, max values)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/markdown-accessiblity-table><\/p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"cargo test --lib -- --test-threads=1              # 85 unit tests&#10;cargo test --test feed -- --test-threads=1        # 64 integration tests&#10;cargo test --test robustness -- --test-threads=1  # 23 stress\/regression tests&#10;cargo test --test smoke -- --test-threads=1       # 10 smoke tests&#10;cargo test --test bench -- --test-threads=1       # 4 benchmark tests\">\n<pre class=\"notranslate\"><code>cargo test --lib -- --test-threads=1              # 85 unit tests\ncargo test --test feed -- --test-threads=1        # 64 integration tests\ncargo test --test robustness -- --test-threads=1  # 23 stress\/regression tests\ncargo test --test smoke -- --test-threads=1       # 10 smoke tests\ncargo test --test bench -- --test-threads=1       # 4 benchmark tests\n<\/code><\/pre>\n<\/div>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"84 tasks across 8 categories&#10;All 84 tasks actively consume fed work data and participate in scratch buffer chaining&#10;185 tests across unit, integration, stress, mirror, and benchmark suites&#10;0 time objects in the library binary\">\n<pre class=\"notranslate\"><code>84 tasks across 8 categories\nAll 84 tasks actively consume fed work data and participate in scratch buffer chaining\n185 tests across unit, integration, stress, mirror, and benchmark suites\n0 time objects in the library binary\n<\/code><\/pre>\n<\/div>\n<\/div>\n<p><a href=\"https:\/\/github.com\/PatchRequest\/BusyWork?utm_source=tldrinfosec\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Rust library that replaces sleep() with real, varied work to evade behavioral pattern matching by EDR, anti-cheat, and dynamic analysis systems. Every call executes a completely different code path \u2014 random category, random task, random iteration counts. No two calls produce the same syscall sequence, instruction trace, or API call pattern. sleep() is one [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":23953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[],"class_list":["post-23952","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts\/23952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/comments?post=23952"}],"version-history":[{"count":0,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts\/23952\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/media\/23953"}],"wp:attachment":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/media?parent=23952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/categories?post=23952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/tags?post=23952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}