Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work. Error. #35

Closed
dfdfdfs opened this issue Dec 14, 2020 · 15 comments
Closed

Does not work. Error. #35

dfdfdfs opened this issue Dec 14, 2020 · 15 comments
Assignees
Labels
bug Something isn't working Windows

Comments

@dfdfdfs
Copy link

dfdfdfs commented Dec 14, 2020

Hello, tell me if it will work for Windows?

After the command npm install -g dexcalibur

I get this error

npm WARN deprecated crypto@1.0.1: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.

npm ERR! code EEXIST
npm ERR! path C:\Users\User\AppData\Roaming\npm\node_modules\dexcalibur\dexcalibur
npm ERR! dest C:\Users\User\AppData\Roaming\npm\dexcalibur
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\User\AppData\Roaming\npm\node_modules\dexcalibur\dexcalibur' -> 'C:\Users\User\AppData\Roaming\npm\dexcalibur'
npm ERR! File exists: C:\Users\User\AppData\Roaming\npm\dexcalibur
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:

@dfdfdfs dfdfdfs added the bug Something isn't working label Dec 14, 2020
@FrenchYeti
Copy link
Owner

FrenchYeti commented Dec 14, 2020

Hey,

Sorry I personally never tested on Windows, that's why i mention only MacOS and Linux. Some people succesfully did it, but i can't provide you more information about it (for this moment).

Your error is curious, is your first try ?

Even if install works, 'dexcalibur' will not be able to start from MS command line because Dexcalibur entrypoint is a bash script wrapping 'node'. So, you should run node ./dexcalibur.js from command line.

So, i recommend you to install it from source, it is really easy :

  • download or clone it
  • go to dexcaliburdirectory and run npm install
  • start dexcalibur by doing node ./dexcalibur.js

@dfdfdfs
Copy link
Author

dfdfdfs commented Dec 14, 2020

Да первая установка.

Скачал dexcalibur-master Зашел в папку ввел npm install Вот такая вот ошибка

**`Microsoft Windows [Version 6.3.9600]

User@WIN-9G17FRIREA8 D:\zzz\dexcalibur-master

npm install

npm WARN deprecated crypto@1.0.1: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.

npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

frida@14.1.3 install D:\zzz\dexcalibur-master\node_modules\frida
prebuild-install || node-gyp rebuild

xz@2.0.2 install D:\zzz\dexcalibur-master\node_modules\xz
node-gyp rebuild

User@WIN-9G17FRIREA8 D:\zzz\dexcalibur-master\node_modules\xz

if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )

Выполняется последовательная сборка проектов в этом решении. Чтобы включить параллельную сборку, добавьте параметр "/m".
unpack_xz_dep
nothing.c
win_delay_load_hook.cc
nothing.vcxproj -> D:\zzz\dexcalibur-master\node_modules\xz\build\Release\nothing.lib
configure_and_make
"eval" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" завершилась с кодом 1. [D:\zzz \dexcalibur-master\node_modules\xz\build\deps\xz.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\zzz\dexcalibur-master\node_modules\xz
gyp ERR! node -v v14.15.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xz@2.0.2 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xz@2.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! [C:\Users\User\AppData\Roaming\npm-cache_logs\2020-12-14T18_12_01_636Z-debug.log`**](url
2020-12-14T18_12_01_636Z-debug.zip
)

@dfdfdfs
Copy link
Author

dfdfdfs commented Dec 14, 2020

Лог в зип архиве.

@FrenchYeti
Copy link
Owner

Thank you for your efforts ! :) Unfortunately i cannot help you more.
I need to investigate the best way to add 'xz' support on Windows.

@dfdfdfs
Copy link
Author

dfdfdfs commented Dec 14, 2020

When to wait for an update with Windows support?

@FrenchYeti
Copy link
Owner

I will try to fix it or to provide documentation this week, but It seems it is a common issue with 'node-gyp' on Windows, not especially a dexcalibur issue.

The following link offers some solutions to fix node-gyp issues on Windows : https://spin.atomicobject.com/2019/03/27/node-gyp-windows/

@FrenchYeti
Copy link
Owner

FrenchYeti commented Dec 14, 2020

Most of OS-dependent parts of Dexcalibur (such as path, eol, ...) are binded to the OS, so Windows support is more a 'how to build/installl Dexcalibur on Windows' problem

@dfdfdfs
Copy link
Author

dfdfdfs commented Dec 17, 2020

Hello, not how can not install.

gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\MSBuild\14.0\Bin ENOENT
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
gyp ERR! stack at onErrorNT (internal/child_process.js:406:16)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\dexcalibur\node_modules\xz
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! This is a bug in node-gyp.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! https://github.com/nodejs/node-gyp/issues
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! xz@2.0.2 install: node-gyp rebuild
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the xz@2.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2020-12-17T15_17_01_142Z-debug.log

Can you throw off the Dexcalibur project with npm modules installed? I'll try to run it directly on Windows.

@dfdfdfs
Copy link
Author

dfdfdfs commented Jan 1, 2021

Help me please.

@duckness
Copy link

duckness commented Feb 22, 2021

Instructions for 0.7.5 / e9bbbeb

Here's a workaround. Note that I have not tested any decompression with this yet so not sure if it is 100% functional, but it should be a drop in replacement.

  1. Clone or download the dexcalibur repo
  2. change the xz dependency in package.json to lzma-native. Change the version requirements as well.
  3. in src/FridaHelper.js, change line 6 to: const _xz_ = require("lzma-native");
  4. in src/InspectorManager.js, change line 4 to: const _xz_ = require('lzma-native');
  5. run npm install on the root directory
  6. You should now be able to start the service with npm run start

Edit:
I encountered a few more errors after this

  1. in src/DexcaliburEngine.js, comment out line 467: // _fs_.chmodSync( _path_.join(self.workspace.binFolder,'platform-tools','adb'), 0o555);
  2. in src/DeviceManager.js, change line 77 to: "adb.exe"

@FrenchYeti
Copy link
Owner

hi Duckness,

First, very thank you for your help on Windows support. 👍

Decompression is mainly used by Frida helper during device enrollment when frida-server is pushed on the device. So, it 'is trigged when you enroll a new device.

Let me know if you successfully run Dexcalibur on Windows, then i could upgrade source code of the new version (unpublished and rewritten with TypeScript).

@duckness
Copy link

@FrenchYeti yes it works right now. I'm currently facing the same issue as #43, but that's probably different.

@0xbadb0d00
Copy link

Hello, I can confirm that I also have succesfully installed Dexcalibur on Windows with @duckness suggestions. I also attached it to Nox and it works well.
I used current master branch

@FrenchYeti
Copy link
Owner

Hello,

Very thank you for your feedback, i will move to 'lzma-native' soon.

@FrenchYeti
Copy link
Owner

Library XZ has been replaced by "lzma-native", and several os-sensitive things has been patched into 0.7.10. Thanks all to your help to add Windows support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows
Projects
None yet
Development

No branches or pull requests

4 participants