AETERNAE AI RESEARCH LLC INDEPENDENT RESEARCH
ÆAETERNAERESEARCH
Sign inRequest access
← Malware catalog

Attributed metadata history

REPORTPUBLIC METADATA

Reversing embedded WebAssembly: part 3. Recovering native cross-references from WAMR relocations in pure C

﷽ Introduction to Malware Binary Triage (IMBT) Course Looking to level up your skills? Get 10% off using coupon code: MWNEWS10 for any flavor. Enroll Now and Save 10%: Coupon Code MWNEWS10 Note: Affiliate link – your enrollment helps support this platform at no extra cost to you. Hello, cybersecurity enthusiasts and white hackers! In part 2, we joined FUNCTION and EXPORT to recover names for the native functions in a WAMR .aot file. Now we can locate fib. The next question is: where does it reference another function, and which function is that? This time we decode RELOCATION: its symbol table, string buffer, groups, and individual records. Then we connect a patch location to its containing function and resolve targets such as aot_func#2. The result is a native cross-reference: fib -> fib. Still C, still no external libraries. I am giving the Ghidra handoff its own fourth part. The series now has four steps: part result 1 container sections and target architecture 2 function offsets and exported names 3 relocation records and native cross-references 4 bring the code, names, and references into Ghidra For this example I keep the same compiler as before: wamrc 2.4.5, producing AOT format version 5. The parser below deliberately accepts that version and little-endian ELF relocatable targets. The format description follows the release’s AOT emitter. practical example We reuse our small module: // add.c int add(int a, int b) { return a + b; } int fib(int n) { return n < 2 ? n : fib(n - 1) + fib(n - 2); } If you already have add.aot from part 2, keep it. To rebuild it with the wamrc from part 1: ./wamrc --version clang --target=wasm32 -O2 -nostdlib -Wl,--no-entry -Wl,--export-all -o add.wasm add.c ./wamrc -o add.aot add.wasm The listings below use the supplied sample. Rebuilding it here with Clang 19.1.7 and wamrc 2.4.5 produced the same AOT bytes; other compiler versions or options can change the offsets. first, correct the native-code base Before recovering references, there is a correction to part 2. We treated the TEXT section body as the start of native code. In this format the body actually begins with a literal-size field: TEXT body: u32 literal_size u8 literals[literal_size] u8 code[remaining bytes] code_file_offset = TEXT_body_file_offset + 4 + literal_size The release loader’s load_text_section() advances past that prefix before using function offsets. Our sample has literal_size = 0, but the four-byte field is still present. The code begins at 0x154, not 0x150. Consequently, the file offsets printed in part 2 were four bytes early: add starts at 0x164 and fib at 0x174. Also, the distance to the next function offset is a span, which can include alignment padding. For the last function, our upper bound is the remaining code region. We should not call either value an exact machine-code size. the RELOCATION layout Section type 5 has two pieces. First comes a symbol directory: u32 symbol_count u32 symbol_offsets[symbol_count] u32 total_string_len u8 string_buffer[total_string_len] each symbol_offsets[i] points inside string_buffer: u16 length u8 bytes[length] // terminating NUL is included An index selects an entry in symbol_offsets[]; that entry selects a length-prefixed string. It does not point directly into the file. Group names such as .rela.text and target names such as aot_func#2 share this directory. After the string buffer, aligned to four bytes, come the groups: u32 group_count repeat group_count: u32 group_name_index u32 relocation_count repeat relocation_count: word offset word addend u32 relocation_type u32 symbol_index Here word is u64 for a 64-bit target and u32 for a 32-bit target. That choice comes from TARGET_INFO, not the architecture of the computer running unaot. A record therefore occupies 24 or 1

Reference details

Source category
research-report
First reported
Oct 21, 2026 16:46 UTC
Last reported
Oct 21, 2026 16:46 UTC
Catalog updated
Oct 22, 2026 11:21 UTC
Record ID
f368e37b1f326fadbacc92bff965e4eb705134a7f6777d42f3637c97479be852

Published indicators

Network indicators are visibly defanged. This page does not make them clickable or send them to another service.

No validated file hashes or network indicators are stored for this record.

Source observations

intelligence_src_f9879f264b7a8ec1d7

Source-provided label
Publisher RSS metadata
Evidence class
mentioned in report
Confidence
Not reported
Observed
Oct 21, 2026 16:46 UTC
Retrieved
Oct 22, 2026 11:21 UTC

This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.

Feed collection status

Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.

1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.

Review source update dates and status
  • intelligence_src_f9879f264b7a8ec1d7Recent successful batchLast successful batch: Last attempt:

Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.