修复64位无法dump

pull/2/head
Milk 4 years ago
parent 797a245d5d
commit 551a16e36d
  1. 4
      Bcore/src/main/jni/DexDump.cpp

@ -64,9 +64,10 @@ void DexDump::dumpDex(JNIEnv *env, jlong cookie, jstring dir) {
auto dirC = env->GetStringUTFChars(dir, 0);
auto dexSizeOffset = ((unsigned long ) begin) + 0x20;
size_t size = *(size_t *) dexSizeOffset;
int size = *(size_t *) dexSizeOffset;
auto buffer = malloc(size);
if (buffer) {
memcpy(buffer, reinterpret_cast<const void *>(begin), size);
// fix magic
memcpy(buffer, magic, sizeof(magic));
@ -85,3 +86,4 @@ void DexDump::dumpDex(JNIEnv *env, jlong cookie, jstring dir) {
free(buffer);
env->ReleaseStringUTFChars(dir, dirC);
}
}

Loading…
Cancel
Save