Skip to content

Commit

Permalink
Release 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WebDucerBlog committed Jul 20, 2020
1 parent ed5882c commit 0fd44ce
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.github.zhkl0228</groupId>
<artifactId>unidbg-parent</artifactId>
<packaging>pom</packaging>
<version>0.5.0</version>
<version>0.6.0</version>
<modules>
<module>unidbg-api</module>
<module>unidbg-android</module>
Expand Down
6 changes: 3 additions & 3 deletions unidbg-android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<parent>
<groupId>com.github.zhkl0228</groupId>
<artifactId>unidbg-parent</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>unidbg-android</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.0</version>
<dependencies>
<dependency>
<groupId>com.github.zhkl0228</groupId>
<artifactId>unidbg-api</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.0</version>
</dependency>
<dependency>
<groupId>net.dongliu</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public void hook(Unicorn u, int intno, Object user) {
u.reg_write(ArmConst.UC_ARM_REG_R0, tkill(emulator));
return;
case 240:
u.reg_write(ArmConst.UC_ARM_REG_R0, futex(u, emulator));
u.reg_write(ArmConst.UC_ARM_REG_R0, futex(emulator));
return;
case 248:
exit_group(emulator);
Expand Down Expand Up @@ -1729,10 +1729,11 @@ private int writev(Unicorn u, Emulator<?> emulator) {
private static final int FUTEX_WAIT = 0;
private static final int FUTEX_WAKE = 1;

private int futex(Unicorn u, Emulator<?> emulator) {
Pointer uaddr = UnicornPointer.register(emulator, ArmConst.UC_ARM_REG_R0);
int futex_op = ((Number) u.reg_read(ArmConst.UC_ARM_REG_R1)).intValue();
int val = ((Number) u.reg_read(ArmConst.UC_ARM_REG_R2)).intValue();
private int futex(Emulator<?> emulator) {
RegisterContext context = emulator.getContext();
Pointer uaddr = context.getPointerArg(0);
int futex_op = context.getIntArg(1);
int val = context.getIntArg(2);
int old = uaddr.getInt(0);
if (log.isDebugEnabled()) {
log.debug("futex uaddr=" + uaddr + ", _futexop=" + futex_op + ", op=" + (futex_op & 0x7f) + ", val=" + val + ", old=" + old);
Expand All @@ -1743,7 +1744,8 @@ private int futex(Unicorn u, Emulator<?> emulator) {
if (old != val) {
throw new IllegalStateException("old=" + old + ", val=" + val);
}
Pointer timeout = UnicornPointer.register(emulator, ArmConst.UC_ARM_REG_R3);
Thread.yield();
Pointer timeout = context.getPointerArg(3);
int mytype = val & 0xc000;
int shared = val & 0x2000;
if (log.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void hook(Unicorn u, int intno, Object user) {
u.reg_write(ArmConst.UC_ARM_REG_R0, fchmod(u));
return;
case 98:
u.reg_write(Arm64Const.UC_ARM64_REG_X0, futex(u, emulator));
u.reg_write(Arm64Const.UC_ARM64_REG_X0, futex(emulator));
return;
case 103888:
u.reg_write(ArmConst.UC_ARM_REG_R0, syslog(u, emulator));
Expand Down Expand Up @@ -1511,10 +1511,11 @@ private int writev(Emulator<?> emulator) {
private static final int FUTEX_WAIT = 0;
private static final int FUTEX_WAKE = 1;

private int futex(Unicorn u, Emulator<?> emulator) {
Pointer uaddr = UnicornPointer.register(emulator, Arm64Const.UC_ARM64_REG_X0);
int futex_op = ((Number) u.reg_read(Arm64Const.UC_ARM64_REG_X1)).intValue();
int val = ((Number) u.reg_read(Arm64Const.UC_ARM64_REG_X2)).intValue();
private int futex(Emulator<?> emulator) {
RegisterContext context = emulator.getContext();
Pointer uaddr = context.getPointerArg(0);
int futex_op = context.getIntArg(1);
int val = context.getIntArg(2);
int old = uaddr.getInt(0);
if (log.isDebugEnabled()) {
log.debug("futex uaddr=" + uaddr + ", _futexop=" + futex_op + ", op=" + (futex_op & 0x7f) + ", val=" + val + ", old=" + old);
Expand All @@ -1525,7 +1526,8 @@ private int futex(Unicorn u, Emulator<?> emulator) {
if (old != val) {
throw new IllegalStateException("old=" + old + ", val=" + val);
}
Pointer timeout = UnicornPointer.register(emulator, Arm64Const.UC_ARM64_REG_X3);
Thread.yield();
Pointer timeout = context.getPointerArg(3);
int mytype = val & 0xc000;
int shared = val & 0x2000;
if (log.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.security.cert.CertificateException;
import java.util.*;

public abstract class BaseVM implements VM {
public abstract class BaseVM implements VM, DvmClassFactory {

private static final Log log = LogFactory.getLog(BaseVM.class);

Expand Down Expand Up @@ -83,14 +83,19 @@ public final DvmClass resolveClass(String className, DvmClass... interfaceClasse
dvmClass = dvmClassFactory.createClass(this, className, interfaceClasses);
}
if (dvmClass == null) {
dvmClass = new DvmClass(this, className, interfaceClasses);
dvmClass = this.createClass(this, className, interfaceClasses);
}
classMap.put(hash, dvmClass);
addObject(dvmClass, true);
}
return dvmClass;
}

@Override
public DvmClass createClass(BaseVM vm, String className, DvmClass[] interfaceClasses) {
return new DvmClass(vm, className, interfaceClasses);
}

final int addObject(DvmObject<?> object, boolean global) {
if (object == null) {
return 0;
Expand Down
4 changes: 2 additions & 2 deletions unidbg-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>com.github.zhkl0228</groupId>
<artifactId>unidbg-parent</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>unidbg-api</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.0</version>
<dependencies>
<dependency>
<groupId>com.github.zhkl0228</groupId>
Expand Down
6 changes: 3 additions & 3 deletions unidbg-ios/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<parent>
<groupId>com.github.zhkl0228</groupId>
<artifactId>unidbg-parent</artifactId>
<version>0.5.0</version>
<version>0.6.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>unidbg-ios</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.0</version>
<dependencies>
<dependency>
<groupId>com.github.zhkl0228</groupId>
<artifactId>unidbg-api</artifactId>
<version>0.6.0-SNAPSHOT</version>
<version>0.6.0</version>
</dependency>
<dependency>
<groupId>io.kaitai</groupId>
Expand Down

0 comments on commit 0fd44ce

Please sign in to comment.