예제 #1
0
  @Override
  public void unresolve(Memory mem) {
    if (hasSavedValue) {
      mem.write32(getImportAddress(), savedValue);
    }

    if (sourceModule != null) {
      // Add this stub back to the list of unresolved imports from the source module
      sourceModule.unresolvedImports.add(this);
    }
  }
예제 #2
0
  @Override
  public void resolve(Memory mem, int address) {
    if (!hasSavedValue) {
      savedValue = mem.read32(getImportAddress());
      hasSavedValue = true;
    }

    // Perform a R_MIPS_32 relocation

    // Retrieve the current 32bit value
    int value = mem.read32(getImportAddress());

    // Relocate the value
    value += address;

    // Write back the relocated 32bit value
    mem.write32(getImportAddress(), value);
  }
  public int sceKernelDeleteLwMutex(int workAreaAddr) {
    Memory mem = Processor.memory;

    int uid = mem.read32(workAreaAddr);

    if (log.isDebugEnabled()) {
      log.debug("sceKernelDeleteLwMutex (workAreaAddr='" + Integer.toHexString(workAreaAddr) + ")");
    }

    SceKernelLwMutexInfo info = lwMutexMap.remove(uid);
    if (info == null) {
      log.warn("sceKernelDeleteLwMutex unknown UID " + Integer.toHexString(uid));
      return ERROR_KERNEL_LWMUTEX_NOT_FOUND;
    }

    mem.write32(workAreaAddr, 0); // Clear uid.
    onLwMutexDeleted(uid);

    return 0;
  }