Developing and marketing software typically involves a significant investment of time and money. Even when software is distributed as freeware or inexpensive shareware, software developers have an interest in being recognized as the developer of the software and maintaining the rights of ownership of their intellectual property.
A number of actors work against the rights of software developers. Competitors may reverse engineer a piece of software to learn how it operates. Others may exploit a software developer's work by modifying executable code for their own purposes, such as to display advertisements for their own products. Malware developers may also crack a legitimate program and modify it to distribute malware. Software developed for virtual machines may be particularly vulnerable to exploits of these types, due to the close relationship between modern high-level languages and virtual machines designed to execute object code generated from programs written in these languages. Accordingly, the instant disclosure identifies and addresses a need for additional and improved systems and methods for protecting virtual machine program code.
As will be described in greater detail below, the instant disclosure describes various systems and methods for protecting virtual machine program code by converting program functions to native code for a computing device, obtaining memory addresses of virtual machine and/or operating system functions to be called from the functions converted to native code, and generating random or partially-random identifiers to reference the memory addresses. Native code functions may be invoked using a native code interface for the virtual machine, and native code functions may then invoke virtual machine and/or operating system functions using the random identifiers.
In one example, a computer-implemented method for protecting virtual machine program code may include (1) identifying at least one software program function developed for execution in a virtual machine to be protected against reverse engineering, (2) converting the software program function to native code for a computing device, (3) obtaining a memory address of at least one virtual machine function, (4) generating an at least partially random alphanumeric value to identify the memory address of the virtual machine function, (5) invoking the converted native code using a native code interface for the virtual machine, and (6) invoking the virtual machine function from the converted native code using the alphanumeric value.
In some examples, converting the software program function to native code for the computing device may include (1) converting the source code for the software program function to a second programming language and (2) compiling the converted source code to native code for the computing device. In one embodiment, the second programming language may be C, C++, BASIC, SIMPLE, and/or SAPHIR.
In one embodiment, the virtual machine may include a JAVA virtual machine. In some examples, obtaining the memory address of the virtual machine function may include using a JAVA REFLECTION interface to obtain the memory address of the virtual machine function. In one embodiment, the computer-implemented method may further include (1) obtaining a memory address of one or more operating system functions, (2) generating an at least partially random alphanumeric value to identify the memory address of the operating system function, and (3) invoking the operating system function from the converted native code using the alphanumeric value. In one embodiment, the operating system may be an ANDROID operating system.
In some examples, the computer-implemented method may further include halting execution of the software program if a public key for the software program does not authenticate a signing certificate for the software program. In some examples, the computer-implemented method may further include obfuscating input of one or more functions called from the converted native code.
In one embodiment, a system for implementing the above-described method may include several modules stored in memory, such as (1) an identification module that identifies at least one software program function developed to be executed in a virtual machine to be protected against reverse engineering, (2) a conversion module that converts the software program function to native code for a computing device, (3) an addressing module that obtains a memory address of at least one virtual machine function, (4) a reference module that generates at least partially random alphanumeric values to identify the memory address of the virtual machine function, (5) a native interface module that invokes the converted native code using a native code interface for the virtual machine, (6) a system interface module that invokes the virtual machine function from the converted native code using the alphanumeric values. The system may also include one or more processors configured to execute the identification module, the conversion module, the addressing module, the reference module, and the native interface module.
In some examples, the above-described method may be encoded as computer-executable instructions on a non-transitory computer-readable-storage medium. For example, a computer-readable-storage medium may include one or more computer-executable instructions that, when executed by at least one processor of a computing device, may cause the computing device to (1) identify at least one software program function developed for execution in a virtual machine to be protected against reverse engineering, (2) convert the software program function to native code for the computing device, (3) obtain a memory address of at least one virtual machine function, (4) generate an at least partially random alphanumeric value to identify the memory address of the virtual machine function, (5) invoke the converted native code using a native code interface for the virtual machine, and (6) invoke the virtual machine function from the converted native code using the alphanumeric value.
Features from any of the above-mentioned embodiments may be used in combination with one another in accordance with the general principles described herein. These and other embodiments, features, and advantages will be more fully understood upon reading the following detailed description in conjunction with the accompanying drawings and claims.
The accompanying drawings illustrate a number of exemplary embodiments and are a part of the specification. Together with the following description, these drawings demonstrate and explain various principles of the instant disclosure.
Throughout the drawings, identical reference characters and descriptions indicate similar, but not necessarily identical, elements. While the exemplary embodiments described herein are susceptible to various modifications and alternative forms, specific embodiments have been shown by way of example in the drawings and will be described in detail herein. However, the exemplary embodiments described herein are not intended to be limited to the particular forms disclosed. Rather, the instant disclosure covers all modifications, equivalents, and alternatives falling within the scope of the appended claims.
The present disclosure is generally directed to systems and methods for protecting virtual machine program code. As will be explained in greater detail below, systems and methods described herein may protect virtual machine program code from reverse engineering by converting one or more functions of a software program to native code for the computing device on which the program is intended to run. The software program may then obtain memory addresses of native code functions in order to invoke the native code functions during program execution. Native code functions may likewise obtain the memory addresses of virtual machine or operating system functions in order to invoke these functions. Virtual machine or operating system functions may be referenced using a partially random alphanumeric identifier.
Using these systems and methods may provide several advantages. For example, the combination of virtual machine and native code may make the software program more difficult to reverse engineer, potentially requiring familiarity with multiple code analysis tools and operating environments. Using random alphanumeric identifiers when invoking virtual machine or operating system functions may obscure which functions are being called. These advantages may be realized particularly in an operating environment where reverse engineering tools are less sophisticated and where software development techniques are less widely known, such as for a mobile device.
The following will provide, with reference to
In addition, exemplary system 100 may include an addressing module 108 that may obtain a memory address of at least one virtual machine function. Exemplary system 100 may additionally include a reference module 110 that may generate an at least partially random alphanumeric value to identify the memory address of the virtual machine function. Exemplary system 100 may also include a native interface module 112 that may invoke the converted native code using a native code interface for the virtual machine. Native interface module 112 may further invoke the virtual machine function from the converted native code using the alphanumeric value. Although illustrated as separate elements, one or more of modules 102 in
In certain embodiments, one or more of modules 102 in
Exemplary system 100 in
In one embodiment, one or more of modules 102 from
Computing device 202 generally represents any type or form of computing device capable of reading computer-executable instructions. Examples of computing device 202 include, without limitation, laptops, tablets, desktops, servers, cellular phones, Personal Digital Assistants (PDAs), multimedia players, embedded systems, wearable devices (e.g., smart watches, smart glasses, etc.), gaming consoles, combinations of one or more of the same, exemplary computing system 410 in
Server 206 generally represents any type or form of computing device that is capable of storing, comparing, and/or providing data. Examples of server 206 include, without limitation, application servers and database servers configured to provide various database services and/or run certain software applications.
Network 204 generally represents any medium or architecture capable of facilitating communication or data transfer. Examples of network 204 include, without limitation, an intranet, a Wide Area Network (WAN), a Local Area Network (LAN), a Personal Area Network (PAN), the Internet, Power Line Communications (PLC), a cellular network (e.g., a Global System for Mobile Communications (GSM) network), exemplary network architecture 500 in
As illustrated in
Identification module 104 may select the software program functions to be protected against reverse engineering based on a number of criteria and in any suitable manner. For example, identification module 104 may base the selection of program functions to be converted to native code for the computing device on an analysis of the structure of the software program. Smaller programs or programs with a monolithic structure may be converted to native code in their entirety, with just a program stub remaining in the original programming language to call the converted program function. Other programs may be decomposed into major program functions, with each of the program functions being converted into separate native code functions and a main program remaining in the original programming language that calls the converted program functions in the appropriate sequence, or in response to received events.
At step 304 one or more of the systems described herein may convert the software program function to native code for the computing device. For example, at step 304 conversion module 106 may, as part of computing device 202 in
The phrase “native code,” as used herein, generally refers to numerical code compiled or assembled to be executed directly by a computing device's central processing unit (CPU). Native code differs from interpreted code, which is executed by another software program called an interpreter, or from virtual machine code, which is executed by a virtual machine, which may itself be implemented in native code. The term “compiling,” as used herein, generally refers to the process of converting a high level language to the native code for a CPU. Common usage typically differentiates compiling from assembling (which is the process of converting a low-level assembly language to machine code) but as used herein, “compiling” may refer to either process.
Conversion module 106 may convert selected program functions to native code in any suitable manner. In some examples, converting the software program function to native code for the computing device may include (1) converting the source code for the software program function to a second programming language and (2) compiling the converted source code to native code for the computing device. Conversion module 106 may use an automated translation tool to convert the source code for the software program function to a second programming language, or the software program developer may choose to rewrite the selected program function in the second programming language.
In various embodiments, the second programming language may be C, C++, BASIC, SIMPLE, SAPHIR, or any other available programming language. One software program may combine program functions developed in any combination of programming languages, according to the needs of the software program developer. Since compilers for different programming languages may produce significantly different native machine code, developing program functions for a single software program in multiple programming languages may add additional complexity to the reverse engineering process.
At step 306 one or more of the systems described herein may obtain a memory address of one or more virtual machine functions. For example, at step 306 addressing module 108 may, as part of computing device 202 in
Addressing module 108 may obtain a memory address of a virtual machine function in a variety of ways. For example, in one embodiment, the virtual machine may include a JAVA virtual machine. Addressing module 108 may obtain the memory address of a JAVA virtual machine function using a JAVA REFLECTION interface. The phrase “JAVA REFLECTION,” as used herein, generally refers to an application programming interface (API) of the JAVA programming language that implements the feature of object-oriented languages known as introspection. Introspection enables the development of anonymous classes with runtime loading and binding. At runtime, addressing module 108 may use the REFLECTION API to discover methods of a JAVA class that is part of a JAVA virtual machine (JVM) or JAVA library function.
In some examples, systems described herein may include obfuscating input of at least one function called from the converted native code. For example, addressing module 108 may obfuscate parameters passed to the JAVA REFLECTION FindClass or GetMethodID functions when obtaining the address of virtual machine functions. Obfuscating the names of the functions may increase the difficulty of reverse engineering the software program by obscuring which functions in the virtual machine are called from the native code function.
At step 308 one or more of the systems described herein may generate an at least partially random alphanumeric value to identify the memory address of a virtual machine function. For example, at step 308 reference module 110 may, as part of computing device 202 in
Reference module 110 may use any suitable mechanism to generate a random or partially random alphanumeric value to identify the memory address of a virtual machine function. For example, reference module 110 may use a random string function provided by a programming library. The operating system running on the computing device may also provide a function for generating random alphanumeric strings. Reference module 110 may also construct a suitable random identifier by combining an initial alphabetic character with a random number generated by a random number generating function.
At step 310 one or more of the systems described herein may invoke the converted native code using a native code interface for the virtual machine. For example, at step 310 native interface module 112 may, as part of computing device 202 in
Native interface module 112 may invoke the converted native code in a variety of ways. In one example, native interface module 112, running in a JAVA virtual machine, may invoke the native code for a program function using the JAVA NATIVE INTERFACE (JNI). Using JNI or a similar native interface for another programming language provides the advantage of mapping the data types of parameters passed between the high level function and the native code function. For parameters of compound types such as objects, arrays, and strings, JNI provides an interface (JNIEnv) the native code function may call to convert the parameters to appropriate data types for the native code function.
At step 312 one or more of the systems described herein may invoke the virtual machine function from the converted native code using the alphanumeric value. For example, at step 312 system interface module 114 may, as part of computing device 202 in
System interface module 112 may invoke the virtual machine function in any suitable manner. For example, system interface module 112 may maintain a table associating each partially random alphanumeric value with a virtual machine function address, with a function provided to retrieve the function address matching a given alphanumeric value. The alphanumeric value may vary each time the software program runs, making the process of reverse engineering the function call sequence much more difficult.
In one embodiment, systems described herein may manage the process of invoking operating system functions in much the same manner used to invoke virtual machine functions. For example, invoking an operating system function may include (1) obtaining the memory address of at least one operating system function, (2) generating an at least partially random alphanumeric value to identify the memory address of the operating system function, and (3) invoking the operating system function from the converted native code using the alphanumeric value. In one embodiment, the operating system may be a version of the ANDROID operating system, and systems and methods described herein may obtain the memory address of a random number generating function of the ANDROID operating system.
In some examples, methods described herein may include halting execution of the software program if a public key for the software program does not authenticate a signing certificate for the software program. Systems and methods described herein may obtain a public key for the software program from a certificate authority and attempt to authenticate a code signing certificate for the software program. Authentication may take place either in the virtual machine or in a program function converted to native code. By attempting to authenticate the software program using a signing certificate, systems and methods described herein may detect when the software program has been modified and take appropriate action, such as halting execution of the software program.
As explained above, the systems and methods described herein may protect virtual machine program code from reverse engineering by converting one or more functions of a software program to native code for the computing device on which the program is intended to run. The software program may then obtain memory addresses of native code functions in order to invoke the native code functions during program execution. Native code functions may also obtain the memory addresses of virtual machine or operating system functions in order to invoke these functions. Virtual machine or operating system functions may be referenced using a partially random alphanumeric identifier.
Combining virtual machine and native code may increase the complexity of reverse engineering a software program. Additional complexity may be added by using random alphanumeric identifiers when invoking virtual machine or operating system functions from native code program functions and by obfuscating parameters passed to virtual machine functions. Systems and methods described herein may also protect the software program from tampering or being modified by halting execution of the software program if the software program cannot be authenticated with a public key and signing certificate for the software program.
Computing system 410 broadly represents any single or multi-processor computing device or system capable of executing computer-readable instructions. Examples of computing system 410 include, without limitation, workstations, laptops, client-side terminals, servers, distributed computing systems, handheld devices, or any other computing system or device. In its most basic configuration, computing system 410 may include at least one processor 414 and a system memory 416.
Processor 414 generally represents any type or form of physical processing unit (e.g., a hardware-implemented central processing unit) capable of processing data or interpreting and executing instructions. In certain embodiments, processor 414 may receive instructions from a software application or module. These instructions may cause processor 414 to perform the functions of one or more of the exemplary embodiments described and/or illustrated herein.
System memory 416 generally represents any type or form of volatile or non-volatile storage device or medium capable of storing data and/or other computer-readable instructions. Examples of system memory 416 include, without limitation, Random Access Memory (RAM), Read Only Memory (ROM), flash memory, or any other suitable memory device. Although not required, in certain embodiments computing system 410 may include both a volatile memory unit (such as, for example, system memory 416) and a non-volatile storage device (such as, for example, primary storage device 432, as described in detail below). In one example, one or more of modules 102 from
In certain embodiments, exemplary computing system 410 may also include one or more components or elements in addition to processor 414 and system memory 416. For example, as illustrated in
Memory controller 418 generally represents any type or form of device capable of handling memory or data or controlling communication between one or more components of computing system 410. For example, in certain embodiments memory controller 418 may control communication between processor 414, system memory 416, and I/O controller 420 via communication infrastructure 412.
I/O controller 420 generally represents any type or form of module capable of coordinating and/or controlling the input and output functions of a computing device. For example, in certain embodiments I/O controller 420 may control or facilitate transfer of data between one or more elements of computing system 410, such as processor 414, system memory 416, communication interface 422, display adapter 426, input interface 430, and storage interface 434.
Communication interface 422 broadly represents any type or form of communication device or adapter capable of facilitating communication between exemplary computing system 410 and one or more additional devices. For example, in certain embodiments communication interface 422 may facilitate communication between computing system 410 and a private or public network including additional computing systems. Examples of communication interface 422 include, without limitation, a wired network interface (such as a network interface card), a wireless network interface (such as a wireless network interface card), a modem, and any other suitable interface. In at least one embodiment, communication interface 422 may provide a direct connection to a remote server via a direct link to a network, such as the Internet. Communication interface 422 may also indirectly provide such a connection through, for example, a local area network (such as an Ethernet network), a personal area network, a telephone or cable network, a cellular telephone connection, a satellite data connection, or any other suitable connection.
In certain embodiments, communication interface 422 may also represent a host adapter configured to facilitate communication between computing system 410 and one or more additional network or storage devices via an external bus or communications channel. Examples of host adapters include, without limitation, Small Computer System Interface (SCSI) host adapters, Universal Serial Bus (USB) host adapters, Institute of Electrical and Electronics Engineers (IEEE) 1394 host adapters, Advanced Technology Attachment (ATA), Parallel ATA (PATA), Serial ATA (SATA), and External SATA (eSATA) host adapters, Fibre Channel interface adapters, Ethernet adapters, or the like. Communication interface 422 may also allow computing system 410 to engage in distributed or remote computing. For example, communication interface 422 may receive instructions from a remote device or send instructions to a remote device for execution.
As illustrated in
As illustrated in
As illustrated in
In certain embodiments, storage devices 432 and 433 may be configured to read from and/or write to a removable storage unit configured to store computer software, data, or other computer-readable information. Examples of suitable removable storage units include, without limitation, a floppy disk, a magnetic tape, an optical disk, a flash memory device, or the like. Storage devices 432 and 433 may also include other similar structures or devices for allowing computer software, data, or other computer-readable instructions to be loaded into computing system 410. For example, storage devices 432 and 433 may be configured to read and write software, data, or other computer-readable information. Storage devices 432 and 433 may also be a part of computing system 410 or may be a separate device accessed through other interface systems.
Many other devices or subsystems may be connected to computing system 410. Conversely, all of the components and devices illustrated in
The computer-readable medium containing the computer program may be loaded into computing system 410. All or a portion of the computer program stored on the computer-readable medium may then be stored in system memory 416 and/or various portions of storage devices 432 and 433. When executed by processor 414, a computer program loaded into computing system 410 may cause processor 414 to perform and/or be a means for performing the functions of one or more of the exemplary embodiments described and/or illustrated herein. Additionally or alternatively, one or more of the exemplary embodiments described and/or illustrated herein may be implemented in firmware and/or hardware. For example, computing system 410 may be configured as an Application Specific Integrated Circuit (ASIC) adapted to implement one or more of the exemplary embodiments disclosed herein.
Client systems 510, 520, and 530 generally represent any type or form of computing device or system, such as exemplary computing system 410 in
As illustrated in
Servers 540 and 545 may also be connected to a Storage Area Network (SAN) fabric 580. SAN fabric 580 generally represents any type or form of computer network or architecture capable of facilitating communication between a plurality of storage devices. SAN fabric 580 may facilitate communication between servers 540 and 545 and a plurality of storage devices 590(1)-(N) and/or an intelligent storage array 595. SAN fabric 580 may also facilitate, via network 550 and servers 540 and 545, communication between client systems 510, 520, and 530 and storage devices 590(1)-(N) and/or intelligent storage array 595 in such a manner that devices 590(1)-(N) and array 595 appear as locally attached devices to client systems 510, 520, and 530. As with storage devices 560(1)-(N) and storage devices 570(1)-(N), storage devices 590(1)-(N) and intelligent storage array 595 generally represent any type or form of storage device or medium capable of storing data and/or other computer-readable instructions.
In certain embodiments, and with reference to exemplary computing system 410 of
In at least one embodiment, all or a portion of one or more of the exemplary embodiments disclosed herein may be encoded as a computer program and loaded onto and executed by server 540, server 545, storage devices 560(1)-(N), storage devices 570(1)-(N), storage devices 590(1)-(N), intelligent storage array 595, or any combination thereof. All or a portion of one or more of the exemplary embodiments disclosed herein may also be encoded as a computer program, stored in server 540, run by server 545, and distributed to client systems 510, 520, and 530 over network 550.
As detailed above, computing system 410 and/or one or more components of network architecture 500 may perform and/or be a means for performing, either alone or in combination with other elements, one or more steps of an exemplary method for protecting virtual machine program code.
While the foregoing disclosure sets forth various embodiments using specific block diagrams, flowcharts, and examples, each block diagram component, flowchart step, operation, and/or component described and/or illustrated herein may be implemented, individually and/or collectively, using a wide range of hardware, software, or firmware (or any combination thereof) configurations. In addition, any disclosure of components contained within other components should be considered exemplary in nature since many other architectures can be implemented to achieve the same functionality.
In some examples, all or a portion of exemplary system 100 in
In various embodiments, all or a portion of exemplary system 100 in
According to various embodiments, all or a portion of exemplary system 100 in
In some examples, all or a portion of exemplary system 100 in
In addition, all or a portion of exemplary system 100 in
In some embodiments, all or a portion of exemplary system 100 in
According to some examples, all or a portion of exemplary system 100 in
The process parameters and sequence of steps described and/or illustrated herein are given by way of example only and can be varied as desired. For example, while the steps illustrated and/or described herein may be shown or discussed in a particular order, these steps do not necessarily need to be performed in the order illustrated or discussed. The various exemplary methods described and/or illustrated herein may also omit one or more of the steps described or illustrated herein or include additional steps in addition to those disclosed.
While various embodiments have been described and/or illustrated herein in the context of fully functional computing systems, one or more of these exemplary embodiments may be distributed as a program product in a variety of forms, regardless of the particular type of computer-readable media used to actually carry out the distribution. The embodiments disclosed herein may also be implemented using software modules that perform certain tasks. These software modules may include script, batch, or other executable files that may be stored on a computer-readable storage medium or in a computing system. In some embodiments, these software modules may configure a computing system to perform one or more of the exemplary embodiments disclosed herein.
In addition, one or more of the modules described herein may transform data, physical devices, and/or representations of physical devices from one form to another. For example, one or more of the modules recited herein may receive software program source code to be transformed, transform the software program source code to native executable code for a computing device, and output a result of the transformation to a computing device. In another example, one or more of the modules recited herein may transform a computing system into a system for protecting virtual machine program code. Additionally or alternatively, one or more of the modules recited herein may transform a processor, volatile memory, non-volatile memory, and/or any other portion of a physical computing device from one form to another by executing on the computing device, storing data on the computing device, and/or otherwise interacting with the computing device.
The preceding description has been provided to enable others skilled in the art to best utilize various aspects of the exemplary embodiments disclosed herein. This exemplary description is not intended to be exhaustive or to be limited to any precise form disclosed. Many modifications and variations are possible without departing from the spirit and scope of the instant disclosure. The embodiments disclosed herein should be considered in all respects illustrative and not restrictive. Reference should be made to the appended claims and their equivalents in determining the scope of the instant disclosure.
Unless otherwise noted, the terms “connected to” and “coupled to” (and their derivatives), as used in the specification and claims, are to be construed as permitting both direct and indirect (i.e., via other elements or components) connection. In addition, the terms “a” or “an,” as used in the specification and claims, are to be construed as meaning “at least one of.” Finally, for ease of use, the terms “including” and “having” (and their derivatives), as used in the specification and claims, are interchangeable with and have the same meaning as the word “comprising.”
Number | Name | Date | Kind |
---|---|---|---|
6006328 | Drake | Dec 1999 | A |
6643775 | Granger | Nov 2003 | B1 |
6782532 | Sexton | Aug 2004 | B1 |
8887152 | Chen et al. | Nov 2014 | B1 |
8892876 | Huang | Nov 2014 | B1 |
8984299 | Yi | Mar 2015 | B1 |
9396313 | Yi | Jul 2016 | B2 |
20040003264 | Zeman et al. | Jan 2004 | A1 |
20040003380 | Fedorov | Jan 2004 | A1 |
20040103404 | Naumovich | May 2004 | A1 |
20060123403 | Bruecklmayr et al. | Jun 2006 | A1 |
20070256061 | Victorov | Nov 2007 | A1 |
20100313188 | Asipov | Dec 2010 | A1 |
20120059993 | Haselsteiner et al. | Mar 2012 | A1 |
20120159193 | Spradlin | Jun 2012 | A1 |
20120284792 | Liem | Nov 2012 | A1 |
20130227688 | Kim | Aug 2013 | A1 |
20140115292 | McLachlan | Apr 2014 | A1 |
20140137184 | Russello et al. | May 2014 | A1 |
20140351947 | Shim et al. | Nov 2014 | A1 |
20150143452 | Hamlen | May 2015 | A1 |
20150154407 | Yi | Jun 2015 | A1 |
20150161363 | Mallon | Jun 2015 | A1 |
Entry |
---|
Grace et al., “RiskRanker: Scalable and Accurate Zero-day Android Malware Detection”, Jun. 2012, ACM, pp. 281-293. |
Li et al., “Android Malware Forensics: Reconstruction of Malicious Events”, 2012, IEEE Computer Society, pp. 552-558. |
Schulz, Patrick, “Code Protection in Android”, http://net.cs.uni-bonn.de/fileadmin/user—upload/plohmann/2012-Schulz-Code—Protection—in—Android.pdf, as accessed Jan. 30, 2014, Lab Course: Communication and Communicating Devices, Winter term Dec. 2011, Rheinische Friedrich-Wilhelms-Universität, Bonn, Germany, (Jun. 7, 2012). |