diff --git a/OffsetHunter/DumpTargetGroup.cpp b/OffsetHunter/DumpTargetGroup.cpp index d0a4d83..1ce6bf2 100644 --- a/OffsetHunter/DumpTargetGroup.cpp +++ b/OffsetHunter/DumpTargetGroup.cpp @@ -4,11 +4,17 @@ bool DumpTargetGroup::InitAllTargets() { + std::unordered_set toRemove; + for (auto& kv : mTargets) { - kv.first->Init(); + if (kv.first->Init() == false) + toRemove.insert(kv.first); } + for (SingleDumpTarget* r : toRemove) + RemoveTarget(r); + return true; } diff --git a/OffsetHunter/Test/DummyOffsetMgr.hpp b/OffsetHunter/Test/DummyOffsetMgr.hpp index 64ea178..6b79e2c 100644 --- a/OffsetHunter/Test/DummyOffsetMgr.hpp +++ b/OffsetHunter/Test/DummyOffsetMgr.hpp @@ -21,8 +21,8 @@ struct OffMgr { #if defined(ARM64) struct BinArm64A { uintptr_t name1 = 0x8; // Should be 0x8 - uintptr_t name2 = 0x8; // Should be 0x8 uintptr_t name3 = 0x8; // Should be 0x8 + uintptr_t name2 = 0x8; // Should be 0x8 } mBinArm64A; struct BinArm64B { uintptr_t name1 = 0x8; // Should be 0x8 @@ -49,8 +49,8 @@ struct OffMgr { #if defined(ARM64) struct BinArm64A { uintptr_t name1; // Should be 0x8 - uintptr_t name2; // Should be 0x8 uintptr_t name3; // Should be 0x8 + uintptr_t name2; // Should be 0x8 } mBinArm64A; struct BinArm64B { uintptr_t name1; // Should be 0x8 @@ -71,8 +71,8 @@ struct OffMgr { #if defined(ARM64) mBinArm64A.name1 = obj["1353524362"].asUInt() ^ 2105391926; // Should be 0x8 - mBinArm64A.name2 = obj["2417577301"].asUInt() ^ 4261248991; // Should be 0x8 mBinArm64A.name3 = obj["3612997897"].asUInt() ^ 3609688011; // Should be 0x8 + mBinArm64A.name2 = obj["2417577301"].asUInt() ^ 4261248991; // Should be 0x8 mBinArm64B.name1 = obj["2913580123"].asUInt() ^ 257130281; // Should be 0x8 mBinArm64B.name2 = obj["315769873"].asUInt() ^ 4134368048; // Should be 0x8 mBinArm64B.name3 = obj["4130067440"].asUInt() ^ 4287559064; // Should be 0x8 diff --git a/OffsetHunter/Test/OffMgr_obf_book.json b/OffsetHunter/Test/OffMgr_obf_book.json new file mode 100644 index 0000000..19765bd --- /dev/null +++ b/OffsetHunter/Test/OffMgr_obf_book.json @@ -0,0 +1 @@ +null diff --git a/OffsetHunter/Test/OffsetMgr.hpp b/OffsetHunter/Test/OffsetMgr.hpp index 6046501..777ccbc 100644 --- a/OffsetHunter/Test/OffsetMgr.hpp +++ b/OffsetHunter/Test/OffsetMgr.hpp @@ -5,67 +5,9 @@ struct OffMgr { #if defined(STATIC_OFFS) -#if defined(ARM64) - struct BinArm64A { - uintptr_t name1 = 0x0; // Should be 0x4 - uintptr_t name3 = 0x4; // Should be 0x4 - } mBinArm64A; - struct BinArm64B { - uintptr_t name1 = 0x0; // Should be 0x4 - uintptr_t name3 = 0x4; // Should be 0x4 - } mBinArm64B; -#endif - -#if defined(ARM32) - struct BinArm32A { - uintptr_t name1 = 0x0; // Should be 0x4 - uintptr_t name3 = 0x4; // Should be 0x4 - } mBinArm32A; - struct BinArm32B { - uintptr_t name1 = 0x0; // Should be 0x4 - uintptr_t name3 = 0x4; // Should be 0x4 - } mBinArm32B; -#endif - #else -#if defined(ARM64) - struct BinArm64A { - uintptr_t name1; // Should be 0x4 - uintptr_t name3; // Should be 0x4 - } mBinArm64A; - struct BinArm64B { - uintptr_t name1; // Should be 0x4 - uintptr_t name3; // Should be 0x4 - } mBinArm64B; -#endif - -#if defined(ARM32) - struct BinArm32A { - uintptr_t name1; // Should be 0x4 - uintptr_t name3; // Should be 0x4 - } mBinArm32A; - struct BinArm32B { - uintptr_t name1; // Should be 0x4 - uintptr_t name3; // Should be 0x4 - } mBinArm32B; -#endif - void Set(const Json::Value& obj) { -#if defined(ARM64) - mBinArm64A.name1 = obj["462494170"].asUInt(); // Should be 0x4 - mBinArm64A.name3 = obj["-812899064"].asUInt(); // Should be 0x4 - mBinArm64B.name1 = obj["-7551171"].asUInt(); // Should be 0x4 - mBinArm64B.name3 = obj["1267842063"].asUInt(); // Should be 0x4 -#endif - -#if defined(ARM32) - mBinArm32A.name1 = obj["500368777"].asUInt(); // Should be 0x4 - mBinArm32A.name3 = obj["1775762011"].asUInt(); // Should be 0x4 - mBinArm32B.name1 = obj["538329334"].asUInt(); // Should be 0x4 - mBinArm32B.name3 = obj["-737063900"].asUInt(); // Should be 0x4 -#endif - } #endif diff --git a/OffsetHunter/Test/offsets_ARM32.json b/OffsetHunter/Test/offsets_ARM32.json index 44978dc..19765bd 100644 --- a/OffsetHunter/Test/offsets_ARM32.json +++ b/OffsetHunter/Test/offsets_ARM32.json @@ -1 +1 @@ -{"133037476":2608821928,"1558618447":2130704117,"1613443683":1985833986,"2135897944":1610241865,"3426461397":2142748459,"4125678665":3214868451} +null diff --git a/OffsetHunter/Test/offsets_ARM64.json b/OffsetHunter/Test/offsets_ARM64.json index ea517ff..19765bd 100644 --- a/OffsetHunter/Test/offsets_ARM64.json +++ b/OffsetHunter/Test/offsets_ARM64.json @@ -1 +1 @@ -{"1353524362":2105391934,"2417577301":4261248983,"2913580123":257130273,"315769873":4134368056,"3612997897":3609688003,"4130067440":4287559056} +null