Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Stealth Inline Hook Detection via LR Return Address

1. Background: Why Traditional Inline Hook Detection Fails Inline hook detection on Android commonly relies on: CRC or code hash verification Comparing function prologue bytes (e.g., detecting LDR/BR trampolines) However, these…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




1. Background: Why Traditional Inline Hook Detection Fails



Inline hook detection on Android commonly relies on:




  1. CRC or code hash verification


  2. Comparing function prologue bytes (e.g., detecting LDR/BR trampolines)




However, these methods have major weaknesses:




  • They read code pages, which makes them easily traceable with memory breakpoints.


  • Attackers can hook the detection function itself.


  • Their “signatures” are well known and easy to bypass.




Thus they are visible and high-risk in real offensive–defensive scenarios.









2. Core Idea: Detecting Hooks via the LR (Return Address)



This article introduces a stealth and cross-platform method that doesn't read any instructions, doesn't scan memory, and is extremely difficult for Frida to bypass.






✔ Why LR works



Inline hook frameworks (Frida, Dobby, xhook, etc.) must:




  • overwrite the LR register


  • redirect RET to a trampoline stored in a custom allocated memory page (not inside the original module)




Thus:






If a function’s LR is outside its module’s memory range → it is inline-hooked.



This approach:




  • Does not read .text code section


  • Cannot be traced via hardware breakpoints


  • Works on ARM64 and x86_64










3. Detection Pipeline






Step 1 — Retrieve current module range






static uint64_t g_begin = 0;
static uint64_t g_end = 0;

__attribute__((constructor))
static void init_module_range() {
Dl_info info;
if (dladdr((void*)init_module_range, &info)) {
g_begin = (uint64_t)info.dli_fbase;
g_end = g_begin + get_module_size(info.dli_fname);
}
}









Step 2 — Read LR via ARM64 inline assembly






__attribute__((alwaysinline))
uint64_t get_lr() {
uint64_t lr;
asm volatile(
"mov x10, x29 \n"
"ldr %0, [x10, #8]\n"
: "=r"(lr)
:
: "x10"
);
return lr;
}









Step 3 — Detect inline hook






void check_inline_hook() {
uint64_t lr = get_lr();

if (lr < g_begin || lr > g_end) {
LOGD("[!] Inline-hook detected. lr = %llx", lr);
} else {
LOGD("[+] Function not hooked.");
}
}












4. Advanced Protection: Stack Corruption & Anti-Analysis



To make debugging nearly impossible:




  1. detect hook


  2. overwrite stack (FP → FP+2048)


  3. jump to an invalid address





void anti_debug_crash() {
uint64_t fp;
asm volatile("mov %0, x29" : "=r"(fp));

memset((void*)fp, 0xCC, 2048);
((void(*)())0x12345678)();
}






This destroys stack traces and prevents reverse engineering of your protection logic.






5. Conclusion



This LR-based inline hook detection method:




  • does not read code pages


  • is nearly breakpoint-proof


  • detects Frida, Dobby, xhook, and other trampoline mechanisms


  • works on Android and Windows




It offers a new direction for mobile security, anti-cheat systems, and runtime protection.



I’m H.

Six years deep in Android reversing.

Is this sword sharp today?

— H



Image description784

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Stealth Inline Hook Detection via LR Return Address

Thematisch verwandte Begriffe: Stealth, Inline, Hook, Detection · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94097 | A vulnerability was determined in Netcore NBR200V2 1.3.241127.071246. Th…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick