KR102615080B1 - Device for hiding application code, method for hiding application code and computer program stored in a recording medium to execute the method - Google Patents

Device for hiding application code, method for hiding application code and computer program stored in a recording medium to execute the method Download PDF

Info

Publication number
KR102615080B1
KR102615080B1 KR1020210116214A KR20210116214A KR102615080B1 KR 102615080 B1 KR102615080 B1 KR 102615080B1 KR 1020210116214 A KR1020210116214 A KR 1020210116214A KR 20210116214 A KR20210116214 A KR 20210116214A KR 102615080 B1 KR102615080 B1 KR 102615080B1
Authority
KR
South Korea
Prior art keywords
code
protected
application package
application
unit
Prior art date
Application number
KR1020210116214A
Other languages
Korean (ko)
Other versions
KR20230033350A (en
Inventor
조해현
이정현
신용구
이선준
Original Assignee
숭실대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 숭실대학교 산학협력단 filed Critical 숭실대학교 산학협력단
Priority to KR1020210116214A priority Critical patent/KR102615080B1/en
Publication of KR20230033350A publication Critical patent/KR20230033350A/en
Application granted granted Critical
Publication of KR102615080B1 publication Critical patent/KR102615080B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/121Restricting unauthorised execution of programs
    • G06F21/125Restricting unauthorised execution of programs by manipulating the program code, e.g. source code, compiled code, interpreted code, machine code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software
    • G06F21/14Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2125Just-in-time application of countermeasures, e.g., on-the-fly decryption, just-in-time obfuscation or de-obfuscation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

개시된 발명의 일 실시예에 따른 응용 프로그램 패키지의 소스 코드에 포함된 보호 대상 코드를 보호하기 위한 애플리케이션 코드 은닉 방법은, 입력부에 의해, 적어도 하나 이상의 실행 파일이 포함된 원본 응용 프로그램 패키지를 수신하는 단계; 추출부에 의해, 상기 원본 응용 프로그램 패키지를 압축 해제하여 상기 보호 대상 코드를 추출하는 단계; 리팩부에 의해, 어느 상기 실행 파일에도 포함되지 않는 패딩 공간을 상기 원본 응용 프로그램 패키지의 소스 코드에 추가하여 보호 응용 프로그램 패키지를 생성하는 단계; 및 코드 주입부에 의해, 상기 보호 응용 프로그램 패키지의 패딩 공간에 상기 보호 대상 코드의 바이너리 정보를 덮어씌워 상기 보호 대상 코드를 상기 패딩 공간에 저장하는 단계;를 포함할 수 있다.An application code hiding method for protecting protected code included in the source code of an application package according to an embodiment of the disclosed invention includes receiving, through an input unit, an original application package including at least one executable file. ; extracting, by an extraction unit, the code to be protected by decompressing the original application package; generating a protected application package by adding, by a repack unit, a padding space not included in any of the executable files to the source code of the original application package; and overwriting, by a code injection unit, binary information of the code to be protected on the padding space of the protected application package and storing the code to be protected in the padding space.

Description

애플리케이션 코드 은닉 장치, 애플리케이션 코드 은닉 방법 및 애플리케이션 코드 은닉 방법을 실행시키도록 기록매체에 저장된 컴퓨터 프로그램{DEVICE FOR HIDING APPLICATION CODE, METHOD FOR HIDING APPLICATION CODE AND COMPUTER PROGRAM STORED IN A RECORDING MEDIUM TO EXECUTE THE METHOD}A computer program stored in a recording medium to execute an application code hiding device, an application code hiding method, and an application code hiding method {DEVICE FOR HIDING APPLICATION CODE, METHOD FOR HIDING APPLICATION CODE AND COMPUTER PROGRAM STORED IN A RECORDING MEDIUM TO EXECUTE THE METHOD}

본 발명은 응용 프로그램 패키지의 특성을 이용하여 애플리케이션 프로그램의 중요 데이터 및 코드를 숨길 수 있는 애플리케이션 코드 은닉 방법 및 애플리케이션 코드 은닉 장치에 관한 것이다.The present invention relates to an application code hiding method and an application code hiding device that can hide important data and code of an application program by using the characteristics of the application program package.

코드 난독화 기법은 주로 소프트웨어의 중요 데이터를 보호하고, 시스템을 공격하거나 시스템으로부터 중요한 정보를 탈취하는 악의적인 행위로부터 프로그램을 보호하기 위하여 사용된다. 특히, 안드로이드 기반 플랫폼의 경우 응용프로그램인 애플리케이션의 코드가 바이트코드의 형태로 존재하고, 이는 낮은 분석 난이도를 가지기 때문에 이를 보호하기 위한 코드 난독화 기법이 필요하다.Code obfuscation techniques are mainly used to protect important data in software and to protect programs from malicious actions that attack the system or steal important information from the system. In particular, in the case of Android-based platforms, the application code, which is an application program, exists in the form of bytecode and has low analysis difficulty, so a code obfuscation technique is needed to protect it.

기존의 코드 난독화 기법의 경우 코드 및 데이터를 애플리케이션 내부에 숨겨두는 방법들이 대부분이다. 이러한 기법이 적용된 애플리케이션의 코드나 데이터는 분석하기 어려운 형태로 변형되었을 뿐, 여전히 예상할 수 있는 형태로서 악의적인 공격자가 탐색 가능한 경로에 존재한다. 즉, 기존의 코드 난독화 기법은 공격자가 숨겨진 정보를 찾아낼 위험성이 여전히 있다.In the case of existing code obfuscation techniques, most methods hide code and data inside the application. The code or data of applications to which these techniques have been applied have been transformed into a form that is difficult to analyze, but still exist in a predictable form that can be explored by malicious attackers. In other words, existing code obfuscation techniques still have the risk of attackers finding hidden information.

즉, 기존의 코드 난독화 기법을 무력화하기 위한 도구 및 기법들이 이미 다수 존재하므로, 기존의 기법들과는 다른 특성을 갖는 새로운 코드 난독화 기법이 필요하다.In other words, since many tools and techniques to neutralize existing code obfuscation techniques already exist, a new code obfuscation technique with characteristics different from existing techniques is needed.

본 발명은 기존의 난독화 기술로는 대처하지 못하는 코드 분석 도구 또는 공격에 대항할 수 있는 애플리케이션 코드 은닉 방법, 애플리케이션 코드 은닉 장치를 제공하기 위한 것이다.The present invention is intended to provide an application code hiding method and an application code hiding device that can combat code analysis tools or attacks that cannot be dealt with with existing obfuscation techniques.

또한, 본 발명은 안드로이드 기반 애플리케이션의 중요 코드 또는 중요 데이터를 APK 자체에 존재하도록 응용 프로그램 패키지를 변경하여 공격자가 해당 응용 프로그램 패키지를 압축 해제하더라도 중요 코드 또는 중요 데이터가 노출되지 않도록 할 수 있는 애플리케이션 코드 은닉 방법, 애플리케이션 코드 은닉 장치를 제공하기 위한 것이다.In addition, the present invention changes the application package so that the important code or important data of the Android-based application exists in the APK itself, so that the important code or important data is not exposed even if the attacker unpacks the application package. It is intended to provide a hiding method and application code hiding device.

개시된 발명의 일 측면에 따른 응용 프로그램 패키지의 소스 코드에 포함된 보호 대상 코드를 보호하기 위한 애플리케이션 코드 은닉 방법은, 입력부에 의해, 적어도 하나 이상의 실행 파일이 포함된 원본 응용 프로그램 패키지를 수신하는 단계; 추출부에 의해, 상기 원본 응용 프로그램 패키지를 압축 해제하여 상기 보호 대상 코드를 추출하는 단계; 리팩부에 의해, 어느 상기 실행 파일에도 포함되지 않는 패딩 공간을 상기 원본 응용 프로그램 패키지의 소스 코드에 추가하여 보호 응용 프로그램 패키지를 생성하는 단계; 및 코드 주입부에 의해, 상기 보호 응용 프로그램 패키지의 패딩 공간에 상기 보호 대상 코드의 바이너리 정보를 덮어씌워 상기 보호 대상 코드를 상기 패딩 공간에 저장하는 단계;를 포함할 수 있다.An application code hiding method for protecting protected code included in the source code of an application package according to one aspect of the disclosed invention includes receiving, through an input unit, an original application package including at least one executable file; extracting, by an extraction unit, the code to be protected by decompressing the original application package; generating a protected application package by adding, by a repack unit, a padding space not included in any of the executable files to the source code of the original application package; and overwriting, by a code injection unit, binary information of the code to be protected on the padding space of the protected application package and storing the code to be protected in the padding space.

또한, 상기 보호 응용 프로그램 패키지를 생성하는 단계는, 상기 리팩부에 의해, 복수의 상기 패딩 공간을 상기 소스 코드에 추가하는 단계;를 포함하고, 상기 보호 대상 코드를 상기 패딩 공간에 저장하는 단계는, 스텁 코드 생성부에 의해, 상기 보호 대상 코드가 덮어씌워진 패딩 공간의 배열 정보를 생성하고, 상기 배열 정보를 상기 소스 코드에 추가하는 단계;를 포함할 수 있다.In addition, the step of generating the protected application package includes adding, by the repack unit, a plurality of the padding spaces to the source code, and storing the code to be protected in the padding space. , generating, by a stub code generation unit, arrangement information of a padding space overwritten with the code to be protected, and adding the arrangement information to the source code.

또한, 애플리케이션 실행부에 의해, 상기 보호 응용 프로그램 패키지를 수신하고, 상기 배열 정보를 기초로 상기 보호 응용 프로그램 패키지로부터 상기 보호 대상 코드를 추출하는 단계;를 더 포함할 수 있다.Additionally, the method may further include receiving the protected application package, by an application executing unit, and extracting the protection target code from the protected application package based on the arrangement information.

또한, 상기 스텁 코드 생성부에 의해, 상기 패딩 공간의 코드를 동적으로 로딩하는데 필요한 스텁 코드를 생성하고, 상기 스텁 코드를 상기 소스 코드에 추가하는 단계;를 더 포함하고, 상기 보호 응용 프로그램 패키지를 생성하는 단계는, 상기 리팩부에 의해, 상기 추출된 보호 대상 코드에 대한 실행 파일을 제외한 실행파일, 상기 배열 정보 및 상기 스텁 코드가 포함되도록 상기 보호 응용 프로그램 패키지를 생성하는 단계;를 포함할 수 있다.In addition, generating a stub code necessary for dynamically loading the code in the padding space by the stub code generation unit, and adding the stub code to the source code, further includes the protected application package. The generating step may include generating, by the repack unit, the protected application package to include an executable file excluding the executable file for the extracted code to be protected, the arrangement information, and the stub code. there is.

또한, 상기 응용 프로그램 패키지는, 안드로이드 플랫폼의 APK 파일을 포함하도록 구성될 수 있다.Additionally, the application package may be configured to include an APK file of the Android platform.

개시된 발명의 일 측면에 따른 컴퓨터 프로그램은, 상기 애플리케이션 코드 은닉 방법을 실행시키도록 컴퓨터로 판독 가능한 기록매체에 저장될 수 있다.A computer program according to one aspect of the disclosed invention may be stored in a computer-readable recording medium to execute the application code hiding method.

개시된 발명의 일 측면에 따른 응용 프로그램 패키지의 소스 코드에 포함된 보호 대상 코드를 보호하기 위한 애플리케이션 코드 은닉 장치는, 적어도 하나 이상의 실행 파일이 포함된 원본 응용 프로그램 패키지를 수신하도록 구성되는 입력부; 상기 원본 응용 프로그램 패키지를 압축 해제하여 상기 보호 대상 코드를 추출하도록 구성되는 추출부; 어느 상기 실행 파일에도 포함되지 않는 패딩 공간을 상기 원본 응용 프로그램 패키지의 소스 코드에 추가하여 보호 응용 프로그램 패키지를 생성하도록 구성되는 리팩부; 및 상기 보호 응용 프로그램 패키지의 패딩 공간에 상기 보호 대상 코드의 바이너리 정보를 덮어씌워 상기 보호 대상 코드를 상기 패딩 공간에 저장하도록 구성되는 코드 주입부;를 포함할 수 있다.An application code hiding device for protecting protected code included in the source code of an application package according to one aspect of the disclosed invention includes an input unit configured to receive an original application package including at least one executable file; an extraction unit configured to extract the code to be protected by decompressing the original application package; a repack unit configured to generate a protected application package by adding a padding space not included in any of the executable files to the source code of the original application package; and a code injection unit configured to overwrite the padding space of the protected application package with binary information of the code to be protected and store the code to be protected in the padding space.

또한, 상기 보호 대상 코드가 덮어씌워진 패딩 공간의 배열 정보를 생성하고, 상기 배열 정보를 상기 소스 코드에 추가하도록 구성되는 스텁 코드 생성부;를 더 포함하고, 상기 리팩부는, 복수의 상기 패딩 공간을 상기 소스 코드에 추가하도록 구성될 수 있다.In addition, it further includes a stub code generation unit configured to generate arrangement information of a padding space overwritten with the code to be protected, and add the arrangement information to the source code, wherein the repack unit generates a plurality of the padding spaces. It can be configured to add to the source code.

또한, 상기 보호 응용 프로그램 패키지를 수신하고, 상기 배열 정보를 기초로 상기 보호 응용 프로그램 패키지로부터 상기 보호 대상 코드를 추출하도록 구성되는 애플리케이션 실행부;를 더 포함할 수 있다.In addition, it may further include an application executing unit configured to receive the protected application package and extract the protection target code from the protected application package based on the arrangement information.

또한, 상기 스텁 코드 생성부는: 상기 패딩 공간의 코드를 동적으로 로딩하는데 필요한 스텁 코드를 생성하고; 그리고 상기 스텁 코드를 상기 소스 코드에 추가하도록 구성되고, 상기 리팩부는, 상기 추출된 보호 대상 코드에 대한 실행 파일을 제외한 실행파일, 상기 배열 정보 및 상기 스텁 코드가 포함되도록 상기 보호 응용 프로그램 패키지를 생성하도록 구성될 수 있다.Additionally, the stub code generator: generates a stub code necessary to dynamically load the code of the padding space; and configured to add the stub code to the source code, wherein the repack unit generates the protected application package to include an executable file excluding the executable file for the extracted code to be protected, the arrangement information, and the stub code. It can be configured to do so.

개시된 발명의 일 측면에 따르면, 기존의 난독화 기술로는 대처하지 못하는 코드 분석 도구 또는 공격에 대항할 수 있다.According to one aspect of the disclosed invention, it is possible to combat code analysis tools or attacks that existing obfuscation techniques cannot cope with.

또한, 본 발명의 실시예에 의하면, 안드로이드 기반 애플리케이션의 중요 코드 또는 중요 데이터를 APK 자체에 존재하도록 응용 프로그램 패키지를 변경하여 공격자가 해당 응용 프로그램 패키지를 압축 해제하더라도 중요 코드 또는 중요 데이터가 노출되지 않도록 할 수 있다.In addition, according to an embodiment of the present invention, the application package is changed so that the important code or important data of the Android-based application is present in the APK itself, so that the important code or important data is not exposed even if an attacker unpacks the application package. can do.

도 1은 일 실시예에 따른 애플리케이션 코드 은닉 장치의 구성도이다.
도 2는 일 실시예에 따른 보호 응용 프로그램 패키지의 생성 과정을 설명하기 위한 도면이다.
도 3은 일 실시예에 따른 코드 은닉 장치의 각 구성의 동작을 설명하기 위한 도면이다.
도 4는 일 실시예에 따른 애플리케이션 코드 은닉 방법의 순서도이다.
1 is a configuration diagram of an application code hiding device according to an embodiment.
Figure 2 is a diagram for explaining the creation process of a protected application package according to an embodiment.
Figure 3 is a diagram for explaining the operation of each component of the code hiding device according to an embodiment.
Figure 4 is a flowchart of an application code hiding method according to one embodiment.

명세서 전체에 걸쳐 동일 참조 부호는 동일 구성요소를 지칭한다. 본 명세서가 실시예들의 모든 요소들을 설명하는 것은 아니며, 개시된 발명이 속하는 기술분야에서 일반적인 내용 또는 실시예들 간에 중복되는 내용은 생략한다. 명세서에서 사용되는 '~부'라는 용어는 소프트웨어 또는 하드웨어로 구현될 수 있으며, 실시예들에 따라 복수의 '~부'가 하나의 구성요소로 구현되거나, 하나의 '~부'가 복수의 구성요소들을 포함하는 것도 가능하다.Like reference numerals refer to like elements throughout the specification. This specification does not describe all elements of the embodiments, and general content or overlapping content between the embodiments in the technical field to which the disclosed invention pertains is omitted. The term '~unit' used in the specification may be implemented as software or hardware, and depending on the embodiments, multiple '~units' may be implemented as one component, or one '~unit' may be implemented as a plurality of components. It is also possible to include elements.

또한 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있는 것을 의미한다.Additionally, when a part "includes" a certain component, this means that it may further include other components rather than excluding other components, unless specifically stated to the contrary.

단수의 표현은 문맥상 명백하게 예외가 있지 않는 한, 복수의 표현을 포함한다.Singular expressions include plural expressions unless the context clearly makes an exception.

각 단계들에 있어 식별부호는 설명의 편의를 위하여 사용되는 것으로 식별부호는 각 단계들의 순서를 설명하는 것이 아니며, 각 단계들은 문맥상 명백하게 특정 순서를 기재하지 않는 이상 명기된 순서와 다르게 실시될 수 있다.The identification code for each step is used for convenience of explanation. The identification code does not explain the order of each step, and each step may be performed differently from the specified order unless a specific order is clearly stated in the context. there is.

이하 첨부된 도면들을 참고하여 개시된 발명의 작용 원리 및 실시예들에 대해 설명한다.Hereinafter, the operating principle and embodiments of the disclosed invention will be described with reference to the attached drawings.

도 1은 일 실시예에 따른 애플리케이션 코드 은닉 장치의 구성도이다.1 is a configuration diagram of an application code hiding device according to an embodiment.

도 1을 참조하면, 본 발명의 실시예에 따른 애플리케이션 코드 은닉 장치(100)는 원본 응용 프로그램 패키지(200)의 소스 코드(210)에 포함된 보호 대상 코드(211)를 보호하기 위하여 입력된 원본 응용 프로그램 패키지(200)를 변형할 수 있다.Referring to FIG. 1, the application code hiding device 100 according to an embodiment of the present invention is an original input code 211 included in the source code 210 of the original application package 200. The application package 200 can be modified.

응용 프로그램 패키지는 안드로이드 플랫폼의 APK(Android application package) 파일을 포함하도록 구성될 수 있으나, 이에 한정되는 것은 아니며, 다양한 플랫폼의 파일을 포함하는 프로그램 패키지일 수 있다.The application package may be configured to include an APK (Android application package) file of the Android platform, but is not limited thereto and may be a program package including files from various platforms.

APK 파일은 구글 안드로이드 운영체제에서 애플리케이션 배포 및 설치에 사용되는 ZIP 파일 형식의 압축 패키지일 수 있다. 사용자는 안드로이드 SDK에 포함된 ADB(Android Debug Bridge)를 이용하거나, ASTRO 파일 관리자, 파일 엑스퍼트, ES 파일 탐색기 등의 파일 관리 애플리케이션을 이용하여 APK 파일을 획득할 수 있다.An APK file may be a compressed package in the ZIP file format used for distributing and installing applications in the Google Android operating system. Users can obtain the APK file by using ADB (Android Debug Bridge) included in the Android SDK or by using a file management application such as ASTRO File Manager, File Expert, or ES File Explorer.

애플리케이션 코드 은닉 장치(100)는 입력부(110), 추출부(Extractor)(120), 스텁 코드 생성부(Stub-code Generator)(130), 리팩부(Repacker)(140), 코드 주입부(Code injector)(150)를 포함할 수 있다.The application code hiding device 100 includes an input unit 110, an extractor 120, a stub code generator 130, a repacker 140, and a code injection unit. injector) (150).

입력부(110)는 적어도 하나 이상의 실행 파일이 포함된 원본 응용 프로그램 패키지(200)를 수신할 수 있다. 이때, 실행 파일은 APK 파일일 수 있으나, 이에 한정되는 것은 아니다.The input unit 110 may receive an original application package 200 including at least one executable file. At this time, the executable file may be an APK file, but is not limited thereto.

추출부(120)는 원본 응용 프로그램 패키지(200)를 압축 해제하여 원본 응용 프로그램 패키지(200)에 포함되어 있는 실행 파일을 추출할 수 있다.The extraction unit 120 may decompress the original application package 200 and extract the executable file included in the original application package 200.

추출부(120)는 7-Zip, WinZip 등의 파일 압축 해제 유틸리티를 이용하여 응용 프로그램의 APK 파일을 압축 해제하여 실행 파일을 추출할 수 있다. APK 파일의 압축을 해제하면 Assets, res, AndroidManifest.xml, resources.arsc, classes.dex 등의 파일 및 디렉토리를 획득할 수 있다.The extraction unit 120 can extract the executable file by decompressing the APK file of the application using a file decompression utility such as 7-Zip or WinZip. By unzipping the APK file, you can obtain files and directories such as Assets, res, AndroidManifest.xml, resources.arsc, and classes.dex.

보호 대상 코드(211)는 사용자가 원본 응용 프로그램 패키지(200)에서 특히 보호하고 싶은 데이터(Important Data)에 관한 소스 코드(210)일 수 있다.The code to be protected 211 may be the source code 210 related to data (Important Data) that the user wants to specifically protect in the original application package 200.

종래의 난독화 솔루션은 이러한 보호 대상 코드(211) 또는 보호 대상 데이터를 애플리케이션 내부에 숨겨두는 솔루션이 대부분이다. 이러한 솔루션이 적용된 애플리케이션의 코드나 데이터는 분석하기 어려운 형태로 변형되었을 뿐, 여전히 예상할 수 있는 형태로 탐색 가능한 경로에 존재한다.Most of the conventional obfuscation solutions hide the code to be protected (211) or the data to be protected inside the application. The code or data of applications to which these solutions are applied have been transformed into a form that is difficult to analyze, but still exist in a predictable form and on a navigable path.

이러한 종래의 난독화 기법은 응용 프로그램 패키지를 해독하기 위한 도구 및 기법들이 다수 존재하므로, 공격자가 숨겨진 정보를 찾아낼 위험성이 있다는 문제가 있다.This conventional obfuscation technique has a problem in that there is a risk of an attacker finding hidden information because there are many tools and techniques for decrypting application packages.

추출부(120)는 원본 응용 프로그램 패키지(200)를 압축 해제하여 보호 대상 코드(211)를 추출할 수 있다.The extraction unit 120 may extract the code to be protected 211 by decompressing the original application package 200.

리팩부(140)는 패딩(padding) 공간을 원본 응용 프로그램 패키지(200)의 소스 코드(210)에 추가하여 보호 응용 프로그램 패키지(300)를 생성할 수 있다.The repack unit 140 may create a protected application package 300 by adding a padding space to the source code 210 of the original application package 200.

패딩 공간(301)은 어느 실행 파일에도 포함되거나 대응되지 않는 공간으로서, 소스 코드(210)의 일부 코드 영역일 수 있다.The padding space 301 is a space that is not included in or does not correspond to any executable file, and may be a partial code area of the source code 210.

보호 응용 프로그램 패키지(300)는 보호 대상 코드(211)가 은닉되도록 구성된 응용 프로그램 패키지일 수 있다.The protected application package 300 may be an application package configured to hide the code to be protected 211 .

코드 주입부(150)는 보호 응용 프로그램 패키지(300)의 패딩 공간(301)에 보호 대상 코드(211)의 바이너리 정보를 덮어씌워 보호 대상 코드(211)를 상기 패딩 공간(301)에 저장할 수 있다.The code injection unit 150 may overwrite the binary information of the code to be protected 211 on the padding space 301 of the protected application package 300 and store the code to be protected 211 in the padding space 301. .

보호 응용 프로그램 패키지(300)의 소스 코드(210)에 포함된 보호 대상 코드(211)는 어느 실행 파일에도 포함되거나 대응되지 않으므로, 공격자가 보호 응용 프로그램 패키지(300)의 실행 파일을 단순히 분석하는 것 만으로는 보호 대상 코드(211)를 알아낼 수 없다.Since the protected code 211 included in the source code 210 of the protected application package 300 is not included or corresponds to any executable file, the attacker simply analyzes the executable file of the protected application package 300. It is not possible to find out the code to be protected (211) by itself.

대부분의 안드로이드 애플리케이션에 대한 분석은 안드로이드 애플리케이션의 실행 파일인 APK 파일을 대상으로 이루어지고, APK 파일 분석의 시작은 APK 파일 내부의 정보를 확인하기 위해 APK 파일을 압축 해제(Unzip)하는 것으로 시작된다. 종래 기술의 경우, 난독화 되었다고는 하지만 민감한 코드 혹은 중요한 데이터가 압축 해제 결과에 그대로 노출된다는 문제가 있다.Analysis of most Android applications is conducted on APK files, which are executable files of Android applications, and APK file analysis begins with unzipping the APK file to check the information inside the APK file. In the case of the prior art, although it is said to be obfuscated, there is a problem that sensitive code or important data is exposed as is in the result of decompression.

그러나, 본 발명의 애플리케이션 코드 은닉 방법을 통해 보호된 보호 응용 프로그램 패키지(300)의 보호 대상 코드(211) 혹은 보호 대상 데이터는 응용 프로그램 패키지 자체에 존재하기 때문에 공격자가 보호 응용 프로그램 패키지(300)에 대하여 압축 해제를 하더라도 보호 대상 코드(211) 보호 대상 데이터는 압축 해제 대상에서 제외되어 노출되지 않을 수 있다.However, since the protected code 211 or the protected data of the protected application package 300 protected through the application code hiding method of the present invention exists in the application package itself, an attacker cannot access the protected application package 300. Even if the data is decompressed, the data subject to protection code 211 may not be exposed as it is excluded from the decompression target.

결과적으로, 본 발명의 코드 은닉 방법은 안드로이드 애플리케이션이 기존 난독화 기술로는 대처하지 못하는 분석 도구 혹은 공격에 대항하도록 할 수 있다.As a result, the code hiding method of the present invention can enable Android applications to resist analysis tools or attacks that existing obfuscation techniques cannot cope with.

입력부(110), 추출부(120), 스텁 코드 생성부(130), 리팩부(140) 및 코드 주입부(150)는 특정한 컴퓨팅 장치에 마련될 수 있으나, 반드시 입력부(110), 추출부(120), 스텁 코드 생성부(130), 리팩부(140) 및 코드 주입부(150)가 특정한 장치에 마련되어야 하는 것은 아니며, 보호 응용 프로그램 패키지(300)를 생성할 수 있다면, 애클리케이션 코드 은닉 방법이 어떠한 방식으로 구현되더라도 상관없다.The input unit 110, the extraction unit 120, the stub code generation unit 130, the repack unit 140, and the code injection unit 150 may be provided in a specific computing device, but the input unit 110 and the extraction unit ( 120), the stub code generation unit 130, the repack unit 140, and the code injection unit 150 do not have to be provided in a specific device, and if the protected application package 300 can be generated, the application code It does not matter how the hiding method is implemented.

예를 들어, 입력부(110), 추출부(120), 스텁 코드 생성부(130), 리팩부(140) 및 코드 주입부(150)는 서버에 마련되어, 서버의 통신부로부터 수신한 원본 응용 프로그램 패키지(200)에 기초하여 보호 응용 프로그램 패키지(300)를 생성할 수 있다. 이때, 서버는 생성된 보호 응용 프로그램 패키지(300)를 해당 응용 프로그램 패키지를 사용하고자 하는 사용자의 단말에 전송할 수 있다.For example, the input unit 110, the extraction unit 120, the stub code generation unit 130, the repack unit 140, and the code injection unit 150 are provided in the server, and the original application package received from the communication unit of the server A protection application package 300 can be created based on 200. At this time, the server may transmit the generated protected application package 300 to the terminal of the user who wishes to use the application package.

입력부(110), 추출부(120), 스텁 코드 생성부(130), 리팩부(140), 코드 주입부(150)는 애플리케이션 코드 은닉 장치(100)에 포함된 복수개의 프로세서 중 어느 하나의 프로세서를 포함할 수 있다. 또한, 지금까지 설명된 본 발명의 실시예 및 앞으로 설명할 실시예에 따른 코드 은닉 방법은, 프로세서에 의해 구동될 수 있는 프로그램의 형태로 구현될 수 있다.The input unit 110, the extraction unit 120, the stub code generation unit 130, the repack unit 140, and the code injection unit 150 are any one of a plurality of processors included in the application code hiding device 100. may include. Additionally, the code hiding method according to the embodiments of the present invention described so far and the embodiments to be described in the future may be implemented in the form of a program that can be driven by a processor.

여기서 프로그램은, 프로그램 명령, 데이터 파일 및 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 프로그램은 기계어 코드나 고급 언어 코드를 이용하여 설계 및 제작된 것일 수 있다. 프로그램은 상술한 부호 수정을 위한 방법을 구현하기 위하여 특별히 설계된 것일 수도 있고, 컴퓨터 소프트웨어 분야에서 통상의 기술자에게 기 공지되어 사용 가능한 각종 함수나 정의를 이용하여 구현된 것일 수도 있다. 전술한 정보 표시 방법을 구현하기 위한 프로그램은, 프로세서에 의해 판독 가능한 기록매체에 기록될 수 있다. 이때, 기록매체는 애플리케이션 코드 은닉 장치(100)에 포함된 메모리일 수 있다.Here, the program may include program instructions, data files, and data structures, etc., singly or in combination. Programs may be designed and produced using machine code or high-level language code. The program may be specially designed to implement the above-described method for modifying the code, or may be implemented using various functions or definitions known and available to those skilled in the art in the field of computer software. A program for implementing the above-described information display method may be recorded on a recording medium readable by a processor. At this time, the recording medium may be a memory included in the application code hiding device 100.

메모리는 전술한 동작 및 후술하는 동작을 수행하는 프로그램을 저장할 수 있으며, 메모리는 저장된 프로그램을 실행시킬 수 있다. 프로세서와 메모리가 복수인 경우에, 이들이 하나의 칩에 집적되는 것도 가능하고, 물리적으로 분리된 위치에 마련되는 것도 가능하다. 메모리는 데이터를 일시적으로 기억하기 위한 S램(Static Random Access Memory, S-RAM), D랩(Dynamic Random Access Memory) 등의 휘발성 메모리를 포함할 수 있다. 또한, 메모리는 제어 프로그램 및 제어 데이터를 장기간 저장하기 위한 롬(Read Only Memory), 이피롬(Erasable Programmable Read Only Memory: EPROM), 이이피롬(Electrically Erasable Programmable Read Only Memory: EEPROM) 등의 비휘발성 메모리를 포함할 수 있다.The memory can store programs that perform the operations described above and the operations described later, and the memory can execute the stored programs. In the case where there are multiple processors and memories, it is possible for them to be integrated into one chip or to be provided in physically separate locations. The memory may include volatile memory such as SRAM (Static Random Access Memory, S-RAM) and D-Lab (Dynamic Random Access Memory) for temporarily storing data. In addition, memory is non-volatile memory such as Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM), and Electrically Erasable Programmable Read Only Memory (EEPROM) for long-term storage of control programs and control data. may include.

프로세서는 각종 논리 회로와 연산 회로를 포함할 수 있으며, 메모리로부터 제공된 프로그램에 따라 데이터를 처리하고, 처리 결과에 따라 제어 신호를 생성할 수 있다.The processor may include various logic circuits and operation circuits, process data according to a program provided from memory, and generate control signals according to the processing results.

도 2는 일 실시예에 따른 보호 응용 프로그램 패키지의 생성 과정을 설명하기 위한 도면이다.Figure 2 is a diagram for explaining the creation process of a protected application package according to an embodiment.

도 2를 참조하면, 보호 응용 프로그램 패키지(300)의 소스 코드(210)에는 패딩 공간(301)이 포함되어 있음을 확인할 수 있다.Referring to FIG. 2, it can be seen that the source code 210 of the protected application package 300 includes a padding space 301.

보호 대상 코드(211)가 덮어씌워지기 전 또는 패딩 공간(301)이 생성될 때, 패딩 공간(301)의 바이너리 정보는 전부 0으로 구성될 수 있으나 이에 한정되는 것은 아니다.Before the code to be protected 211 is overwritten or when the padding space 301 is created, the binary information in the padding space 301 may consist of all 0s, but is not limited to this.

한편 패딩 공간(301)이 반드시 소스 코드(210)에서 하나의 위치에만 존재해야 하는 것은 아니다. 리팩부(140)는 복수의 패딩 공간(301)을 소스 코드(210)에 추가할 수 있다.Meanwhile, the padding space 301 does not necessarily have to exist in only one location in the source code 210. The repack unit 140 may add a plurality of padding spaces 301 to the source code 210.

코드 주입부(150)는 패딩 공간(301)에 보호 대상 코드(211)의 바이너리 정보를 덮어 씌워서 최종적인 형태의 보호 응용 프로그램 패키지(300)를 생성할 수 있다.The code injection unit 150 may generate the final form of the protected application package 300 by overwriting the padding space 301 with binary information of the code to be protected 211 .

이때, 패딩 공간(301)이 복수개의 위치에 존재할 경우, 보호 대상 코드(211)는 복수개의 패딩 공간(301) 중 어느 한 패딩 공간(301)에 덮어씌워질 수 있다.At this time, when the padding spaces 301 exist in a plurality of positions, the code to be protected 211 may be overwritten on any one of the plurality of padding spaces 301.

한편, 보호 대상 코드(211)가 소스 코드(210)의 어느 위치에 덧씌워졌는지 알아야 추후에 해당 보호 대상 코드(211)를 정당한 사용자가 이용할 수 있다.Meanwhile, it is necessary to know where the code to be protected 211 is overwritten in the source code 210 so that a legitimate user can use the code to be protected 211 in the future.

스텁 코드 생성부(130)는 보호 대상 코드(211)가 덮어씌워진 패딩 공간(301)의 배열 정보를 생성할 수 있다. 스텁 코드 생성부(130)는 배열 정보를 소스 코드(210)에 추가할 수 있다.The stub code generator 130 may generate arrangement information of the padding space 301 overlaid with the code to be protected 211 . The stub code generator 130 may add arrangement information to the source code 210.

공격자가 추출부(120)를 통하여 응용 프로그램 패키지를 압축 해제하면 해당 응용 프로그램 패키지에 포함되어 있던 실행 파일들이 추출된다. 이때, 중요 데이터에 관련된 소스 코드(210)는 보호 대상 코드(211)로서 패딩 공간(301)에 따로 보관되어 있기 때문에 실행 파일로서 추출되지 않을 수 있다.When an attacker decompresses an application package through the extractor 120, executable files included in the application package are extracted. At this time, the source code 210 related to important data may not be extracted as an executable file because it is stored separately in the padding space 301 as the code to be protected 211.

한편, 공격자가 아니라 애플리케이션의 정당한 사용자가 보호 대상 코드(211)의 데이터를 분석하고자 할 수도 있다. 즉, 사용자는 일반적인 실행 파일의 추출 방식이 아니라 다른 방식으로 보호 대상 코드(211)를 분석해야 할 수 있다.Meanwhile, a legitimate user of the application, not an attacker, may wish to analyze the data of the protected code 211. In other words, the user may need to analyze the protected code 211 in a different way than the general executable file extraction method.

애플리케이션 실행부는 보호 응용 프로그램 패키지(300)를 수신할 수 있다. 이때, 애플리케이션 실행부는 소스 코드(210)에 포함된 배열 정보도 함께 수신할 수 있다.The application execution unit may receive the protected application package 300. At this time, the application executing unit may also receive arrangement information included in the source code 210.

애플리케이션 실행부는 배열 정보를 기초로 보호 응용 프로그램 패키지(300)로부터 보호 대상 코드(211)를 추출할 수 있다.The application execution unit may extract the protection target code 211 from the protected application package 300 based on the arrangement information.

한편, 애플리케이션 실행부는 반드시 애플리케이션 코드 은닉 장치(100)에 포함되어야 하는 것은 아니다. 즉, 애플리케이션을 사용하려는 사용자의 단말에 애플리케이션 코드 은닉 장치(100)가 포함되지 않을 경우에는 애플리케이션 실행부는 사용자 단말에 마련되고, 애플리케이션 코드 은닉 장치(100)와는 별개로 동작할 수 있다.Meanwhile, the application execution unit does not necessarily have to be included in the application code hiding device 100. That is, when the application code hiding device 100 is not included in the terminal of the user who wants to use the application, the application execution unit is provided in the user terminal and can operate independently from the application code hiding device 100.

도 3은 일 실시예에 따른 코드 은닉 장치의 각 구성의 동작을 설명하기 위한 도면이다.Figure 3 is a diagram for explaining the operation of each component of the code hiding device according to an embodiment.

도 3을 참조하면, 추출부(120), 스텁 코드 생성부(130), 리팩부(140) 및 코드 주입부(150)에 의해서, 원본 응용 프로그램 패키지(200)를 기초로 보호 응용 프로그램 패키지(300)가 생성되는 과정을 확인할 수 있다.Referring to FIG. 3, a protected application package ( You can check the process by which 300) is created.

추출부(120)는 중요 데이터에 관련된 보호 대상 코드(211)를 따로 추출하고, 해당 보호 대상 코드(211)를 코드 주입부(150)로 전달할 수 있다.The extraction unit 120 may separately extract the protection target code 211 related to important data and transmit the protection target code 211 to the code injection unit 150.

스텁 코드 생성부(130)는 스텁 코드(Stub-code)를 생성할 수 있다. 스텁 코드는 패딩 공간(301)의 코드를 동적으로 로딩하는데 필요한 코드일 수 있다.The stub code generator 130 may generate a stub code. The stub code may be code required to dynamically load the code in the padding space 301.

스텁 코드 생성부(130)는 스텁 코드를 소스 코드(210)에 추가할 수 있다.The stub code generator 130 may add the stub code to the source code 210.

리팩부(140)는 추출된 보호 대상 코드(211)에 대한 실행 파일을 제외한 실행파일, 배열 정보 및 스텁 코드가 포함되도록 보호 응용 프로그램 패키지(300)를 생성할 수 있다.The repack unit 140 may generate the protected application package 300 to include an executable file excluding the executable file for the extracted code to be protected 211, arrangement information, and stub code.

이때, 보호 응용 프로그램 패키지(300)는 다수의 패딩 공간(301)을 가지도록 생성될 수 있다. 예를 들어, 보호 응용 프로그램 패키지(300)는 다수의 1024 Byte 크기의 패딩 공간(301)을 가질 수 있으나, 패딩 공간(301)의 크기가 이에 한정되는 것은 아니다.At this time, the protection application package 300 may be created to have a plurality of padding spaces 301. For example, the protected application package 300 may have a plurality of padding spaces 301 with a size of 1024 Bytes, but the size of the padding spaces 301 is not limited to this.

이상에서 설명된 구성요소들의 성능에 대응하여 적어도 하나의 구성요소가 추가되거나 삭제될 수 있다. 또한, 구성요소들의 상호 위치는 시스템의 성능 또는 구조에 대응하여 변경될 수 있다는 것은 당해 기술 분야에서 통상의 지식을 가진 자에게 용이하게 이해될 것이다.At least one component may be added or deleted in response to the performance of the components described above. Additionally, it will be easily understood by those skilled in the art that the mutual positions of the components may be changed in response to the performance or structure of the system.

도 4는 일 실시예에 따른 애플리케이션 코드 은닉 방법의 순서도이다. 이는 본 발명의 목적을 달성하기 위한 바람직한 실시예일 뿐이며, 필요에 따라 일부 구성이 추가되거나 삭제될 수 있음은 물론이다.Figure 4 is a flowchart of an application code hiding method according to one embodiment. This is only a preferred embodiment for achieving the purpose of the present invention, and of course, some components may be added or deleted as needed.

도 4를 참조하면, 입력부(110)는 적어도 하나 이상의 실행 파일이 포함된 원본 응용 프로그램 패키지(200)를 수신할 수 있다(1001).Referring to FIG. 4, the input unit 110 may receive an original application package 200 including at least one executable file (1001).

이때, 입력부(110)는 입력부(110)가 포함된 애플리케이션 코드 은닉 장치(100)의 다른 구성으로부터 원본 응용 프로그램 패키지(200)를 수신할 수도 있고, 코드 은닉 장치와 전혀 별개인 기기로부터 유선 또는 무선 통신을 통해 원본 응용 프로그램 패키지(200)를 수신할 수도 있다.At this time, the input unit 110 may receive the original application package 200 from another configuration of the application code hiding device 100 including the input unit 110, or may receive the original application package 200 by wire or wirelessly from a device completely separate from the code hiding device. The original application package 200 may be received through communication.

추출부(120)는 원본 응용 프로그램 패키지(200)를 압축 해제하여 보호 대상 코드(211)를 추출할 수 있다(1002).The extraction unit 120 may extract the code to be protected 211 by decompressing the original application package 200 (1002).

리팩부(140)는 어느 실행 파일에도 포함되지 않는 패딩 공간(301)을 원본 응용 프로그램 패키지(200)의 소스 코드(210)에 추가하여 보호 응용 프로그램 패키지(300)를 생성할 수 있다(1003). 이때, 리팩부(140)는 복수의 패딩 공간(301)을 각각 소스 코드(210)의 다양한 위치에 추가할 수 있다.The repack unit 140 may generate a protected application package 300 by adding a padding space 301, which is not included in any executable file, to the source code 210 of the original application package 200 (1003). . At this time, the repack unit 140 may add a plurality of padding spaces 301 to various positions of the source code 210, respectively.

코드 주입부(150)는 보호 응용 프로그램 패키지(300)의 패딩 공간(301)에 보호 대상 코드(211)의 바이너리 정보를 덮어씌워 보호 대상 코드(211)를 패딩 공간(301)에 저장할 수 있다(1004).The code injection unit 150 may store the code to be protected 211 in the padding space 301 by overwriting the binary information of the code to be protected 211 in the padding space 301 of the protected application package 300 ( 1004).

애플리케이션 실행부는 보호 응용 프로그램 패키지(300)를 수신하고, 배열 정보를 기초로 보호 응용 프로그램 패키지(300)로부터 보호 대상 코드(211)를 추출할 수 있다(1005).The application execution unit may receive the protected application package 300 and extract the code to be protected 211 from the protected application package 300 based on the arrangement information (1005).

이상에서와 같이 첨부된 도면을 참조하여 개시된 실시예들을 설명하였다. 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고도, 개시된 실시예들과 다른 형태로 본 발명이 실시될 수 있음을 이해할 것이다. 개시된 실시예들은 예시적인 것이며, 한정적으로 해석되어서는 안 된다.As described above, the disclosed embodiments have been described with reference to the attached drawings. A person skilled in the art to which the present invention pertains will understand that the present invention can be practiced in forms different from the disclosed embodiments without changing the technical idea or essential features of the present invention. The disclosed embodiments are illustrative and should not be construed as limiting.

100: 애플리케이션 코드 은닉 장치
110: 입력부
120: 추출부
130: 스텁 코드 생성부
140: 리팩부
150: 코드 주입부
200: 원본 응용 프로그램 패키지
210: 소스 코드
211: 보호 대상 코드
300: 보호 응용 프로그램 패키지
301: 패딩 공간
100: Application code hiding device
110: input unit
120: extraction unit
130: Stub code generation unit
140: Repack unit
150: Code injection unit
200: Original application package
210: source code
211: Protected code
300: Protection application package
301: padding space

Claims (10)

응용 프로그램 패키지의 소스 코드에 포함된 보호 대상 코드를 보호하기 위한 애플리케이션 코드 은닉 방법에 있어서,
입력부에 의해, 적어도 하나 이상의 실행 파일이 포함된 원본 응용 프로그램 패키지를 수신하는 단계;
추출부에 의해, 상기 원본 응용 프로그램 패키지를 압축 해제하여 상기 보호 대상 코드를 추출하는 단계;
리팩부에 의해, 어느 상기 실행 파일에도 포함되거나 대응되지 않는 공간이면서 소스 코드의 일부 코드 영역인 패딩 공간을 상기 원본 응용 프로그램 패키지의 소스 코드에 추가하여 보호 응용 프로그램 패키지를 생성하는 단계; 및
코드 주입부에 의해, 상기 보호 응용 프로그램 패키지의 패딩 공간에 상기 보호 대상 코드의 바이너리 정보를 덮어씌워 상기 보호 대상 코드를 상기 패딩 공간에 저장하는 단계;를 포함하고,
상기 보호 응용 프로그램 패키지를 생성하는 단계는,
상기 리팩부에 의해, 복수의 상기 패딩 공간을 상기 소스 코드에 추가하는 단계;를 포함하고,
상기 보호 대상 코드를 상기 패딩 공간에 저장하는 단계는,
스텁 코드 생성부에 의해, 상기 보호 대상 코드가 덮어씌워진 패딩 공간의 배열 정보를 생성하고, 상기 배열 정보를 상기 소스 코드에 추가하는 단계;를 포함하고,
애플리케이션 실행부에 의해, 상기 보호 응용 프로그램 패키지를 수신하고, 상기 배열 정보를 기초로 상기 보호 응용 프로그램 패키지로부터 상기 보호 대상 코드를 추출하는 단계;를 더 포함하는 애플리케이션 코드 은닉 방법.
In a method of hiding application code to protect protected code included in the source code of an application package,
Receiving, by an input unit, an original application package including at least one executable file;
extracting, by an extraction unit, the code to be protected by decompressing the original application package;
generating a protected application package by adding, by a repack unit, a padding space that is a space that is not included in or does not correspond to any of the executable files and is a partial code area of the source code to the source code of the original application package; and
Comprising: overwriting, by a code injection unit, binary information of the code to be protected on the padding space of the protected application package and storing the code to be protected in the padding space,
The step of creating the protected application package is,
A step of adding a plurality of the padding spaces to the source code by the repack unit,
The step of storing the code to be protected in the padding space includes:
Generating, by a stub code generation unit, arrangement information of a padding space overwritten with the code to be protected, and adding the arrangement information to the source code;
Receiving the protected application package, by an application executing unit, and extracting the protection target code from the protected application package based on the arrangement information.
삭제delete 삭제delete 제1항에 있어서,
상기 스텁 코드 생성부에 의해, 상기 패딩 공간의 코드를 동적으로 로딩하는데 필요한 스텁 코드를 생성하고, 상기 스텁 코드를 상기 소스 코드에 추가하는 단계;를 더 포함하고,
상기 보호 응용 프로그램 패키지를 생성하는 단계는,
상기 리팩부에 의해, 상기 추출된 보호 대상 코드에 대한 실행 파일을 제외한 실행파일, 상기 배열 정보 및 상기 스텁 코드가 포함되도록 상기 보호 응용 프로그램 패키지를 생성하는 단계;를 포함하는 애플리케이션 코드 은닉 방법.
According to paragraph 1,
It further includes generating, by the stub code generator, a stub code necessary for dynamically loading the code in the padding space, and adding the stub code to the source code,
The step of creating the protected application package is,
Generating, by the repack unit, the protected application package to include an executable file excluding the executable file for the extracted code to be protected, the arrangement information, and the stub code.
제1항에 있어서,
상기 응용 프로그램 패키지는, 안드로이드 플랫폼의 APK 파일을 포함하도록 구성되는, 애플리케이션 코드 은닉 방법.
According to paragraph 1,
The application code hiding method is configured to include an APK file of the Android platform.
제1항, 제4항 및 제5항 중 어느 한 항의 애플리케이션 코드 은닉 방법을 실행시키도록 컴퓨터로 판독 가능한 기록매체에 저장된 컴퓨터 프로그램.A computer program stored in a computer-readable recording medium to execute the application code hiding method of any one of claims 1, 4, and 5. 응용 프로그램 패키지의 소스 코드에 포함된 보호 대상 코드를 보호하기 위한 애플리케이션 코드 은닉 장치에 있어서,
적어도 하나 이상의 실행 파일이 포함된 원본 응용 프로그램 패키지를 수신하도록 구성되는 입력부;
상기 원본 응용 프로그램 패키지를 압축 해제하여 상기 보호 대상 코드를 추출하도록 구성되는 추출부;
어느 상기 실행 파일에도 포함되거나 대응되지 않는 공간이면서 소스 코드의 일부 코드 영역인 패딩 공간을 상기 원본 응용 프로그램 패키지의 소스 코드에 추가하여 보호 응용 프로그램 패키지를 생성하도록 구성되는 리팩부; 및
상기 보호 응용 프로그램 패키지의 패딩 공간에 상기 보호 대상 코드의 바이너리 정보를 덮어씌워 상기 보호 대상 코드를 상기 패딩 공간에 저장하도록 구성되는 코드 주입부;를 포함하고,
상기 리팩부는,
복수의 상기 패딩 공간을 상기 소스 코드에 추가하도록 구성되고,
상기 보호 대상 코드가 덮어씌워진 패딩 공간의 배열 정보를 생성하고, 상기 배열 정보를 상기 소스 코드에 추가하도록 구성되는 스텁 코드 생성부; 및
상기 보호 응용 프로그램 패키지를 수신하고, 상기 배열 정보를 기초로 상기 보호 응용 프로그램 패키지로부터 상기 보호 대상 코드를 추출하도록 구성되는 애플리케이션 실행부를 더 포함하는 애플리케이션 코드 은닉 장치.
In the application code hiding device for protecting the protected code included in the source code of the application package,
an input unit configured to receive an original application package including at least one executable file;
an extraction unit configured to extract the code to be protected by decompressing the original application package;
a repack unit configured to create a protected application package by adding a padding space, which is a space not included in or corresponding to any of the executable files and is a partial code area of the source code, to the source code of the original application package; and
A code injection unit configured to overwrite the padding space of the protected application package with binary information of the code to be protected and store the code to be protected in the padding space,
The repack unit,
configured to add a plurality of the padding spaces to the source code,
a stub code generator configured to generate arrangement information of a padding space overwritten with the code to be protected, and add the arrangement information to the source code; and
An application code hiding device further comprising an application executing unit configured to receive the protected application package and extract the protected code from the protected application package based on the arrangement information.
삭제delete 삭제delete 제7항에 있어서,
상기 스텁 코드 생성부는:
상기 패딩 공간의 코드를 동적으로 로딩하는데 필요한 스텁 코드를 생성하고; 그리고
상기 스텁 코드를 상기 소스 코드에 추가하도록 구성되고,
상기 리팩부는,
상기 추출된 보호 대상 코드에 대한 실행 파일을 제외한 실행파일, 상기 배열 정보 및 상기 스텁 코드가 포함되도록 상기 보호 응용 프로그램 패키지를 생성하도록 구성되는, 애플리케이션 코드 은닉 장치.
In clause 7,
The stub code generator:
generate stub code needed to dynamically load code in the padding space; and
configured to add the stub code to the source code,
The repack unit,
An application code hiding device, configured to generate the protected application package to include an executable file excluding the executable file for the extracted code to be protected, the arrangement information, and the stub code.
KR1020210116214A 2021-09-01 2021-09-01 Device for hiding application code, method for hiding application code and computer program stored in a recording medium to execute the method KR102615080B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210116214A KR102615080B1 (en) 2021-09-01 2021-09-01 Device for hiding application code, method for hiding application code and computer program stored in a recording medium to execute the method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210116214A KR102615080B1 (en) 2021-09-01 2021-09-01 Device for hiding application code, method for hiding application code and computer program stored in a recording medium to execute the method

Publications (2)

Publication Number Publication Date
KR20230033350A KR20230033350A (en) 2023-03-08
KR102615080B1 true KR102615080B1 (en) 2023-12-15

Family

ID=85508047

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210116214A KR102615080B1 (en) 2021-09-01 2021-09-01 Device for hiding application code, method for hiding application code and computer program stored in a recording medium to execute the method

Country Status (1)

Country Link
KR (1) KR102615080B1 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101521765B1 (en) * 2015-01-08 2015-05-20 숭실대학교산학협력단 Apparatus For Code Obfuscation Using Indistinguishable Identifier Conversion and Method Thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101638257B1 (en) * 2014-12-11 2016-07-20 단국대학교 산학협력단 Method for protecting source code of application and apparatus for performing the method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101521765B1 (en) * 2015-01-08 2015-05-20 숭실대학교산학협력단 Apparatus For Code Obfuscation Using Indistinguishable Identifier Conversion and Method Thereof

Also Published As

Publication number Publication date
KR20230033350A (en) 2023-03-08

Similar Documents

Publication Publication Date Title
US9535942B2 (en) Apparatus and method for managing APK file in an android platform
CN102598017B (en) Improve the system and method for its tamper-proof capabilities of Java bytecode
Coogan et al. Automatic static unpacking of malware binaries
CN106203006A (en) Android application reinforcement means based on dex Yu so file Dynamic Execution
CN110096853B (en) Unity android application reinforcement method based on Mono and storage medium
US20170024230A1 (en) Method, apparatus, and computer-readable medium for ofuscating execution of an application on a virtual machine
Faruki et al. Android code protection via obfuscation techniques: past, present and future directions
CN109598107B (en) Code conversion method and device based on application installation package file
WO2016135729A1 (en) A method to identify known compilers functions, libraries and objects inside files and data items containing an executable code
CN104318155A (en) Dynamic loading method capable of guarding against reverse APK file
CN112052433B (en) Virtual protection method, terminal and storage medium for Jar file
CN108133147B (en) Method and device for protecting executable code and readable storage medium
Suk et al. UnThemida: Commercial obfuscation technique analysis with a fully obfuscated program
KR101749209B1 (en) Method and apparatus for hiding information of application, and method and apparatus for executing application
KR102615080B1 (en) Device for hiding application code, method for hiding application code and computer program stored in a recording medium to execute the method
EP3574425B1 (en) Method to secure a software code
Nasim et al. Uncovering self code modification in Android
Lanet et al. Memory forensics of a java card dump
WO2016126206A1 (en) Method for obfuscation of code using return oriented programming
A. Mawgoud et al. A malware obfuscation AI technique to evade antivirus detection in counter forensic domain
Bouffard et al. Heap Hop! Heap Is Also Vulnerable
Gupta et al. A Survey: Vulnerabilities Present in PDF Files
Coogan Deobfuscation of packed and virtualization-obfuscation protected binaries
Younan et al. Protecting global and static variables from buffer overflow attacks
Lim et al. Mal-Xtract: hidden code extraction using memory analysis

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant