Reverse engineering of a stripped binary has a wide range of applications, yet it is challenging mainly due to the lack of contextually useful information within. Once debugging symbols (e.g., variable names, types, function names) are discarded, recovering such information is not technically viable with traditional approaches like static or dynamic binary analysis. We focus on a function symbol name recovery, which allows a reverse engineer to gain a quick overview of an unseen binary. The key insight is that a well-developed program labels a meaningful function name that describes its underlying semantics well. In this paper, we present AsmDepictor, the Transformer-based framework that generates a function symbol name from a set of assembly codes (i.e., machine instructions), which consists of three major components: binary code refinement, model training, and inference. To this end, we conduct systematic experiments on the effectiveness of code refinement that can enhance an overall performance. We introduce the per-layer positional embedding and Unique-softmax for AsmDepictor so that both can aid to capture a better relationship between tokens. Lastly, we devise a novel evaluation metric tailored for a short description length, the Jaccard* score. Our empirical evaluation shows that the performance of AsmDepictor by far surpasses that of the state-of-the-art models up to around 400%. The best AsmDepictor model achieves an F1 of 71.5 and Jaccard* of 75.4.
스트리핑된 바이너리를 이용하여 분석하는 리버스 엔지니어링은 다양한 범위에서 활용되고 있다. 하지만 바이너리 파일 내에서 문맥적으로 유용한 정보가 부족하여 리버스 엔지니어링이 어렵다는 문제점이 존재한다. 디버깅 정보(예: 변수 명, 타입, 함수 명)가 삭제되면 이러한 정보를 복구하는 것은 기존의 분석방법인 정적 또는 동적 바이너리 분석 기술로는 타개하기 어렵다. 본 논문은 리버스 엔지니어가 보이지 않는 바이너리에 대한 빠른 개요를 얻을 수 있게 하기 위한 함수 명 복구에 중점을 둔다. 본 연구의 핵심은 잘 개발된 프로그램은 함수 명이 코드에 내포하고 있는 의미를 잘 반영한다는 것이다. 본 논문에서는 이진 코드 정제, 모델 교육 및 추론이라는 세 가지 주요 구성 요소로 구성된 어셈블리 코드 집합(i.e., machine instruction)에서 함수 명을 생성하는 트랜스포머 기반 프레임워크인 AsmDepictor를 제시한다. 이를 위해 전반적인 성능을 향상시킬 수 있는 코드 세분화의 효과에 대한 실험을 진행한다. 우리는 AsmDepictor에 토큰 간의 관계를 포착하는 데 도움이 될 수 있는 per-layer positional embedding과 Unique-softmax를 제안한다. 마지막으로, 우리는 짧은 설명 길이를 평가하기 위한 Jaccard* score를 고안한다. AsmDepictor의 성능은 71.5의 F1과 75.4의 Jaccard* 로 state-of-the-art 모델의 성능을 최대 400% 능가한다.