日岳如流
发表于 2015-5-1 17:23:07
谢谢分享,虽然看不懂@_@
bawffg
发表于 2015-5-5 14:00:40
lz,请问JAVA伪加密怎么实现?
lh007
发表于 2015-5-5 16:04:46
q2062_858786懂免杀的。来挣钱了
huluxia
发表于 2015-5-5 19:50:01
赞一个。学习了
七少月
发表于 2015-5-7 01:26:34
bawffg 发表于 2015-5-5 14:00
lz,请问JAVA伪加密怎么实现?
不好意思,现在才有时间回复,{:5_122:} Java伪加密和安卓上的java伪加密有不同,但也有类似之处,都可以使用zip使其看起来好像被压缩加密了,现把看雪的代码粘帖上来:
package com.rover12421.apkutil;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.Arrays;
import java.util.zip.ZipError;
import static com.rover12421.apkutil.ZipConstants.*;
public class ApkUtilTool {
private FileChannel ch; // channel to the zipfile
private FileChannel fc;
/**
* 修复zip伪加密状态的Entry
* @param inZip
* @param storeZip
* @throws IOException
*/
public void FixEncryptedEntry(File inZip, File fixZip) throws IOException {
changEntry(inZip, fixZip, true);
}
/**
* 修复zip伪加密状态的Entry
* @param inZip
* @param storeZip
* @throws IOException
*/
public void FixEncryptedEntry(String inZip, String fixZip) throws IOException {
FixEncryptedEntry(new File(inZip), new File(fixZip));
}
/**
* 修改zip的Entry为伪加密状态
* @param inZip
* @param storeZip
* @throws IOException
*/
public void ChangToEncryptedEntry(File inZip, File storeZip) throws IOException {
changEntry(inZip, storeZip, false);
}
/**
* 修改zip的Entry为伪加密状态
* @param inZip
* @param storeZip
* @throws IOException
*/
public void ChangToEncryptedEntry(String inZip, String storeZip) throws IOException {
ChangToEncryptedEntry(new File(inZip), new File(storeZip));
}
/**
* 更改zip的Entry为伪加密状态
* @param inZip
* @param storeZip
* @param fixture:修复伪加密 false:更改到伪加密
* @throws IOException
*/
private void changEntry(File inZip, File storeZip, boolean fix) throws IOException {
FileInputStream fis = new FileInputStream(inZip);
FileOutputStream fos = new FileOutputStream(storeZip);
byte[] buf = new byte;
int len;
while ((len = fis.read(buf)) != -1) {
fos.write(buf, 0, len);
}
ch = fis.getChannel();
fc = fos.getChannel();
changEntry(fix);
ch.close();
fc.close();
fis.close();
fos.close();
}
// Reads zip file central directory. Returns the file position of first
// CEN header, otherwise returns -1 if an error occured. If zip->msg != NULL
// then the error was a zip format error and zip->msg has the error text.
// Always pass in -1 for knownTotal; it's used for a recursive call.
private void changEntry(boolean fix) throws IOException {
END end = findEND();
if (end.cenlen > end.endpos)
zerror("invalid END header (bad central directory size)");
long cenpos = end.endpos - end.cenlen; // position of CEN table
// Get position of first local file (LOC) header, taking into
// account that there may be a stub prefixed to the zip file.
long locpos = cenpos - end.cenoff;
if (locpos < 0)
zerror("invalid END header (bad central directory offset)");
// read in the CEN and END
byte[] cen = new byte[(int)(end.cenlen + ENDHDR)];
if (readFullyAt(cen, 0, cen.length, cenpos) != end.cenlen + ENDHDR) {
zerror("read CEN tables failed");
}
int pos = 0;
int limit = cen.length - ENDHDR;
while (pos < limit) {
if (CENSIG(cen, pos) != CENSIG)
zerror("invalid CEN header (bad signature)");
int method = CENHOW(cen, pos);
int nlen = CENNAM(cen, pos);
int elen = CENEXT(cen, pos);
int clen = CENCOM(cen, pos);
if (fix) {
if ((CEN***(cen, pos) & 1) != 0) {
byte[] name = Arrays.copyOfRange(cen, pos + CENHDR, pos + CENHDR + nlen);
System.out.println("Found the encrypted entry : " + new String(name) + ", fix...");
//b & 0xff) | ((b & 0xff) << 8
cen &= 0xFE;
//
小白
发表于 2015-5-9 07:52:17
看了,楼主说免杀问题,{:5_122:},以前测试了吧dex文件加密后放到外部加载亦可以达到免杀的效果{:5_124:}
Visidors
发表于 2015-5-12 14:55:17
大神,第四点的文章在哪呢,小弟正好需要,求链接。。。。。
B6B6B6
发表于 2015-5-13 12:25:39
涨姿势了!感谢楼主!
FindAllBlue
发表于 2015-5-13 17:50:02
谢谢分享
y1.岁拽起
发表于 2015-7-26 12:20:04