TY - JOUR
T1 - Empowering IoT Security
T2 - Automated Identification of Standard Library Functions in RTOS Firmware with LLM and RAG
AU - Zheng, Zhihan
AU - Tan, Yu An
AU - Chen, Zihan
AU - Lu, Zheng
AU - Meng, Weizhi
AU - Wang, Shuo
N1 - Publisher Copyright:
© 2014 IEEE.
PY - 2026/6/1
Y1 - 2026/6/1
N2 - Reverse engineering embedded firmware for real-time operating systems (RTOSs) is a formidable challenge in Internet of Things security. The common practice of stripping symbolic information from firmware to optimize performance and storage makes identifying standard library functions exceptionally difficult, creating a significant bottleneck for functional analysis and vulnerability discovery. This article introduces a novel, automated method for identifying these functions in RTOS firmware by leveraging large language models (LLMs). Our approach operates directly on raw binary code, requiring no symbolic or debugging information, and demonstrates broad generalizability across diverse hardware architectures and compilers. At its core, the method combines retrieval-augmented generation (RAG) to enhance identification accuracy with a newly designed adaptive iterative screening algorithm (AISA), which optimizes analysis efficiency by prioritizing candidate functions based on a weighted score of call frequency, call depth, and address proximity to reduce token costs. We validated our method through rigorous experimentation on Zephyr RTOS firmware spanning nine architectures (e.g., ARM, MIPS, RISC-V). The results are compelling: our approach achieves a 90.59% accuracy rate in identifying standard library function names. Moreover, its application to commercial Internet of Things (IoT) firmware confirms its high efficiency, identifying functions significantly faster and more economically than traditional heuristic techniques. This work contributes a powerful, general-purpose, and cost-effective solution for automated firmware analysis.
AB - Reverse engineering embedded firmware for real-time operating systems (RTOSs) is a formidable challenge in Internet of Things security. The common practice of stripping symbolic information from firmware to optimize performance and storage makes identifying standard library functions exceptionally difficult, creating a significant bottleneck for functional analysis and vulnerability discovery. This article introduces a novel, automated method for identifying these functions in RTOS firmware by leveraging large language models (LLMs). Our approach operates directly on raw binary code, requiring no symbolic or debugging information, and demonstrates broad generalizability across diverse hardware architectures and compilers. At its core, the method combines retrieval-augmented generation (RAG) to enhance identification accuracy with a newly designed adaptive iterative screening algorithm (AISA), which optimizes analysis efficiency by prioritizing candidate functions based on a weighted score of call frequency, call depth, and address proximity to reduce token costs. We validated our method through rigorous experimentation on Zephyr RTOS firmware spanning nine architectures (e.g., ARM, MIPS, RISC-V). The results are compelling: our approach achieves a 90.59% accuracy rate in identifying standard library function names. Moreover, its application to commercial Internet of Things (IoT) firmware confirms its high efficiency, identifying functions significantly faster and more economically than traditional heuristic techniques. This work contributes a powerful, general-purpose, and cost-effective solution for automated firmware analysis.
KW - Internet of Things (IoT) security
KW - large language model (LLM)
KW - library function identification
KW - real-time operating system (RTOS) firmware analysis
KW - retrieval-augmented generation (RAG)
UR - https://www.scopus.com/pages/publications/105032107415
U2 - 10.1109/JIOT.2026.3670949
DO - 10.1109/JIOT.2026.3670949
M3 - Article
AN - SCOPUS:105032107415
SN - 2327-4662
VL - 13
SP - 23876
EP - 23889
JO - IEEE Internet of Things Journal
JF - IEEE Internet of Things Journal
IS - 11
ER -