<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by JackHunter on Medium]]></title>
        <description><![CDATA[Stories by JackHunter on Medium]]></description>
        <link>https://medium.com/@jackSparr0w?source=rss-f3add69e6773------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Y1DsgM9McrnAAFQkwEYKkw.jpeg</url>
            <title>Stories by JackHunter on Medium</title>
            <link>https://medium.com/@jackSparr0w?source=rss-f3add69e6773------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 15:20:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jackSparr0w/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[You Thought Frida Was Stealth When Not Attached? Dirty Pages Beg to Differ]]></title>
            <link>https://medium.com/@jackSparr0w/you-thought-frida-was-stealth-when-not-attached-dirty-pages-beg-to-differ-850329e77fec?source=rss-f3add69e6773------2</link>
            <guid isPermaLink="false">https://medium.com/p/850329e77fec</guid>
            <category><![CDATA[frida-detection]]></category>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[detection-risk]]></category>
            <dc:creator><![CDATA[JackHunter]]></dc:creator>
            <pubDate>Wed, 03 Dec 2025 14:34:50 GMT</pubDate>
            <atom:updated>2025-12-03T14:34:50.856Z</atom:updated>
            <content:encoded><![CDATA[<p>All the classic Frida checks in 2025 — maps, thread names, CRC, ports — are dead. <br>Today I’m dropping the one that still kills 99 % of setups: <strong>Dirty-Page Detection</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fzDqCQWfbvmDmvNa-Alt-g.jpeg" /></figure><p>Key point: <strong>As long as frida-server is running on the device — even if it never attaches to your app — you can detect it globally.</strong></p><h3><strong>Why Dirty-Page Detection Is Almost Unbypassable</strong></h3><p>To listen for zygote forks and signals, frida-server inline-hooks three critical modules inside <strong>system_server</strong>:</p><p>- libc.so<br>- libselinux.so<br>- libandroid_runtime.so</p><p>Inline-hooking the read-only .text section triggers <strong>Copy-On-Write</strong> <br>The original file-backed pages become <strong>private dirty pages </strong><br>Even if Frida later restores the original bytes in the on_leave callback, the pages stay private forever.</p><p>That’s the permanent fingerprint we hunt.</p><h4>Method 1 — smaps</h4><p>Sample code is used to demonstrate the thought process.</p><blockquote>import re</blockquote><blockquote>def frida_detected_smaps():<br> targets = [‘libc.so’, ‘libselinux.so’, ‘libandroid_runtime.so’]<br> with open(‘/proc/self/smaps’, ‘r’) as f:<br> smaps = f.read()</blockquote><blockquote>for lib in targets:<br> # Find the library mapping<br> pos = smaps.find(lib)<br> if pos == -1:<br> continue<br> segment = smaps[pos:pos+800]<br> # Private_Dirty &gt; 0 → COW happened → Frida was here<br> if ‘Private_Dirty:’ in segment:<br> dirty = re.search(r’Private_Dirty:\s+(\d+)’, segment)<br> if dirty and int(dirty.group(1)) &gt; 0:<br> return True<br> return False</blockquote><h4>Method 2 — pagemap (nuclear option, bit 61)</h4><p>Linux pagemap entry (64 bit):bit 63 → page present <br>bit 61 → soft-dirty (set on COW)</p><blockquote>import struct, ctypes</blockquote><blockquote>def page_is_dirty(vaddr):<br> with open(‘/proc/self/pagemap’, ‘rb’) as f:<br> f.seek((vaddr // 4096) * 8)<br> entry = struct.unpack(‘Q’, f.read(8))[0]<br> present = (entry &gt;&gt; 63) &amp; 1<br> soft_dirty = (entry &gt;&gt; 61) &amp; 1 # ← this is the killer bit <br> return present == 1 and soft_dirty == 1</blockquote><blockquote># Example: check fork()<br>libc = ctypes.CDLL(‘libc.so’)<br>fork_addr = ctypes.cast(libc.fork, ctypes.c_void_p).value<br>print(page_is_dirty(fork_addr)) # True → Frida present<br># you can add more function for detection, such as : vfork/opendir/abort/closedir/close/signal/sigaction/exit</blockquote><h3>Bottom LineIn</h3><p>2025, if you’re still checking /proc/self/maps or thread names, you’re fighting 2022 battles.<br>Dirty-page detection is the current meta.</p><p>I’m H.<br>Six years deep in Android reversing.<br>The real game has just started.<br> — H</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=850329e77fec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Worked My Tail Off for Three Months, Only to Be Laid Off During the Probation Period]]></title>
            <link>https://medium.com/@jackSparr0w/i-worked-my-tail-off-for-three-months-only-to-be-laid-off-during-the-probation-period-0d9c2e5456f4?source=rss-f3add69e6773------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d9c2e5456f4</guid>
            <dc:creator><![CDATA[JackHunter]]></dc:creator>
            <pubDate>Sun, 30 Nov 2025 10:09:43 GMT</pubDate>
            <atom:updated>2025-11-30T10:09:43.680Z</atom:updated>
            <content:encoded><![CDATA[<p>In 2023, I managed to survive three rounds of layoffs at my previous company.</p><p>Each time, a teammate or a colleague from the next cubicle would be called in for a meeting, but I got lucky and stayed.</p><p>I thought if I was just <strong>strong enough</strong>, I could keep dodging them forever. Later, I jumped ship to a gaming company.</p><p>Although I had zero prior experience in game reverse engineering, I quickly picked up the necessary skills.</p><p>I independently analyzed three games and completed all the tasks assigned to me, including:</p><ul><li>Protocol data packet encapsulation and decryption/encryption process recovery;</li><li>Reversing a modified <strong>protobuf-like protocol</strong> to analyze its serialization and deserialization methods;</li><li>Writing <strong>Lua VM trace scripts</strong> to aid in Lua call analysis.</li></ul><p>One particularly interesting finding was a <strong>modified AES-CBC encryption</strong>. The modification wasn’t in the encryption algorithm itself, but in the <strong>Cipher Block Chaining (CBC) mode</strong>. Unlike the traditional CBC mode, after the standard AES block encryption, the resulting ciphertext block was subjected to an <strong>additional XOR operation</strong>. Consequently, even with the correct key and Initialization Vector (IV), one couldn’t use standard AES-CBC to decrypt the messages. An extra step of XORing the final ciphertext was required before the AES decryption process.</p><p>But exactly on the <strong>90th day</strong>, HR called me into a small room and said: “Sorry, you haven’t met our expectations. We won’t be converting you to a full-time employee.”</p><p>I was stunned. I had never experienced anything like this, and I never thought it would happen to me. After successfully avoiding layoffs at my previous company, I didn’t even make it past probation this time.</p><p>Failing the probation period was a huge blow, shaking my confidence in my technical abilities. Although I know that the failure wasn’t due to my performance — it was the company’s reason (the entire team was dismantled later) — the bottom line is: I failed probation.</p><p>I’m not the type who burns the midnight oil to obsessively study tech, but I have always been diligently putting in the effort. This sudden layoff made me realize that even if you work hard, it’s not guaranteed that you’ll win.</p><p>That lay-off cut me deep, making me <strong>taste the bitterness of “effort might be in vain” for the first time</strong>.</p><p>Before this, I lived in a small world where “effort $\approx$ success”:</p><ul><li>Working hard in a poor family to get into a top high school.</li><li>Studying intensely in high school to get into a top-tier university for my “hacker dream.”</li><li>Starting self-learning reverse engineering in my freshman year of university and landing an internship.</li><li>Surviving all three rounds of layoffs during the pandemic.</li></ul><p>These relatively “smooth” experiences led to a <strong>dangerous belief</strong> in my subconscious: “As long as I work hard, I will never lose.” This belief made me incredibly confident, yet also incredibly vulnerable.</p><p>Until this layoff: I worked hard, I prepared, and I even pre-emptively jumped ship to try and escape the layoff storm, yet I was still laid off.</p><p>For the first time, the world told me: effort might not be enough. This instantly transformed me from a “Believer in Effort” into a “Skeptic of Effort.”</p><p>After the layoff, I continued to delve into technology, carrying that skepticism with me. Three months later, I successfully secured an offer from another, better, and bigger company.</p><p>But that knife-cut of being laid off has stayed in my heart, a fear of “discovering once again that effort is actually useless.”</p><p>Only today do I truly understand.</p><p>There is nothing wrong with effort itself. <strong>You can’t validate your effort only when you succeed, but negate it when you fail.</strong></p><p>It’s like the saying: “You can’t love your country only when you win.”</p><p>I think this is the source of internal friction and self-criticism. The effort hasn’t changed; the outcome is not solely determined by your effort, but also by good luck, bad luck, and the macro-environment.</p><p>I always harbored a sense of <strong>“unfairness.”</strong> I attributed success to “<strong>luck + effort</strong>” but was unwilling to attribute failure to “<strong>luck + effort</strong>.” I only accepted “<strong>good luck, I won</strong>,” but couldn’t stomach the idea that “<strong>bad luck, I lost</strong>.”</p><p>Now, I’ve broken through that mindset. By writing down this experience and my emotional journey, I want to tell anyone out there who is still afraid of “failure” or “being laid off”:</p><p>Even though this “knife of fear of failure and being laid off” hasn’t been pulled out of my heart — because I might still be laid off in the future, and anxiety will persist — it’s okay. Everyone will fail at some point. The important thing is to have the courage to <strong>accept the failure</strong>, not just the success, and not to deny yourself the moment you stumble.</p><p>Even if you fail and fall, you can still continue moving forward while savoring the “taste of defeat.”</p><blockquote><em>“If I lose, I lose. But if I can go the distance, and that bell rings and I’m still standin’, I’m gonna know for the first time in my life, see, that I wasn’t just another bum.” — </em>Rocky</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*JFmNfq2YHBMucITCYhjLSA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d9c2e5456f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android native string deobfuscation]]></title>
            <link>https://medium.com/@jackSparr0w/android-native-string-deobfuscation-3d21c5a9df5d?source=rss-f3add69e6773------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d21c5a9df5d</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[android-reversing]]></category>
            <category><![CDATA[idapro]]></category>
            <dc:creator><![CDATA[JackHunter]]></dc:creator>
            <pubDate>Sat, 05 Jul 2025 11:12:51 GMT</pubDate>
            <atom:updated>2025-07-05T11:12:51.080Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Background</strong></h3><p>With the continuous escalation of security countermeasures, it is common to encounter encrypted strings in target `.so` files during native reverse engineering. Since strings are crucial for locating key code, decrypting and restoring these encrypted strings becomes essential. This article introduces several common methods for cracking string encryption and explains them with practical examples.</p><h3>Tracing All Returned Strings</h3><p><strong>Concept</strong>:<br>Some string obfuscation schemes decrypt strings at runtime and return the decrypted strings as C pointers to the caller. However, locating these decryption functions can be challenging. Using Frida, we can hook all functions in the module and attempt to output results with `readCString()` when the functions return.</p><p><strong>Advantages</strong>:</p><ul><li>If lucky, sensitive key strings can be directly observed, allowing quick identification of critical functions.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>May cause the app to crash, making the tracing process unstable.</li><li>Produces a large amount of output data, making it difficult to filter useful information.</li></ul><p><strong>Steps</strong>:</p><p>1. Run the script `toolchain_collect_ret_insn.py`.<br> <br>- Select “Yes” to generate a hook script for all return instructions in the IDB directory.<br>- Select “No” to generate a hook script only for exported functions’ return instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJRw8P0zav3WoJWfG4YRZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*2cWIboUyZalFgS1vIHNIaQ.png" /></figure><p>2. Make minor adjustments to the generated script and use it.</p><p>Example Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*QFrf2HENbMKYmgbK2E472w.png" /></figure><h3>Identifying Frequently Called Functions</h3><p><strong>Concept</strong>:<br>Some string obfuscation schemes frequently call fixed string decryption functions at runtime. Since a single `.so` file typically contains hundreds or thousands of strings, these decryption functions are often called far more frequently than regular functions. By analyzing the cross-references of all functions and sorting them in descending order, these string decryption functions can be quickly identified. This method can also be used to locate string constructors, serving as key points for deobfuscation.</p><p><strong>Advantages</strong>:</p><ul><li>High stability, requiring hooks for only a few functions.</li><li>Minimal interference data.</li><li>Suitable for both heap-based and stack-based string encryption schemes.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Requires manual inspection to locate string decryption functions.</li></ul><p><strong>Steps</strong>:</p><p>1. Run the script `top_xrefs.py` and input the number of functions (N) with the highest reference counts to view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*lfQzhdTfnvvT0hfMLt76Kw.png" /></figure><p>2. Example Results:<br> <br>xxard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMnnI66JadYtmilnjrL2tg.png" /></figure><p>String decryption implementation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DHAwNFuEew-8S85K1fKNug.png" /></figure><p><strong>xxsec</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pkmqca4X_npmSesEgmKiQ.png" /></figure><p>xxny:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pSpn4fqa0HPqgNrB6eMCdA.png" /></figure><h3>Tracing JNI String-Related Functions</h3><p><strong>Concept</strong>:<br>When strings are passed between Java and native layers as parameters or return values, JNI functions such as `NewString`, `NewStringUTF`, and `GetStringUTFChars` are typically called. By hooking these interfaces, we can trace the strings.</p><p><strong>Advantages</strong>:</p><ul><li>Produces minimal irrelevant data.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Limited output data, making it difficult to locate key functions.</li></ul><p><strong>Implementation</strong>:</p><ol><li>Use the open-source project <a href="https://github.com/deathmemory/FridaContainer">FridaContainer </a>by deathmemory for JNI tracing:</li></ol><blockquote>FCAnd.jni.hookJNI(‘NewString’, {<br> <br> onEnter: function (args) {<br> <br> try {<br> <br> var str = args[1].readCString();<br> <br> console.log(‘NewString ‘ + ‘ str: ‘ + str);<br> <br> } catch (error) {}<br> <br> }<br> <br> });<br> <br> FCAnd.jni.hookJNI(‘NewStringUTF’, {<br> <br> onEnter: function (args) {<br> <br> try {<br> <br> var str = args[1].readCString();<br> <br> console.log(‘NewStringUTF ‘ + ‘ str: ‘ + str);<br> <br> } catch (error) {}<br> <br> }<br> <br> });<br> <br> FCAnd.jni.hookJNI(‘GetStringUTFChars’, {<br> <br> onLeave: function (retval) {<br> <br> try {<br> <br> var str = retval.readCString();<br> <br> console.log(‘GetStringUTFChars ‘ + ‘ str: ‘ + str);<br> <br> } catch (error) {}<br> <br> }<br> <br> });</blockquote><p>2. Alternatively, use the open-source project <a href="https://github.com/w296488320/JnitraceForCpp">JnitraceForCpp</a> by zhenxi.</p><h3>Memory Dump</h3><p><strong>Concept</strong>:<br>Some `.so` files use open-source OLLVM for string encryption, where strings are decrypted back into the `.data` section during the `init` function. Using Frida dump tools, decrypted strings can be directly extracted from memory.</p><p><strong>Advantages</strong>:</p><ul><li>Highly effective for encryption schemes that refill decrypted strings into the `.data` section.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Ineffective for heap- or stack-based string encryption.</li></ul><p><strong>Steps</strong>:</p><p>1. Launch the app and trigger critical logic to ensure the target module is loaded into memory.<br> <br>2. Use Frida dump tools to extract the decrypted `.so` file from memory.<br> <br>3. Copy the script `fix_convey_str_list.py` to the IDA plugin directory and restart IDA to activate it.<br> <br>4. Load the dumped `.so` file in IDA and use the plugin to export the parsed string list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*BXeu4WtEDX9wdIFlQkajog.png" /></figure><p>5. Re-import the exported string list into the original (non-dumped) `.so` file for analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*unROYJruqQ51znpS4CR7Gg.png" /></figure><h3>Memory Scanning</h3><p><strong>Concept</strong>:<br>For heap-based string encryption schemes, decrypted strings are dynamically allocated in memory, and their pointers are stored in global variables. By writing IDA scripts to scan the `.data` and `.bss` sections, string pointers can be identified, and decrypted strings can be output.</p><p><strong>Advantages</strong>:</p><ul><li>Highly effective for dynamically allocated memory-based string encryption schemes.</li></ul><p><strong>Disadvantages</strong>:</p><ul><li>Ineffective for stack-based string encryption.</li></ul><p><strong>Steps</strong>:</p><p>1. Use the script `toolchain_trace_dyn_dec_str.py` to generate a Frida JavaScript script and modify the module name in `Module.findBaseAddress`.<br> <br>2. Launch the app, trigger critical logic, and wait for string decryption to complete before dumping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*rWEDYwOhTzYNKeGQlFYssQ.png" /></figure><p>3. Save the dumped string information to a file and use the IDA script `toolchain_trace_dyn_dec_str.py` to supplement the information back into the IDB file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*72pODYE0tU4MskXj5FOUuQ.png" /></figure><p>4. For `.bss` section addresses without allocated space in the file, set breakpoints at the corresponding addresses and add comments. This allows easy string lookup through the breakpoint window (`Ctrl+ALT+B`).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TizNdd9kBWy5JjVi1bXEIg.png" /></figure><p>5. View string annotations in the assembly window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-JB4ucUg7DWv984S6AW7ug.png" /></figure><h3>Conclusion</h3><p>This article focuses on reverse engineering techniques for cracking native-layer string encryption. It provides detailed explanations of various strategies, including tracing returned strings, identifying frequently called functions, JNI string tracing, memory dumps, and memory scanning. These methods effectively address different types of string encryption schemes, offering strong support for reverse analysis. It is hoped that this article will inspire and assist readers in their practical work.</p><p>Code repository： <a href="https://github.com/imb4dm4n/Deadly-3000">https://github.com/imb4dm4n/Deadly-3000</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*20XH-YYrbFx94uYqg7gY8w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d21c5a9df5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>