THE METHOD OF UNPACKING MALWARE VIA HARDWARE ASSISTED LOOP PROFILING

Authors

  • Se-Hyok Kim Kim Il Sung University Author
  • Hak-Song Kim Kim Il Sung University Author

DOI:

https://doi.org/10.71146/kjmr1036

Keywords:

LoopHPC, Loop profiling, Precise Event-Based Sampling (PEBS)

Abstract

Hardware Performance Counters (HPCs) are built-in registers of modern processors to count the occurrences of various micro-architectural events. Measuring HPCs values is a cost-effective way to characterize dynamic program behaviors. Because of the ease of use and tamper-resistant advantages, using HPCs coupled with machine learning models to address security problems is on the rise in recent years. However, lately the suitability of HPCs for security has been questioned in light of the non-determinism concerns: measurement errors caused by interrupt skid and time-division multiplexing can undermine the effectiveness of using HPCs in security applications. With these cautions in mind, we explore ways to tame hardware event’s non-determinism nature for malware unpacking, which is a long-standing challenge in malware analysis. Our research is motivated by two key observations. First, the unpacking process, which involves expensive iterations of decryption or decompression, can incur identifiable deviations in hardware events. Second, loop-centric HPCs profiling can minimize the imprecisions caused by interrupt skid and time-division multiplexing. Therefore, we utilize two mechanisms offered by Intel CPUs (i.e., Precise Event-Based Sampling (PEBS) and Last Branch Record) to develop a generic, hardware-assisted unpacking technique, called LoopHPCs. It offers a new, obfuscation-resilient solution to identify the original code from multiple “written-then-executed” layers. Our controlled experiments demonstrate that LoopHPCs can obtain precise and consistent HPCs values across different Intel CPU architectures and OSs.

Downloads

Download data is not yet available.

References

Marco Zagha, Brond Larson, Steve Turner, and Marty Itzkowitz. Performance Analysis Using the MIPS R10000 Performance Counters. In Proceedings of the 1996 ACM/IEEE Conference on Supercomputing (SC’96), 1996.

Shirley Victoria Browne, Jack Dongarra, N Garner, Kevin S London, and Philip J Mucci. A Scalable Cross-Platform Infrastructure for Application Performance Tuning Using Hardware Counters. In Proceedings of the 2000 ACM/IEEE Conference on Supercomputing (SC’00), 2000.

James Reinders. VTune Performance Analyzer Essentials— Measurement and Tuning Techniques for Software Developers. Intel Press, 2005.

Glenn Ammons, Thomas Ball, and James R. Larus. Exploiting Hardware Performance Counters with Flow and Context Sensitive Profiling. In Proceedings of the ACM SIGPLAN 1997 Conference on Programming Language Design and Implementation (PLDI’97), 1997.

Evelyn Duesterwald and Vasanth Bala. Software Profiling for Hot Path Prediction: Less is More. In Proceedings of the 9th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS’00), 2000.

Leila Delshadtehrani, Sadullah Canakci, Boyou Zhou, Schuyler Eldridge, Ajay Joshi, and Manuel Egele. PHMon: A Programmable Hardware Monitor and Its Security Use Cases. In Proceedings of the 29th USENIX Security Symposium (USENIX Security’20), 2020.

Lei Xue, Hao Zhou, Xiapu Luo, Yajin Zhou, Yang Shi, Guofei Gu, Fengwei Zhang, and Man Ho Au. Happer: Unpacking Android Apps via a Hardware-Assisted Approach. In Proceedings of the 42nd IEEE Symposium on Security & Privacy (S&P’21), 2021.

Liwei Yuan, Weichao Xing, Haibo Chen, and Binyu Zang. Security Breaches As PMU Deviation: Detecting and Identifying Security Attacks Using Performance Counters. In Proceedings of the Second Asia-Pacific Workshop on Systems (APSys’11), 2011.

Yubin Xia, Yutao Liu, Haibo Chen, and Binyu Zang. CFIMon: Detecting Violation of Control Flow Integrity using Performance Counters. In Proceedings of the 42th IEEE/IFIP International Conference on Dependable Systems and Networks (DSN’12), 2012.

Adrian Tang, Simha Sethumadhavan, and Salvatore J. Stolfo. Unsupervised Anomaly-Based Malware Detection Using Hardware Features. In Proceedings of the 17th International Symposium on Research in Attacks, Intrusions and Defenses (RAID’14), 2014.

Pinghai Yuan, Qingkai Zeng, and Xuhua Ding. HardwareAssisted Fine-Grained Code-Reuse Attack Detection. In Proceedings of the 18th International Symposium on Recent Advances in Intrusion Detection (RAID’15), 2015.

John Demme, Matthew Maycock, Jared Schmitz, Adrian Tang, Adam Waksman, Simha Sethumadhavan, and Salvatore Stolfo. On the Feasibility of Online Malware Detection with Performance Counters. In Proceedings of the 40th Annual International Symposium on Computer Architecture (ISCA’13), 2013.

Baljit Singh, Dmitry Evtyushkin, Jesse Elwell, Ryan Riley, and Iliano Cervesato. On the Detection of Kernel-Level Rootkits Using Hardware Performance Counters. In Proceedings of the 12th ACM on Asia Conference on Computer and Communications Security (AsiaCCS’17), 2017.

Hossein Sayadi, Nisarg Patel, Sai Manoj PD, Avesta Sasan, Setareh Rafatirad, and Houman Homayoun. Ensemble Learning for Effective Run-Time Hardware-Based Malware Detection: A Comprehensive Analysis and Classification. In Proceedings of 55th ACM/ESDA/IEEE Design Automation Conference (DAC), 2018.

Kanad Basu, Prashanth Krishnamurthy, Farshad Khorrami, and Ramesh Karri. A Theoretical Study of Hardware Performance Counters-Based Malware Detection. IEEE Transactions on Information Forensics and Security, 15, 2020.

Sai Praveen Kadiyala, Pranav Jadhav, Siew-Kei Lam, and Thambipillai Srikanthan. Hardware Performance CounterBased Fine-Grained Malware Detection. ACM Transactions on Embedded Computing Systems, 19(5), 2020.

Clémentine Maurice, Nicolas Le Scouarnec, Christoph Neumann, Olivier Heen, and Aurélien Francillon. Reverse Engineering Intel Last-Level Cache Complex Addressing Using Performance Counters. In Proceedings of the 18th International Symposium on Recent Advances in Intrusion Detection (RAID’15), 2015.

Casen Hunger, Mikhail Kazdagli, Ankit Rawat, Alex Dimakis, Sriram Vishwanath, and Mohit Tiwari. Understanding Contention-Based Channels and Using Them for Defense. In Proceedings of the 21st International Symposium on High Performance Computer Architecture (HPCA’15), 2015.

Daniel Gruss, Clémentine Maurice, Klaus Wagner, and Stefan Mangard. Flush+Flush: A Fast and Stealthy Cache Attack. In Proceedings of the 13th Conference on Detection of Intrusions and Malware & Vulnerability Assessment (DIMVA’16), 2016.

Tianwei Zhang, Yinqian Zhang, and Ruby B Lee. Cloudradar: A Real-Time Side-Channel Attack Detection System in Clouds. In Proceedings of the 19th International Symposium on Research in Attacks, Intrusions, and Defenses (RAID’16), 2016.

Vincent M Weaver and Sally A McKee. Can Hardware Performance Counters be Trusted? In Proceedings of 4th IEEE International Symposium on Workload Characterization, 2008.

Sanjeev Das, Jan Werner, Manos Antonakakis, Michalis Polychronakis, and Fabian Monrose. SoK: The Challenges, Pitfalls, and Perils of Using Hardware Performance Counters for Security. In Proceedings of the 40th IEEE Symposium on Security and Privacy (S&P’19), 2019.

Vincent M Weaver and Jack Dongarra. Can Hardware Performance Counters Produce Expected, Deterministic Results? In Proceedings of 3rd Workshop on Functionality of Hardware Performance Monitoring, 2010.

Intel. Intel64 and IA-32 Architectures Software Developer’s Manual Volume 3. https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia32-architectures-software-developer-systemprogramming-manual-325384.pdf, 2021.

Gerd Zellweger, Denny Lin, and Timothy Roscoe. So Many Performance Events, So Little Time. In Proceedings of the 7th ACM SIGOPS Asia-Pacific Workshop on Systems (APSys’16), 2016.

Downloads

Published

2026-10-30

Issue

Section

Computer Science

Categories

How to Cite

THE METHOD OF UNPACKING MALWARE VIA HARDWARE ASSISTED LOOP PROFILING. (2026). Kashf Journal of Multidisciplinary Research, 3(10), 1-26. https://doi.org/10.71146/kjmr1036