Abstract
The need for automated, scalable and machine speed analysis is significant with the ever-increasing quantity of code that requires security analysis. Recent advancements in technology demonstrate the possibility of automated analysis of binaries by raising/lifting/translating them to an intermediate representation. This paper describes the efforts towards developing utilities for raising MIPS binaries to an intermediate representation (IR) of LLVM. Using LLVM-IR, one can leverage the existing utilities built over LLVM for performing automated analysis of lifted code. The implemented utilities extend open-source tools McSema and Remill for MIPS ISA. The paper presents the methodology of raising the MIPS binaries as a systematically arranged step by step procedure. While presenting the procedure, the text highlights the challenges faced during each of these translation steps. The results from the two test suites demonstrate that the implemented static binary translation (SBT) utilities can produce the LLVM-IR that can be analysed or recompiled back to an executable form.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Arm exploration tools. https://developer.arm.com/architectures/cpu-architecture/a-profile/exploration-tools. Accessed 10 Aug 2021
Elf handling for thread local storage. https://uclibc.org/docs/tls.pdf. Accessed 10 Aug 2021
Mcsema - trail of bits. https://github.com/lifting-bits/mcsema. Accessed 10 Aug 2021
Openwrt. https://openwrt.org. Accessed 10 Aug 2021
Remill - trail of bits. https://github.com/lifting-bits/remill. Accessed 10 Aug 2021
The system V application binary interface: MIPS RISC processor supplement (1996)
J.H., et al.: reopt. https://github.com/GaloisInc/reopt. Accessed 10 Aug 2021
Barbalace, A., Karaoui, M.L., Wang, W., Xing, T., Olivier, P., Ravindran, B.: Edge computing: the case for heterogeneous-ISA container migration. In: Proceedings of the 16th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments, pp. 73–87 (2020)
Bougacha, A., Aubey, G., Collet, P., Coudray, T., de la Vieuville, A.: Dagger (2016)
Charney, M.: Intel xed (2017). https://github.com/intelxed/xed
Chipounov, V., Candea, G.: Enabling sophisticated analyses of \(\times \)86 binaries with RevGen. In: 2011 IEEE/IFIP 41st International Conference on Dependable Systems and Networks Workshops (DSN-W), pp. 211–216. IEEE (2011)
Cloutier, F.: https://github.com/zneak/fcd. Accessed 10 Aug 2021
da Costa, N., Doria, F.A.: On an extension of Rice’s theorem and its applications in mathematical economics dedicated to the memory of professor Saul Fuks (1929–2012). In: Entangled Political Economy. Emerald Group Publishing Limited (2014)
Di Federico, A., Agosta, G.: A jump-target identification method for multi-architecture static binary translation. In: Proceedings of the International Conference on Compilers, Architectures and Synthesis for Embedded Systems, pp. 1–10 (2016)
Di Federico, A., Fezzardi, P., Agosta, G.: rev.ng: a multi-architecture framework for reverse engineering and vulnerability discovery. In: 2018 International Carnahan Conference on Security Technology (ICCST), pp. 1–5. IEEE (2018)
Di Federico, A., Payer, M., Agosta, G.: rev.ng: a unified binary analysis framework to recover CFGs and function boundaries. In: Proceedings of the 26th International Conference on Compiler Construction, pp. 131–141 (2017)
RTC draper: fracture. https://github.com/draperlaboratory/fracture. Accessed 10 Aug 2021
Ellson, J., Gansner, E., Koutsofios, L., North, S.C., Woodhull, G.: Graphviz— open source graph drawing tools. In: Mutzel, P., Jünger, M., Leipert, S. (eds.) GD 2001. LNCS, vol. 2265, pp. 483–484. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45848-4_57
Engelke, A., Schulz, M.: Instrew: leveraging LLVM for high performance dynamic binary instrumentation. In: Proceedings of the 16th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments, pp. 172–184 (2020)
Fraze, D.: Cyber grand challenge (CGC). Defense Advanced Research Projects Agency (2016). https://wwwdarpa.mil/program/cyber-grand-challenge
Holub, J.J.: Decompilation of specialized and advanced instruction sets
Kirchner, K., Rosenthaler, S.: bin2llvm: analysis of binary programs using LLVM intermediate representation. In: Proceedings of the 12th International Conference on Availability, Reliability and Security, pp. 1–7 (2017)
Korenčik, L.: Decompiling binaries into LLVM IR using McSema and Dyninst. Ph.D. thesis, Masarykova univerzita, Fakulta informatiky (2019)
Křoustek, J., Matula, P.: RetDec: an open-source machine-code decompiler [talk], July 2018. Presented at Pass the SALT 2018, Lille
Pietrek, M.: Peering inside the PE: a tour of the Win32 portable executable file format (1994)
Quynh, N.A.: Capstone: next-gen disassembly framework, 5(2), 3–8. Black Hat USA (2014)
raxen: Libbeauty. https://github.com/raxen/libbeauty. Accessed 10 Aug 2021
Yadavalli, S.B., Smith, A.: Raising binaries to LLVM IR with MCTOLL (WIP paper). In: Proceedings of the 20th ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, and Tools for Embedded Systems, pp. 213–218 (2019)
Acknowledgements
We want to thank the Ministry of Electronics and Information Technology (MeitY) Govt. of India for funding this research work. Any views, opinions, and findings made in this paper are only of the authors and do not reflect the opinions of MeitY.
We would like to acknowledge the developer community of McSema & Remill from TrailOfBits for providing insights on the working of these tools.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Romana, S., Bandgar, A.D., Kumar, M., Patil, M.U., Lakshmi Eswari, P.R. (2021). Raising MIPS Binaries to LLVM IR. In: Tripathy, S., Shyamasundar, R.K., Ranjan, R. (eds) Information Systems Security. ICISS 2021. Lecture Notes in Computer Science(), vol 13146. Springer, Cham. https://doi.org/10.1007/978-3-030-92571-0_6
Download citation
DOI: https://doi.org/10.1007/978-3-030-92571-0_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-92570-3
Online ISBN: 978-3-030-92571-0
eBook Packages: Computer ScienceComputer Science (R0)