FrenchYeti / dexcalibur

[Official] Android reverse engineering tool focused on dynamic instrumentation automation leveraging Frida. It disassembles dex, analyzes it statically, generates hooks, discovers reflected methods, stores intercepted data and does new things from it. Its aim is to be an all-in-one Android reverse engineering platform.
Apache License 2.0
1.06k stars 126 forks source link

JavaScript heap out of memory #61

Open dummys opened 3 years ago

dummys commented 3 years ago

Hello, Even if I try to use the command: node /usr/lib/node_modules/dexcalibur/dexcalibur.js --max-old-space-size=16384 I still get the crash with error JavaScript heap out of memory:

[*] 44453 methods indexed
[*] 21470 fields indexed
[*] 167627 instructions indexed
[*] 43020 method calls mapped
[*] 4691 field calls mapped
[INFO] [INSPECTOR MANAGER] Project[wikiii], Step[POST_PLATFORM_SCAN] deploying inspectors : <none>
[INFO] Scanning default path :
<--- Last few GCs --->

[1151262:0x555e074894b0]   112232 ms: Mark-sweep 2038.7 (2085.5) -> 2037.3 (2090.5) MB, 1948.6 / 0.0 ms  (average mu = 0.249, current mu = 0.013) allocation failure scavenge might not succeed
[1151262:0x555e074894b0]   114190 ms: Mark-sweep 2041.8 (2090.7) -> 2039.3 (2092.5) MB, 1945.6 / 0.0 ms  (average mu = 0.140, current mu = 0.006) allocation failure scavenge might not succeed

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0x555e058d2971 node::Abort() [node]
 2: 0x555e057d9c63 node::FatalError(char const*, char const*) [node]
 3: 0x555e05aaaaf2 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0x555e05aaad58 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0x555e05c687a6  [node]
 6: 0x555e05c79770 v8::internal::Heap::CollectAllGarbage(int, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 7: 0x555e05c7b74d v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 8: 0x555e05c7b7b5 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 9: 0x555e05c41248 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x555e05f7d51b v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x555e06305339  [node]
fish: Job 1, 'node /usr/lib/node_modules/dexc…' terminated by signal SIGABRT (Abort)
dummys commented 3 years ago

ok the only way I have made it work is modifying the file: /usr/lib/node_modules/dexcalibur/dexcalibur.js and add:

#!/usr/bin/env node --max-old-space-size=16384 to the shebang. I needed to use this otherwise dexcalibur launch node without the option. I tried to play with option in file: /usr/lib/node_modules/dexcalibur/dexcalibur but it never worked.

FrenchYeti commented 3 years ago

hi,

did you try

node --max-old-space-size=16384 /usr/lib/node_modules/dexcalibur/dexcalibur.js

instead of

node /usr/lib/node_modules/dexcalibur/dexcalibur.js --max-old-space-size=16384

?