com.android.reverse.util.NativeFunction Java Examples

The following examples show how to use com.android.reverse.util.NativeFunction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NativeHookCollecter.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public void init() {
	if(initSysLinkInfo == null)
		initSysLinkInfo = NativeFunction.getSyslinkSnapshot();
}
 
Example #2
Source File: NativeHookCollecter.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public void parserNativeHookInfo() {
	Logger.log("The parser native hook info start");
	if (initSysLinkInfo == null) {
		Logger.log("the init syslink info == null");
		return;
	}

	int hookcount =0;
	HashMap<String, HashMap<String, Integer>> currentInfo = NativeFunction
			.getSyslinkSnapshot();
	Iterator<String> libkeys = currentInfo.keySet().iterator();
	HashMap<String, Integer> currentlinks;
	HashMap<String, Integer> initlinks;
	while (libkeys.hasNext()) {
		String libName = libkeys.next();
		if (initSysLinkInfo.containsKey(libName)) {
			currentlinks = currentInfo.get(libName);
			initlinks = initSysLinkInfo.get(libName);
			Iterator<String> sysNamekeys = currentlinks.keySet().iterator();
			while (sysNamekeys.hasNext()) {
				String sysName = sysNamekeys.next();
				if (initlinks.containsKey(sysName)) {
					int currentAddr = currentlinks.get(sysName);
					int initAddr = initlinks.get(sysName);
					if (currentAddr != initAddr) {
						Logger.log("The " + libName + " syslink:" + sysName
								+ " oldAddr:" + initAddr + " newAddr:"
								+ currentAddr);
						hookcount++;
					} 
					
				}
			}
		}
	}
	if(hookcount == 0 ){
		Logger.log("the app can't hook native function");
	}else{
		Logger.log("The app total hook native function = "+hookcount);
	}
	Logger.log("The parser native hook info end");
}
 
Example #3
Source File: MemDump.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public static void dumpMem(OutputStream outstream, int start, int length) {
	ByteBuffer buffer = NativeFunction.dumpMemory(start, length);
	saveByteBuffer(outstream, buffer);

}
 
Example #4
Source File: NativeHookCollecter.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
public void init() {
	if(initSysLinkInfo == null)
		initSysLinkInfo = NativeFunction.getSyslinkSnapshot();
}
 
Example #5
Source File: NativeHookCollecter.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
public void parserNativeHookInfo() {
	Logger.log("The parser native hook info start");
	if (initSysLinkInfo == null) {
		Logger.log("the init syslink info == null");
		return;
	}

	int hookcount =0;
	HashMap<String, HashMap<String, Integer>> currentInfo = NativeFunction
			.getSyslinkSnapshot();
	Iterator<String> libkeys = currentInfo.keySet().iterator();
	HashMap<String, Integer> currentlinks;
	HashMap<String, Integer> initlinks;
	while (libkeys.hasNext()) {
		String libName = libkeys.next();
		if (initSysLinkInfo.containsKey(libName)) {
			currentlinks = currentInfo.get(libName);
			initlinks = initSysLinkInfo.get(libName);
			Iterator<String> sysNamekeys = currentlinks.keySet().iterator();
			while (sysNamekeys.hasNext()) {
				String sysName = sysNamekeys.next();
				if (initlinks.containsKey(sysName)) {
					int currentAddr = currentlinks.get(sysName);
					int initAddr = initlinks.get(sysName);
					if (currentAddr != initAddr) {
						Logger.log("The " + libName + " syslink:" + sysName
								+ " oldAddr:" + initAddr + " newAddr:"
								+ currentAddr);
						hookcount++;
					} 
					
				}
			}
		}
	}
	if(hookcount == 0 ){
		Logger.log("the app can't hook native function");
	}else{
		Logger.log("The app total hook native function = "+hookcount);
	}
	Logger.log("The parser native hook info end");
}
 
Example #6
Source File: MemDump.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
public static void dumpMem(OutputStream outstream, int start, int length) {
	ByteBuffer buffer = NativeFunction.dumpMemory(start, length);
	saveByteBuffer(outstream, buffer);

}
 
Example #7
Source File: NativeHookCollecter.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
public void init() {
	if(initSysLinkInfo == null)
		initSysLinkInfo = NativeFunction.getSyslinkSnapshot();
}
 
Example #8
Source File: NativeHookCollecter.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
public void parserNativeHookInfo() {
	Logger.log("The parser native hook info start");
	if (initSysLinkInfo == null) {
		Logger.log("the init syslink info == null");
		return;
	}

	int hookcount =0;
	HashMap<String, HashMap<String, Integer>> currentInfo = NativeFunction
			.getSyslinkSnapshot();
	Iterator<String> libkeys = currentInfo.keySet().iterator();
	HashMap<String, Integer> currentlinks;
	HashMap<String, Integer> initlinks;
	while (libkeys.hasNext()) {
		String libName = libkeys.next();
		if (initSysLinkInfo.containsKey(libName)) {
			currentlinks = currentInfo.get(libName);
			initlinks = initSysLinkInfo.get(libName);
			Iterator<String> sysNamekeys = currentlinks.keySet().iterator();
			while (sysNamekeys.hasNext()) {
				String sysName = sysNamekeys.next();
				if (initlinks.containsKey(sysName)) {
					int currentAddr = currentlinks.get(sysName);
					int initAddr = initlinks.get(sysName);
					if (currentAddr != initAddr) {
						Logger.log("The " + libName + " syslink:" + sysName
								+ " oldAddr:" + initAddr + " newAddr:"
								+ currentAddr);
						hookcount++;
					} 
					
				}
			}
		}
	}
	if(hookcount == 0 ){
		Logger.log("the app can't hook native function");
	}else{
		Logger.log("The app total hook native function = "+hookcount);
	}
	Logger.log("The parser native hook info end");
}
 
Example #9
Source File: MemDump.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
public static void dumpMem(OutputStream outstream, int start, int length) {
	ByteBuffer buffer = NativeFunction.dumpMemory(start, length);
	saveByteBuffer(outstream, buffer);

}
 
Example #10
Source File: NativeHookCollecter.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public void init() {
	if(initSysLinkInfo == null)
		initSysLinkInfo = NativeFunction.getSyslinkSnapshot();
}
 
Example #11
Source File: NativeHookCollecter.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public void parserNativeHookInfo() {
	Logger.log("The parser native hook info start");
	if (initSysLinkInfo == null) {
		Logger.log("the init syslink info == null");
		return;
	}

	int hookcount =0;
	HashMap<String, HashMap<String, Integer>> currentInfo = NativeFunction
			.getSyslinkSnapshot();
	Iterator<String> libkeys = currentInfo.keySet().iterator();
	HashMap<String, Integer> currentlinks;
	HashMap<String, Integer> initlinks;
	while (libkeys.hasNext()) {
		String libName = libkeys.next();
		if (initSysLinkInfo.containsKey(libName)) {
			currentlinks = currentInfo.get(libName);
			initlinks = initSysLinkInfo.get(libName);
			Iterator<String> sysNamekeys = currentlinks.keySet().iterator();
			while (sysNamekeys.hasNext()) {
				String sysName = sysNamekeys.next();
				if (initlinks.containsKey(sysName)) {
					int currentAddr = currentlinks.get(sysName);
					int initAddr = initlinks.get(sysName);
					if (currentAddr != initAddr) {
						Logger.log("The " + libName + " syslink:" + sysName
								+ " oldAddr:" + initAddr + " newAddr:"
								+ currentAddr);
						hookcount++;
					} 
					
				}
			}
		}
	}
	if(hookcount == 0 ){
		Logger.log("the app can't hook native function");
	}else{
		Logger.log("The app total hook native function = "+hookcount);
	}
	Logger.log("The parser native hook info end");
}
 
Example #12
Source File: MemDump.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public static void dumpMem(OutputStream outstream, int start, int length) {
	ByteBuffer buffer = NativeFunction.dumpMemory(start, length);
	saveByteBuffer(outstream, buffer);

}