├── app ├── .gitignore ├── libs │ ├── jna.jar │ └── capstone.jar ├── src │ └── main │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── styles.xml │ │ │ ├── colors.xml │ │ │ └── strings.xml │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── drawable │ │ │ ├── circle.xml │ │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ │ ├── symbolsearchresult_activity.xml │ │ │ ├── fragment_disasm.xml │ │ │ ├── fragment_hexed.xml │ │ │ ├── fragment_symbol_list.xml │ │ │ ├── main_activity.xml │ │ │ ├── fragment_disasm_line.xml │ │ │ ├── fragment_applist_list.xml │ │ │ ├── disasm_activity.xml │ │ │ ├── dialog_savefile.xml │ │ │ ├── fragment_hexed_line.xml │ │ │ ├── fragment_filebrowser.xml │ │ │ ├── symbolsearchresult_entry.xml │ │ │ ├── fragment_symbolsearch_appentry.xml │ │ │ ├── dialog_easyassemble.xml │ │ │ ├── symbol_fragment.xml │ │ │ ├── fragment_applist.xml │ │ │ └── fragment_symbolsearch.xml │ │ ├── menu │ │ │ └── disassembler_menu.xml │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ └── values-de-rDE │ │ │ └── strings.xml │ │ ├── jniLibs │ │ └── armeabi-v7a │ │ │ ├── libcapstone.so │ │ │ └── libjnidispatch.so │ │ ├── java │ │ ├── de │ │ │ └── thwildau │ │ │ │ └── mpekar │ │ │ │ └── binarydroid │ │ │ │ ├── model │ │ │ │ ├── Architectures.java │ │ │ │ ├── SymbolItem.java │ │ │ │ ├── BinaryFile.java │ │ │ │ ├── Container.java │ │ │ │ └── ContainerELF.java │ │ │ │ ├── ui │ │ │ │ ├── disasm │ │ │ │ │ ├── ToolFragment.java │ │ │ │ │ ├── DisassemblerViewModel.java │ │ │ │ │ ├── SaveFileDialog.java │ │ │ │ │ ├── SymbolFragment.java │ │ │ │ │ ├── AssemblerDialog.java │ │ │ │ │ ├── SymbolRecyclerViewAdapter.java │ │ │ │ │ ├── HexEditorFragment.java │ │ │ │ │ └── DisassemblerFragment.java │ │ │ │ └── main │ │ │ │ │ ├── ActivityResult.java │ │ │ │ │ ├── InteractionListener.java │ │ │ │ │ ├── SymbolSearchResultActivity.java │ │ │ │ │ ├── BinaryListViewAdapter.java │ │ │ │ │ ├── BinaryListViewModel.java │ │ │ │ │ ├── SymbolSearchAppListAdapter.java │ │ │ │ │ ├── FileBrowserFragment.java │ │ │ │ │ └── BinaryListFragment.java │ │ │ │ ├── assembly │ │ │ │ ├── Assembler.java │ │ │ │ ├── oracleassembler │ │ │ │ │ ├── AssemblerError.java │ │ │ │ │ └── AssemblerException.java │ │ │ │ ├── Disassembler.java │ │ │ │ ├── DisassemblerCapstone.java │ │ │ │ └── ByteAccessor.java │ │ │ │ ├── AestheticColorGenerator.java │ │ │ │ ├── SymbolSearchInterface.java │ │ │ │ ├── Utils.java │ │ │ │ ├── ContentResolver.java │ │ │ │ ├── SymbolSearcher.java │ │ │ │ └── MainActivity.java │ │ └── net │ │ │ └── fornwall │ │ │ └── jelf │ │ │ ├── ElfException.java │ │ │ ├── MemoizedObject.java │ │ │ ├── ElfStringTable.java │ │ │ ├── Main.java │ │ │ ├── ElfHashTable.java │ │ │ ├── ElfParser.java │ │ │ ├── ElfSymbol.java │ │ │ ├── ElfSegment.java │ │ │ └── ElfDynamicStructure.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitmodules ├── .idea ├── vcs.xml ├── runConfigurations.xml ├── gradle.xml ├── codeStyles │ └── Project.xml └── misc.xml ├── .gitignore ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/libs/jna.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/libs/jna.jar -------------------------------------------------------------------------------- /app/libs/capstone.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/libs/capstone.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libcapstone.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/jniLibs/armeabi-v7a/libcapstone.so -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libjnidispatch.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/jniLibs/armeabi-v7a/libjnidispatch.so -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mipek/binarydroid/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "capstone"] 2 | path = capstone 3 | url = https://github.com/aquynh/capstone.git 4 | [submodule "jna"] 5 | path = jna 6 | url = https://github.com/twall/jna.git 7 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches/build_file_checksums.ser 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | .DS_Store 9 | /build 10 | /captures 11 | .externalNativeBuild 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/model/Architectures.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid.model; 2 | 3 | /** 4 | * Enumerates all architectures that are supported. 5 | */ 6 | public enum Architectures { 7 | ARM, 8 | ARM64, // sometimes referred to as "AArch64" 9 | X86, 10 | AMD64, 11 | Unknown 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #d81b60 6 | #3ac2eb 7 | #424242 8 | #ebebeb 9 | #788a8a8a 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/symbolsearchresult_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_disasm.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_hexed.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/ui/disasm/ToolFragment.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid.ui.disasm; 2 | 3 | import android.support.v4.app.Fragment; 4 | 5 | /** 6 | * Encapsulates a disassembler tool. 7 | */ 8 | public class ToolFragment extends Fragment { 9 | public static final int CMD_REFRESHVIEW = 1; 10 | 11 | /** 12 | * Fired when the disassembler communicates with a fragment 13 | */ 14 | public void onRunCommand(int commandId) { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/ui/main/ActivityResult.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid.ui.main; 2 | 3 | import java.util.List; 4 | 5 | import de.thwildau.mpekar.binarydroid.SymbolSearchInterface; 6 | 7 | /** 8 | * This is used to pass large data between different activities, as recommended in 9 | * the android developer guide: 10 | * http://wing-linux.sourceforge.net/guide/appendix/faq/framework.html#3 11 | */ 12 | class ActivityResult { 13 | static List symbolSearchResults; 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/assembly/Assembler.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid.assembly; 2 | 3 | import de.thwildau.mpekar.binarydroid.assembly.oracleassembler.AssemblerException; 4 | 5 | public interface Assembler { 6 | /** 7 | * Assemble a single line of code 8 | * @param assembly Code that is to be assembled 9 | * @param address Assembling address 10 | * @return Bytes of the assembled instruction or null on error. 11 | */ 12 | byte [] assembleSingle(String assembly, long address) throws AssemblerException; 13 | } 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/assembly/oracleassembler/AssemblerError.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid.assembly.oracleassembler; 2 | 3 | /** 4 | * Enumerates all possible assembler error types 5 | */ 6 | public enum AssemblerError { 7 | LookupFailed, // "invalid syntax, tried to lookup: X" 8 | FailureLimitReached, // "failure limit reached" 9 | CannotAssemble, //"cannot assemble, valid operands?" 10 | UnterminatedRegisterList, //"unterminated register list" 11 | UnexpectedChar, // "unexpected character at: X (original input: Y) 12 | UnrecognizedToken, // "unrecognized token: X (original input: Y) 13 | InvalidRegister // invalid register: + reg 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/ui/main/InteractionListener.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid.ui.main; 2 | 3 | 4 | import de.thwildau.mpekar.binarydroid.model.BinaryFile; 5 | 6 | /** 7 | * This interface provides to ability to interact with other fragments/activities. 8 | */ 9 | public interface InteractionListener { 10 | /** 11 | * Called when the user selects a binary file (from a installed application) 12 | * @param item selected binary file 13 | */ 14 | void onSelectBinaryFile(BinaryFile item); 15 | 16 | /** 17 | * Called when the user tries to open a file from a file path 18 | * @param path path to the file 19 | */ 20 | void onSelectFilePath(String path); 21 | } -------------------------------------------------------------------------------- /app/src/main/java/net/fornwall/jelf/ElfException.java: -------------------------------------------------------------------------------- 1 | package net.fornwall.jelf; 2 | 3 | /** 4 | * Generic exception class for all exceptions which occur in this package. Since 5 | * there is no mechanism built into this library for recovering from errors, the 6 | * best clients can do is display the error string. 7 | */ 8 | @SuppressWarnings("all") 9 | public class ElfException extends RuntimeException { 10 | 11 | private static final long serialVersionUID = 1L; 12 | 13 | public ElfException(String message) { 14 | super(message); 15 | } 16 | 17 | public ElfException(Throwable cause) { 18 | super(cause); 19 | } 20 | 21 | public ElfException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/res/menu/disassembler_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 14 | 17 | 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_symbol_list.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/AestheticColorGenerator.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid; 2 | 3 | 4 | import android.graphics.Color; 5 | 6 | import java.util.Random; 7 | 8 | /** 9 | * Generates random colors. 10 | */ 11 | public class AestheticColorGenerator { 12 | private Random random = new Random(); 13 | 14 | public int generateRandomColor() { 15 | return mixColor(255, 255, 255); 16 | } 17 | 18 | // https://stackoverflow.com/a/43235 19 | private int mixColor(int r, int g, int b) { 20 | int red = random.nextInt(256); 21 | int green = random.nextInt(256); 22 | int blue = random.nextInt(256); 23 | 24 | // mix the color 25 | red = (red + r) / 2; 26 | green = (green + g) / 2; 27 | blue = (blue + b) / 2; 28 | 29 | return Color.rgb(red, green, blue); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/net/fornwall/jelf/MemoizedObject.java: -------------------------------------------------------------------------------- 1 | package net.fornwall.jelf; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * A memoized object. Override {@link #computeValue} in subclasses; call {@link #getValue} in using code. 7 | */ 8 | @SuppressWarnings("all") 9 | abstract class MemoizedObject { 10 | private boolean computed; 11 | private T value; 12 | 13 | /** 14 | * Should compute the value of this memoized object. This will only be called once, upon the first call to 15 | * {@link #getValue}. 16 | */ 17 | protected abstract T computeValue() throws ElfException, IOException; 18 | 19 | /** Public accessor for the memoized value. */ 20 | public final T getValue() throws ElfException, IOException { 21 | if (!computed) { 22 | value = computeValue(); 23 | computed = true; 24 | } 25 | return value; 26 | } 27 | 28 | @SuppressWarnings("unchecked") 29 | public static MemoizedObject[] uncheckedArray(int size) { 30 | return new MemoizedObject[size]; 31 | } 32 | } -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | applicationId "de.thwildau.mpekar.binarydroid" 7 | minSdkVersion 18 8 | targetSdkVersion 27 9 | versionCode 1 10 | versionName "1.0" 11 | } 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 16 | } 17 | } 18 | } 19 | 20 | dependencies { 21 | implementation fileTree(include: ['*.jar'], dir: 'libs') 22 | implementation 'com.android.support:appcompat-v7:27.1.1' 23 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 24 | implementation 'android.arch.lifecycle:extensions:1.1.1' 25 | implementation 'com.android.support:support-v4:27.1.1' 26 | implementation 'com.android.support:recyclerview-v7:27.1.1' 27 | implementation 'com.chrisplus.rootmanager:library:2.0.5@aar' 28 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_disasm_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 17 | 18 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/net/fornwall/jelf/ElfStringTable.java: -------------------------------------------------------------------------------- 1 | package net.fornwall.jelf; 2 | 3 | import java.io.IOException; 4 | 5 | @SuppressWarnings("all") 6 | public final class ElfStringTable { 7 | 8 | /** The string table data. */ 9 | private final byte data[]; 10 | public final int numStrings; 11 | 12 | /** Reads all the strings from [offset, length]. */ 13 | ElfStringTable(ElfParser parser, long offset, int length) throws ElfException, IOException { 14 | parser.seek(offset); 15 | data = new byte[length]; 16 | int bytesRead = parser.read(data); 17 | if (bytesRead != length) 18 | throw new ElfException("Error reading string table (read " + bytesRead + "bytes - expected to " + "read " + data.length + "bytes)"); 19 | 20 | int stringsCount = 0; 21 | for (int ptr = 0; ptr < data.length; ptr++) 22 | if (data[ptr] == '\0') stringsCount++; 23 | numStrings = stringsCount; 24 | } 25 | 26 | public String get(int index) { 27 | int startPtr = index; 28 | int endPtr = index; 29 | while (data[endPtr] != '\0') 30 | endPtr++; 31 | return new String(data, startPtr, endPtr - startPtr); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/assembly/oracleassembler/AssemblerException.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid.assembly.oracleassembler; 2 | 3 | public class AssemblerException extends Throwable { 4 | 5 | private AssemblerError error; 6 | private String x; 7 | private String y; 8 | 9 | public AssemblerException(AssemblerError error) { 10 | this.error = error; 11 | } 12 | public AssemblerException(AssemblerError error, String x) { 13 | this.error = error; 14 | this.x = x; 15 | } 16 | public AssemblerException(AssemblerError error, String x, String y) { 17 | this.error = error; 18 | this.x = x; 19 | this.y = y; 20 | } 21 | 22 | public AssemblerError getErrorType() { 23 | return error; 24 | } 25 | 26 | public String getX() { 27 | return x; 28 | } 29 | 30 | public String getY() { 31 | return y; 32 | } 33 | 34 | @Override 35 | public String toString() { 36 | return "AssemblerException{" + 37 | "error='" + getErrorType() + '\'' + 38 | '}'; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/de/thwildau/mpekar/binarydroid/model/SymbolItem.java: -------------------------------------------------------------------------------- 1 | package de.thwildau.mpekar.binarydroid.model; 2 | 3 | /** 4 | * Describes a single symbol. 5 | */ 6 | public class SymbolItem { 7 | /**< Symbol identifier */ 8 | public final String name; 9 | /**< Symbol address */ 10 | public final long addr; 11 | 12 | public SymbolItem(String name, long addr) { 13 | this.name = name; 14 | this.addr = addr; 15 | } 16 | 17 | @Override 18 | public boolean equals(Object o) { 19 | if (this == o) return true; 20 | if (o == null || getClass() != o.getClass()) return false; 21 | 22 | SymbolItem that = (SymbolItem) o; 23 | 24 | if (addr != that.addr) return false; 25 | return name != null ? name.equals(that.name) : that.name == null; 26 | } 27 | 28 | @Override 29 | public int hashCode() { 30 | int result = name != null ? name.hashCode() : 0; 31 | result = 31 * result + (int) (addr ^ (addr >>> 32)); 32 | return result; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return name + " @ " + Long.toHexString(addr); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_applist_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 |