Stack Shape Analysis to Detect Obfuscated calls in Binaries

Information about calls to the operating system (or kernel libraries) made by a binary executable maybe used to determine whether the binary is malicious. Being aware of this approach, malicious programmers hide this information by making such calls without using the CALL instruction. For instance, the CALL ADDR instruction may be replaced by two PUSH instructions and a RETURN instruction, the first PUSH pushes the address of instruction after the RETURN instruction, and the second PUSH pushes the address ADDR. The code may be further obfuscated by spreading the three instructions and by splitting each instruction into multiple instructions. This paper presents a method to statically detect obfuscated calls in binary code. The notion of abstract stack is introduced to associate each element in the stack to the instruction that pushes the element. An abstract stack graph is a concise representation of all abstract stacks at every point in the program. The abstract stack graph may be created by abstract interpretation of the binary executable and may be used to detect obfuscated calls.