<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">FASER: Binary Code Similarity Search through the use of Intermediate Representations</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Josh</forename><surname>Collyer</surname></persName>
							<email>j.collyer@lboro.ac.uk</email>
							<affiliation key="aff0">
								<orgName type="institution">Loughborough University</orgName>
								<address>
									<addrLine>Epinal Way</addrLine>
									<postCode>LE11 3TU</postCode>
									<settlement>Loughborough</settlement>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Tim</forename><surname>Watson</surname></persName>
							<email>tim.watson@lboro.ac.uk</email>
							<affiliation key="aff0">
								<orgName type="institution">Loughborough University</orgName>
								<address>
									<addrLine>Epinal Way</addrLine>
									<postCode>LE11 3TU</postCode>
									<settlement>Loughborough</settlement>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
							<affiliation key="aff1">
								<orgName type="institution" key="instit1">The Alan Turing Institute</orgName>
								<orgName type="institution" key="instit2">British Library</orgName>
								<address>
									<addrLine>96 Euston Rd</addrLine>
									<postCode>NW1 2DB</postCode>
									<settlement>London</settlement>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Iain</forename><surname>Phillips</surname></persName>
							<email>i.w.phillips@lboro.ac.uk</email>
							<affiliation key="aff0">
								<orgName type="institution">Loughborough University</orgName>
								<address>
									<addrLine>Epinal Way</addrLine>
									<postCode>LE11 3TU</postCode>
									<settlement>Loughborough</settlement>
									<country key="GB">United Kingdom</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">FASER: Binary Code Similarity Search through the use of Intermediate Representations</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">4B251E89744077F9895283CD79B64656</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2025-04-23T19:58+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>Binary Code Similarity Search</term>
					<term>Intermediate Representations</term>
					<term>Natural Language Processing</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Being able to identify functions of interest in cross-architecture software is useful whether you are analysing for malware, securing the software supply chain or conducting vulnerability research. Cross-Architecture Binary Code Similarity Search has been explored in numerous studies and has used a wide range of different data sources to achieve its goals. The data sources typically used draw on common structures derived from binaries such as function control flow graphs or binary level call graphs, the output of the disassembly process or the outputs of a dynamic analysis approach. One data source which has received less attention is binary intermediate representations. Binary Intermediate representations possess two interesting properties: they are cross architecture by their very nature and encode the semantics of a function explicitly to support downstream usage. Within this paper we propose Function as a String Encoded Representation (FASER) which combines long document transformers with the use of intermediate representations to create a model capable of cross architecture function search without the need for manual feature engineering, pre-training or a dynamic analysis step. We compare our approach against a series of baseline approaches for two tasks; A general function search task and a targeted vulnerability search task. Our approach demonstrates strong performance across both tasks, performing better than all baseline approaches.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>Binary Code Similarity Search aims to provide a means of finding compiled functions which are similar to a given query function. Being able to achieve this is useful when wanting to identify similarities between malware functionality, identify function re-use or to understand whether a piece of software contains known vulnerabilities. This is a complex undertaking. Factors ranging from the diversity of toolchains to compiler optimization options mean that functions can be represented differently across binaries. The diversity of ISAs is vast when viewing the problem through an embedded computing lens where software can be used within systems ranging from a MIPS-based embedded 5G modem to a 1750A-based subsystem in a US Apache Helicopter. This problem is not new, however, and Binary Code Similarity Search has been tackled using a range of different methods. In particular, natural language processing (NLP) approaches have been transitioned from other domains and applied to binary analysis tasks. Early approaches such as SAFE <ref type="bibr" target="#b12">[14]</ref>, asm2vec <ref type="bibr" target="#b3">[5]</ref> and InnerEye <ref type="bibr" target="#b22">[24]</ref> explored using NLP for binary code search utilising stateof-the-art approaches. The literature then developed and moved onto explore using the advances in Transformer architectures in approaches such as jTrans <ref type="bibr" target="#b18">[20]</ref>, PalmTree <ref type="bibr" target="#b9">[11]</ref> and Trex <ref type="bibr" target="#b13">[15]</ref>, all of which use a similar pre-training methodology as BERT <ref type="bibr" target="#b2">[4]</ref> with the addition of domain specific tasks or binary analysis specific data sources.</p><p>The aforementioned approaches all suffer from challenges with constructing a vocabulary which is able to cover the range of possible inputs. This is referred to as the Out of Vocabulary (OOV) problem <ref type="bibr" target="#b9">[11]</ref> and stems from the use of assembly instructions as input which can include a broad range of possible values such as memory addresses and opcodes. Even after normalization the number of possible inputs continues to increase with the number of supported architectures due to implementationspecific nuances. In order to overcome this challenge, some approaches have instead sought to use an intermediate representation (IR) as the input data format. For example, XLIR <ref type="bibr" target="#b4">[6]</ref> uses the LLVM IR to conduct binary to source function search and Penwy <ref type="bibr" target="#b14">[16]</ref> uses the VEX IR alongside a form of concolic execution to create bug signatures for known bugs to conduct vulnerability search. Neither of these approaches however tackles binary function search directly using only the IR without any additional inputs.</p><p>Within this paper, we propose Function As a String Encoded Representation (FASER)<ref type="foot" target="#foot_0">1</ref> which combines the long document transformer architecture, Longformer <ref type="bibr" target="#b0">[2]</ref>, with the use of radare2's <ref type="bibr" target="#b17">[19]</ref> Evaluable String Intermediate Language (ESIL) to create a cross architecture model which is capable of binary function search across multiple different architectures. Through using an IR as the input data type, we side step the issue of having to normalize for each assembly language and instead normalize once across a single common representation.</p><p>The key contributions of this paper are:</p><p>1. A binary function representation as IR Functions as Strings which requires no additional data processing effort other than normalization. 2. A cross-architecture model which combines the usage of IRs alongside longer context transformers and demonstrate its usefulness for cross-architecture function search and known vulnerability detection. 3. We demonstrate that it's possible to get strong cross-architecture binary search performance using a transformer architecture without the need for pre-training and instead using deep metric learning to train directly for the binary function search objective. 4. We conduct, as far as the authors are aware, the first experiment for cross-architecture function search using RISC-V architecture as part of the experimental methodology.</p><p>This paper is structured in the following way. Section 2 describes the research methodology used for this research before then moving onto Section 3 which presents the experimental results derived from a series of experiments conducted. This paper then concludes with concluding remarks in Section 4 where we discuss our findings, detail the implications and propose potential future research avenues.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Methodology</head><p>In this section we provide an overview of the methodology used to create our experimental dataset and details related to how we train and evaluate our proposed solution. We begin by describing our chosen IR before describing the dataset used. We then move onto describe the process of going from raw binaries to pre-processed, training-ready data. This section then continues to describe the model design, training configuration and evaluation design before detailing the metrics and baseline approaches used to compare against.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.">Chosen Intermediate Representation</head><p>The chosen IR is radare2's Evaluable Strings Intermediate Language (ESIL). radare2 converts assembly language into a semantic equalivant, ESIL which represents the architecture specific instructions using a combination of symbols and numbers. Figure <ref type="figure" target="#fig_2">2</ref> provides several examples of x86-64 assembly instructions and the corresponding ESIL representations. The primary reason for choosing ESIL over other IR's such as VEX, LLVM or PCode was compactness. Any given assembly instruction corresponds to a single ESIL string. Whilst some assembly instructions create very large ESIL string representations, through our experimentation the length of the ESIL IR is typically shorter and more succinct as opposed to the alternatives.  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.">Dataset</head><p>In order to evaluate FASER and compare against comparative baselines, we use two of the datasets detailed within <ref type="bibr" target="#b11">[13]</ref>. The first dataset is Dataset-1 created by <ref type="bibr" target="#b11">[13]</ref>. Dataset-1 contains seven popular open source projects: ClamAv, Curl, nmap, Openssl, Unrar, z3 and zlib. Each of these are compiled for ARM32, ARM64, MIPS32, MIPS64, x86 and x86-64 using four different versions of Clang and GCC alongside 5 different optimization levels. This results in each of the 7 projects having 24 unique compiler, architecture and optimization combinations for each binary within the library. Within <ref type="bibr" target="#b11">[13]</ref>, the authors formulate 6 tasks using this dataset which increase in difficultly. For the purposes of this paper, we have chosen the most difficult, denoted as XM. The XM task imposes no constraints on which functions can be sampled from the corpus during test time and includes all possible compiler, architecture and bitness combinations. This task is representative of conducting binary function search against real binaries.</p><p>The second dataset we use is the Dataset-Vulnerability dataset also part of <ref type="bibr" target="#b11">[13]</ref>. This dataset consists of two firmware images that include several OpenSSL CVE's, specifically within the libcrypto library included as part of the firmware. The first firmware image is of a Netgear R7000 router which is ARM32 and a TP-Link Deco-M4 mesh router which is MIPS32. The dataset also includes the same vulnerable library compiled for ARM32, MIPS32, x86 and x86-64. The goal is to use the vulnerable functions from our compiled libraries as a query function and then identify the corresponding vulnerable function within the firmware image. In addition to the two tasks above, we augment the second dataset with libcrypto compiled for RISC-V 32-bit and then re-run the firmware search. This task has been introduced to explore whether an IR model is capable of transferring its learning to architectures it has not seen before and can be considered a research first.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3.">Data Generation</head><p>In order to generate the training data, bin2ml <ref type="bibr" target="#b1">[3]</ref> was used for both data extraction and pre-processing. bin2ml uses radare2 to disassemble the binaries and lift functions into ESIL IR. Once this lifting process has been complete, the data is then processed further to create ESIL function as string representations by concatenating all ESIL instructions for a given function into a single, long string. Any strings that were longer than our model's input dimension were truncated. This could potentially cause a loss of key information but is mitigated by the large input dimension chosen. Each function string is then normalized using a series of heuristics before the entire corpus is deduplicated. This process was repeated for all binaries within our datasets. The specifics of the normalization and deduplication process are presented below.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.4.">Normalization</head><p>Normalization is a fundamental step to ensure that the vocabulary size is manageable, and all possible inputs can be encoded. In order to facilitate this, a series of heuristics were applied to replace parts of the ESIL strings. The normalization approach draws on common approaches outlined within the literature such as those used within SAFE <ref type="bibr" target="#b12">[14]</ref>, jTrans <ref type="bibr" target="#b18">[20]</ref> and PalmTree <ref type="bibr" target="#b9">[11]</ref>. Firstly, any hexadecimal value which starts with 0xfffff or is one to three characters long (such as 0x023 or 0x02) are considered immediate constants and replaced with the IMM token. Secondly, any hexadecimal value which starts with 0x preceded by 4 or more hexadecimal values is considered a memory address and replaced with MEM. Thirdly, due to the way radare2 represents function calls and data accesses, these values are typically represented as integers within ESIL representations. For this reason, if the opcode the ESIL representation was derived from is a call opcode, the integer is replaced with the FUNC token and otherwise DATA. And lastly, general purpose registers are replaced with tokens based on their size, 32-bit registers are replaced with reg32 and 64-bit registers are replaced with reg64. As part of the experimentation, two versions of FASER were trained, one without register normalization and one with. This allows us to understand the impact register normalization would have on an IR based model.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.5.">Deduplication</head><p>After normalization, deduplication takes place. Deduplication is critical because even after changing factors such as optimization level and compiler, it is still possible for binaries generated from the same source code to produce identical functions. This is typically overlooked in existing literature and is comparable to the approach presented in <ref type="bibr" target="#b11">[13]</ref>. For each of the normalised ESIL strings, the ESIL string plus the function name are concatenated into a single string before being hashed. These hashes are then compared with each other to identify where there are duplicate functions. For any matches found, only one was kept ensuring that the dataset used for training contains only unique function strings. There is then a subsequent step taken which looks through the entire dataset and eliminates functions which are only present once. Essentially removing the functions whereby regardless of architecture or optimization, after disassembly and lifting IR are invariant. Across our dataset, the deduplication process eliminated on average 20-25% of the functions from a given library. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.6.">Model Design</head><p>The chosen model used in FASER is a LongFormer. The LongFormer model was proposed by <ref type="bibr" target="#b0">[2]</ref> to tackle the quadratic computational scaling of self-attention used in models such as BERT. The LongFormer instead uses a combination of local, sliding window attention, with a global attention mechanism. This formulation instead scales linearly as the input size increases, providing a mechanism to train transformers with larger input sequences. Furthermore, this combination of local and global attention is viewed favorably for the binary function search task. An assembly instruction is not executed in isolation but instead executed as part of a series of instructions. This local attention window provides a means for a single instruction to include the context of the instructions before and after it but in a manner which is bounded. The global attention can then look at the function holistically whilst being informed by the local contexts provided by the sliding window attention. The model parameters used for FASER were an input dimension of 4096, followed by 8 LongFormer blocks with an intermediate dimension of 2048, followed by two dense layers which map the 786 dimension transformer output to a 128 dimension embedding. The local attention window is set to 512 tokens. We utilize the implementation provided by transformers and all other parameters are kept default. These can be viewed here <ref type="bibr" target="#b0">[2]</ref> </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.7.">Training Configuration</head><p>Previous works such as Trex <ref type="bibr" target="#b13">[15]</ref>, jTrans <ref type="bibr" target="#b18">[20]</ref> and PalmTree <ref type="bibr" target="#b9">[11]</ref> conduct a pre-training step prior to then fine-tuning for the function search objective. Whilst this makes sense if you want to train a model which can be used for various different downstream tasks, it's potentially suboptimal if the only downstream use case is going to be function search. To this end, we forgo any pre-training steps and train FASER directly for the function search objective using deep metric learning. We construct a pair-based training methodology by using a Siamese formulation in combination with Circle Loss <ref type="bibr" target="#b16">[18]</ref>. Circle Loss was chosen due to its ability to place emphasis on large deviations in between-class similarity in a manner not possible with other losses such as triplet loss. Both Cosine Embedding Loss and Triplet Loss were experimented with and resulted in unstable training and in some cases, complete model collapse.</p><p>We also formulate a sampling strategy that ensures 𝑚 number of examples for a given label (function) are present within a batch. We then apply the online batch hard pair mining method <ref type="bibr" target="#b5">[7]</ref> to dynamically create both positive and negative pairs for each example from batched inputs throughout training. This works by embedding all examples within a batch before using the associated labels for each example to create the hardest positive and negative pairs for each example. What determines hardest is the output of a distance function which in our case was Cosine Similarity. The strength of this approach when compared to previous research which uses static pre-computed pairs is the weaknesses of the model are consistently challenged. For example, if during training the model quickly learns to search across ARM and MIPS but is performing badly when searching across X86-64, this training formulation would automatically begin to target this weakness by generating pairs including X86-64 examples and uses them to calculate the loss.</p><p>For training, we use the whole of Dataset-1 and sample 100K functions per epoch for 18 epochs (Approximately 3 days of training). We set 𝑚 to 2 to ensure each batch has 2 of each sampled function, batch size is set to 8 and, we use gradient accumulation to artificially set the batch size to 512. The Adam <ref type="bibr" target="#b7">[9]</ref> optimizer is used with a fixed learning rate of 0.0005.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.8.">Comparison Approaches</head><p>For the first task, we draw upon the top performing approaches reported within Marcelli (2022) <ref type="bibr" target="#b11">[13]</ref> which are the Graph Matching Networks (GMN) and Graph Neural Network (GNN) approach from Li et al (2019) <ref type="bibr" target="#b10">[12]</ref> and Gemini <ref type="bibr" target="#b20">[22]</ref>. All of these are Graph Neural Network (GNN) approaches which take advantage of the structural aspects of functions, typically through using the control flow graph (CFG) with node level feature vectors as an input. Approaches using natural language processing and transformer model architectures such as PalmTree <ref type="bibr" target="#b9">[11]</ref> and jTrans <ref type="bibr" target="#b18">[20]</ref> would have been ideal candidates but are mono-architecture therefore were deemed unsuitable for comparison.</p><p>For the vulnerability search task, we use the same three approaches outlined above but also compare against Trex <ref type="bibr" target="#b13">[15]</ref>. Trex provides an interesting comparison because it too uses a transformer architecture but has one significant difference. The model is pre-trained on what the authors describe as micro-traces. These micro-traces are generated in a dynamic manner using an emulator. Once trained, the model is capable of being used with solely static data and forgoes the emulation aspect. The emulator used to generate the micro-traces provided by the authors does not support the full breadth of architectures and bitness of Dataset-1 therefore would be an unfair comparison and therefore, is not used in the first task.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.9.">Evaluation Configuration</head><p>For task 1, we again use Dataset-1 and implement a sampling approach which dynamically creates search pools which for a given function, contain 1 positive example and 100 negative examples. This formulation is the same as <ref type="bibr" target="#b11">[13]</ref>. We also adopt the same methodology as <ref type="bibr" target="#b11">[13]</ref> for the Vulnerability search task whereby we have a query function of a given architecture and search across all possible functions in the firmware's libcryto library. This means that the search pool size for task 2 is 10 times bigger at approximately 1000 functions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.10.">Metrics</head><p>We re-use the metrics used in previous studies Recall@1 and MRR@10 for task 1 in order to present a reliable comparison. For the vulnerability search task, we report the rank at which the vulnerable function was present at after the search was conducted similar to other studies, alongside this, we also calculate the mean and median ranks across all architecture searches. This is primarily to aid result analysis.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Evaluation</head><p>Our evaluation aims to answer the following research questions:</p><p>1. RQ1 -How does FASER perform when compared against other baseline approaches for the binary function search task? 2. RQ2 -How effective is FASER at searching real firmware images for known vulnerabilities? 3. RQ3 -Does using intermediate representations as the input data enable the model to zero shot architectures not previously seen as part of the training data?</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1.">RQ1 -Binary Function Similarity Search</head><p>The results of the experimentation to gather data for RQ1 can be seen in Table <ref type="table">1</ref>. Both of the FASER models trained outperform all the baseline approaches across both of the chosen metrics. Looking first at Recall@1, the model without register normalized training data (denoted as FASER NRM) performs significantly better than the register normalized model, achieving a Recall@1 increase of 13% when compared against the best performing baseline, GMN. FASER RN performs comparable to the GMN model without needing direct comparison between all possible function combinations within a given search pool.</p><p>Moving onto the MRR@10 results, FASER NRM again performance significantly better than all baselines with a 7.5% increase. FASER RM is again comparable to the GMN approach with an identical MRR@10.</p><p>RQ1 Summary: The results present above show that our propose approach, FASER, performs as well as if not better than the best baseline approach with FASER NRM performing better across all metrics.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.">RQ2 -Binary Function Vulnerability Search</head><p>The results of the experimentation to gather data for RQ2 can be seen in Table <ref type="table" target="#tab_1">2</ref>. The results show the ranks of search results when searching the Netgear R7000 router which is ARM32.</p><p>In addition to the three baseline approaches used in the previous task, our proposed approach was compared against Trex, a comparable transformer based approach which has a more complicated and  <ref type="table" target="#tab_1">2</ref> show that our proposed approached performs well across all the architectures. Interestingly, whilst the register normalized model performed the strongest in the Binary Function Similarity Search task, in this task the register normalized model performs significantly better. This is shown by both mean and median rank descriptive statistics being lower. The best performing FASER model is highly comparable to the GMN method but again without the aforementioned limitations. Comparing specifically to Trex, the register normalized model performs consistently better across all the architectures. This suggests that our training methodology of training for the function similarity directly and forgoing the elaborate pre-training steps usually adopted and the use of IR's as our data input has merit. RQ2 Summary: The results present above show that the FASER RN performs well when searching real firmware images for known vulnerabilities.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3.">RQ3 -Zero Shot Architecture Binary Function Search</head><p>Table <ref type="table">3</ref> shows the results from the experimentation undertaken to answer RQ3. The question posed here is can the FASER models, because we are using an IR as the input data, perform zero-shot vulnerability search for a new architecture by transferring prior learnt knowledge. Fundamentally, the answer to this is no. The vulnerability search performance for a new instruction set architecture (in this case RISC-V) is significantly worse. This is clearly demonstrated by the mean and median rank descriptive statistics.</p><p>Nevertheless, these results do demonstrate something interesting. Across both FASER models, the performance is significantly better when searching MIPS functions using a RISC-V query as opposed to searching ARM functions using a RISC-V query. This suggests that the semantic representation created when MIPS and RISC-V instructions are lifted to ESIL may be more similar than ARM and RISC-V. Given that recent research has suggested that ARM and X86/X86-64 instructions are closer in statistical similarity than when compared to MIPS <ref type="bibr" target="#b6">[8]</ref>, these results may suggest that introducing RISC-V binaries into a training dataset may level out any data imbalances.</p><p>RQ3 Summary: The results present above show that the use of an IR input representation does not </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Discussion and Conclusion</head><p>The results presented above demonstrate that the combination of ESIL IR and the Longformer transformer architecture perform well compared to the baseline approaches with minimal requirement for either manual feature engineering or dynamic analysis. The FASER RN model performs particularly well at the vulnerability search task across all architectures tested and performs comparably to GMN, without requiring direct comparison between all possible combinations within a given search pool.</p><p>Whilst demonstrating the effectiveness of IRs and longer context transformers, these results also add weight to our argument that the pre-training step seen within previous work may be unwarranted for binary function search and training for the binary function similarity objective directly may be more optimal.</p><p>The results presented to answer RQ3 also suggest something interesting. While the search rank results were significantly worse in terms of mean and median rank, suggesting that our proposed approach is unable to reliably transfer to unseen architectures, there is a large difference between the reported ranks for RISC-V → ARM when compared to RISC-V → MIPS ranks. Prior research <ref type="bibr" target="#b6">[8]</ref> observed similar phenomena whereby x86 → ARM functions were statistically more similar than x86 → MIPS functions. This suggests that RISC-V functions may be more similar to MIPS functions in terms of semantics when represented in ESIL than ARM. Given that most datasets used in prior research only include X86, ARM and MIPS, this similarity could potentially be leveraged and experimented with further. An example of this experimentation could be to see explore whether including RISC-V functions within a cross-architecture binary function search dataset balances out the x86 → ARM similarities with providing function examples that are similar but different to the MIPS architecture.</p><p>Turning now to implications of this research. Firstly, this work demonstrates that IRs derived from binaries can be used to train models for binary function search and perform well. Secondly, the use of longer input sequences also works well. The performance results, especially related to the use of the LongFormer architecture suggest that changing the type of transformer architecture used and increasing the input dimension for approaches such as jTrans <ref type="bibr" target="#b18">[20]</ref>, Trex <ref type="bibr" target="#b13">[15]</ref> or PalmTree <ref type="bibr" target="#b9">[11]</ref> may increase their overall performance. The results also demonstrate that if the only downstream target task is binary function search it may be worth amending the standard training methodology which involves a pre-training step and instead, train for the objective directly.</p><p>In future work, there are several avenues that could be explored. There are a number of different IRs that could be incorporated into similar approaches such as VEX <ref type="bibr" target="#b15">[17]</ref>, LLVM <ref type="bibr" target="#b8">[10]</ref> and PCode <ref type="bibr">[1]</ref>. There is also an emerging sub-field of binary function search focused on adding heuristic pre-and post-filtering steps to increase performance by reducing the number of functions searched such as those described in Asteria-Pro <ref type="bibr" target="#b21">[23]</ref> and BinUSE <ref type="bibr" target="#b19">[21]</ref>. And finally, this approach could be enhanced through the integration of supporting models such as those that use decompiled source code, recovered type information or structural aspects at a control flow graph or call graph level.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: High Level Overview of Methodology</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head></head><label></label><figDesc>disasm: push rbp esil: rbp,8,rsp,0,=<ref type="bibr" target="#b6">[8]</ref>,8,rsp,-= disasm: call sym.imp.printf esil: 4176,rip,8,rsp,-=,rsp,=<ref type="bibr" target="#b6">[8]</ref>,rip,= disasm: mov dword [rbp -8], 0 esil: 0,0x8,rbp,-,=<ref type="bibr" target="#b2">[4]</ref> </figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Figure 2 :</head><label>2</label><figDesc>Figure 2: Example X86-64 and ESIL Representations</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head>Table 2</head><label>2</label><figDesc>RQ2 -Vulnerability Search Result Rankings computationally expensive training process. The results presented in Table</figDesc><table><row><cell>XM</cell></row></table></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">https://github.com/br0kej/FASER</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<title level="m" type="main">Longformer: The long-document transformer</title>
		<author>
			<persName><forename type="first">Iz</forename><surname>Beltagy</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Matthew</forename><forename type="middle">E</forename><surname>Peters</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Arman</forename><surname>Cohan</surname></persName>
		</author>
		<idno type="arXiv">arXiv:2004.05150</idno>
		<imprint>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
	<note type="report_type">arXiv preprint</note>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<title/>
		<author>
			<persName><forename type="first">Josh</forename><surname>Collyer</surname></persName>
		</author>
		<ptr target="https://github.com/br0kej/bin2ml/.2023" />
		<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding</title>
		<author>
			<persName><forename type="first">Jacob</forename><surname>Devlin</surname></persName>
		</author>
		<ptr target="https://api.semanticscholar.org/CorpusID:52967399" />
	</analytic>
	<monogr>
		<title level="m">North American Chapter of the Association for Computational Linguistics</title>
				<imprint>
			<date type="published" when="2019">2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Asm2vec: Boosting static representation robustness for binary clone search against code obfuscation and compiler optimization</title>
		<author>
			<persName><forename type="first">Benjamin</forename><forename type="middle">Cm</forename><surname>Steven Hh Ding</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Philippe</forename><surname>Fung</surname></persName>
		</author>
		<author>
			<persName><surname>Charland</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">IEEE Symposium on Security and Privacy (SP). IEEE</title>
				<imprint>
			<date type="published" when="2019">2019. 2019</date>
			<biblScope unit="page" from="472" to="489" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Cross-Language Binary-Source Code Matching with Intermediate Representations</title>
		<author>
			<persName><forename type="first">Yi</forename><surname>Gui</surname></persName>
		</author>
		<idno type="DOI">10.1109/SANER53432.2022.00077</idno>
	</analytic>
	<monogr>
		<title level="m">2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)</title>
				<imprint>
			<date type="published" when="2022">2022</date>
			<biblScope unit="page" from="601" to="612" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<title level="m" type="main">In defense of the triplet loss for person re-identification</title>
		<author>
			<persName><forename type="first">Alexander</forename><surname>Hermans</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Lucas</forename><surname>Beyer</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Bastian</forename><surname>Leibe</surname></persName>
		</author>
		<idno type="arXiv">arXiv:1703.07737</idno>
		<imprint>
			<date type="published" when="2017">2017</date>
		</imprint>
	</monogr>
	<note type="report_type">arXiv preprint</note>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Revisiting binary code similarity analysis using interpretable feature engineering and lessons learned</title>
		<author>
			<persName><forename type="first">Dongkwan</forename><surname>Kim</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IEEE Transactions on Software Engineering</title>
		<imprint>
			<date type="published" when="2022">2022</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<monogr>
		<title level="m" type="main">Adam: A Method for Stochastic Optimization</title>
		<author>
			<persName><forename type="first">P</forename><surname>Diederik</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Jimmy</forename><surname>Kingma</surname></persName>
		</author>
		<author>
			<persName><surname>Ba</surname></persName>
		</author>
		<idno>CoRR abs/1412.6980</idno>
		<ptr target="https://api.semanticscholar.org/CorpusID:6628106" />
		<imprint>
			<date type="published" when="2014">2014</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">LLVM: a compilation framework for lifelong program analysis &amp; transformation</title>
		<author>
			<persName><forename type="first">Chris</forename><surname>Lattner</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Vikram</surname></persName>
		</author>
		<author>
			<persName><surname>Adve</surname></persName>
		</author>
		<ptr target="https://api.semanticscholar.org/CorpusID:978769" />
	</analytic>
	<monogr>
		<title level="m">International Symposium on Code Generation and Optimization</title>
				<meeting><address><addrLine>CGO</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2004">2004. 2004. 2004</date>
			<biblScope unit="page" from="75" to="86" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Palmtree: learning an assembly language model for instruction embedding</title>
		<author>
			<persName><forename type="first">Xuezixiang</forename><surname>Li</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Yu</forename><surname>Qu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Heng</forename><surname>Yin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security</title>
				<meeting>the 2021 ACM SIGSAC Conference on Computer and Communications Security</meeting>
		<imprint>
			<date type="published" when="2021">2021</date>
			<biblScope unit="page" from="3236" to="3251" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Graph matching networks for learning the similarity of graph structured objects</title>
		<author>
			<persName><forename type="first">Yujia</forename><surname>Li</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International conference on machine learning. PMLR</title>
				<imprint>
			<date type="published" when="2019">2019</date>
			<biblScope unit="page" from="3835" to="3845" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<monogr>
		<title level="m" type="main">How Machine Learning Is Solving the Binary Function Similarity Problem</title>
		<author>
			<persName><forename type="first">Andrea</forename><surname>Marcelli</surname></persName>
		</author>
		<ptr target="https://www.usenix.org/conference/usenixsecurity22/presentation/marcelli" />
		<imprint>
			<date type="published" when="2022">2022</date>
			<biblScope unit="page" from="2099" to="2116" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">Safe: Self-attentive function embeddings for binary similarity</title>
		<author>
			<persName><forename type="first">Luca</forename><surname>Massarelli</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2019">2019</date>
			<biblScope unit="page" from="309" to="329" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<monogr>
		<title level="m" type="main">Trex: Learning execution semantics from micro-traces for binary similarity</title>
		<author>
			<persName><forename type="first">Kexin</forename><surname>Pei</surname></persName>
		</author>
		<idno type="arXiv">arXiv:2012.08680</idno>
		<imprint>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
	<note type="report_type">arXiv preprint</note>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">Cross-architecture bug search in binary executables</title>
		<author>
			<persName><forename type="first">Jannik</forename><surname>Pewny</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">2015 IEEE Symposium on Security and Privacy. IEEE</title>
				<imprint>
			<date type="published" when="2015">2015</date>
			<biblScope unit="page" from="709" to="724" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<analytic>
		<title level="a" type="main">Firmalice -Automatic Detection of Authentication Bypass Vulnerabilities in Binary Firmware</title>
		<author>
			<persName><forename type="first">Yan</forename><surname>Shoshitaishvili</surname></persName>
		</author>
		<ptr target="https://api.semanticscholar.org/CorpusID:17298209" />
	</analytic>
	<monogr>
		<title level="m">Network and Distributed System Security Symposium</title>
				<imprint>
			<date type="published" when="2015">2015</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">Circle loss: A unified perspective of pair similarity optimization</title>
		<author>
			<persName><forename type="first">Yifan</forename><surname>Sun</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the IEEE/CVF conference on computer vision and pattern recognition</title>
				<meeting>the IEEE/CVF conference on computer vision and pattern recognition</meeting>
		<imprint>
			<date type="published" when="2020">2020</date>
			<biblScope unit="page" from="6398" to="6407" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<monogr>
		<ptr target="https://github.com/radare/radare2.2017" />
		<title level="m">Radare2 GitHub repository</title>
				<imprint/>
		<respStmt>
			<orgName>Radare2 Team</orgName>
		</respStmt>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<analytic>
		<title level="a" type="main">JTrans: Jump-Aware Transformer for Binary Code Similarity Detection</title>
		<author>
			<persName><forename type="first">Wang</forename><surname>Hao</surname></persName>
		</author>
		<idno type="DOI">10.1145/3533767.3534367</idno>
		<ptr target="https://doi.org/10.1145/3533767.3534367" />
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis. ISSTA 2022</title>
				<meeting>the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis. ISSTA 2022<address><addrLine>Virtual, South Korea</addrLine></address></meeting>
		<imprint>
			<publisher>Association for Computing Machinery</publisher>
			<date type="published" when="2022">2022</date>
			<biblScope unit="page" from="1" to="13" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<analytic>
		<title level="a" type="main">Enhancing DNN-Based Binary Code Function Search With Low-Cost Equivalence Checking</title>
		<author>
			<persName><forename type="first">Huaijin</forename><surname>Wang</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IEEE Transactions on Software Engineering</title>
		<imprint>
			<biblScope unit="volume">49</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="226" to="250" />
			<date type="published" when="2022">2022</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b20">
	<analytic>
		<title level="a" type="main">Neural network-based graph embedding for cross-platform binary code similarity detection</title>
		<author>
			<persName><forename type="first">Xiaojun</forename><surname>Xu</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 2017 ACM SIGSAC conference on computer and communications security</title>
				<meeting>the 2017 ACM SIGSAC conference on computer and communications security</meeting>
		<imprint>
			<date type="published" when="2017">2017</date>
			<biblScope unit="page" from="363" to="376" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b21">
	<analytic>
		<title level="a" type="main">Asteria-Pro: Enhancing Deep-Learning Based Binary Code Similarity Detection by Incorporating Domain Knowledge</title>
		<author>
			<persName><forename type="first">Shouguo</forename><surname>Yang</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM Transactions on Software Engineering and Methodology</title>
		<imprint>
			<date type="published" when="2023">2023</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b22">
	<analytic>
		<title level="a" type="main">Neural Machine Translation Inspired Binary Code Similarity Comparison beyond Function Pairs</title>
		<author>
			<persName><forename type="first">Fei</forename><surname>Zuo</surname></persName>
		</author>
		<ptr target="https://www.ndss-symposium.org/ndss-paper/neural-machine-translation-inspired-binary-code-similarity-comparison-beyond-function-pairs/" />
	</analytic>
	<monogr>
		<title level="m">26th Annual Network and Distributed System Security Symposium, NDSS 2019</title>
				<meeting><address><addrLine>San Diego, California, USA</addrLine></address></meeting>
		<imprint>
			<publisher>The Internet Society</publisher>
			<date type="published" when="2019">February 24-27, 2019. 2019</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
