Git Product home page Git Product logo

frida-cycript's People

Contributors

dependabot[bot] avatar douglaswth avatar duraki avatar dweinstein avatar nsecho avatar oleavr avatar saurik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frida-cycript's Issues

Error while compiling with frida-core-devkit 14.2.13

After changing the version to 14.2.13 inside src/meson.build I get compilation error like the one below:

[120/126] Compiling C++ object src/libcycript.dylib.p/Execute.cpp.o
FAILED: src/libcycript.dylib.p/Execute.cpp.o
c++ -Isrc/libcycript.dylib.p -Isrc -I../src -Xclang -fcolor-diagnostics -pipe -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++11 -Os -g -include config.h -fvisibility=hidden -Wno-deprecated-declarations -Wno-dangling-else -Wno-empty-body -Wno-parentheses -Wno-tautological-undefined-compare -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-non-virtual-dtor -Wno-overloaded-virtual -mmacosx-version-min=10.9 -stdlib=libc++ -DYYDEBUG=1 -MD -MQ src/libcycript.dylib.p/Execute.cpp.o -MF src/libcycript.dylib.p/Execute.cpp.o.d -o src/libcycript.dylib.p/Execute.cpp.o -c ../src/Execute.cpp
../src/Execute.cpp:173:39: error: no matching function for call to 'frida_device_attach_sync'
    FridaRefPtr<FridaSession> session(frida_device_attach_sync(device, pid, cancellable_, &error));
                                      ^~~~~~~~~~~~~~~~~~~~~~~~
src/frida-core.h:52659:16: note: candidate function not viable: requires 5 arguments, but 4 were provided
FridaSession * frida_device_attach_sync (FridaDevice * self, guint pid, FridaRealm realm, GCancellable * cancellable, GError ** error);
               ^
1 error generated.
[122/126] Generating cycript-bridge-definitions with a custom command
ninja: build stopped: subcommand failed.

Error while npm install frida-compile

.....\node_modules\cylang\addon.cpp(23): fatal error C1083: Cannot open include file: '
Driver.hpp': No such file or directory [....\node_modules\cylang\build\cylang_binding.vcxproj]

Can't complile

macOS 10.12.6
Xcode Version 9.0 (9A235)
➜  frida-cycript git:(master) ✗ make -j8
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
mkdir -p frida/_
curl -Ls https://github.com/frida/frida/releases/download/10.0.8/frida-core-devkit-10.0.8-macos-x86_64.tar.xz | xz -d | tar -C frida/_ -xf -
xz: (stdin): File format not recognized
mv frida/_/* frida
mv: rename frida/_/* to frida/*: No such file or directory
make[2]: *** [frida/libfrida-core.a] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

src/meson.build:168:2: ERROR: File cycript0.9 does not exist.

The command meson build --buildtype minsize --strip throws the error
src/meson.build:168:2: ERROR: File cycript0.9 does not exist.

I cloned the repository fresh from git and installed all the dependencies. Where is the problem? Because of the error ninja can't build it:

ninja: Entering directory `build'
ninja: error: loading 'build.ninja': No such file or directory`

Stuck building on palera1n arm64 device - need help

Building on macOS is fine but I have issues compiling it on the device directly:

iPad-Pro-2:~/frida-cycript root# meson build --buildtype minsize --strip
The Meson build system
Version: 1.2.3
Source dir: /private/preboot/15C4E8BD455092F48176EAFD3FF8496C402D0840/jb-JHP37VM6/procursus/var/root/frida-cycript
Build dir: /private/preboot/15C4E8BD455092F48176EAFD3FF8496C402D0840/jb-JHP37VM6/procursus/var/root/frida-cycript/build
Build type: native build
Project name: frida-cycript
Project version: 2.0.5
C compiler for the host machine: cc (clang 14.0.0 "Procursus clang version 14.0.0 ([email protected]:ProcursusTeam/Procursus.git 960af43cc715370e52ee5de85af29ea07ac0445b)")
C linker for the host machine: cc ld64 609
C++ compiler for the host machine: c++ (clang 14.0.0 "Procursus clang version 14.0.0 ([email protected]:ProcursusTeam/Procursus.git 960af43cc715370e52ee5de85af29ea07ac0445b)")
C++ linker for the host machine: c++ ld64 609
WARNING: Unknown CPU family 'ipad6,7', please report this at https://github.com/mesonbuild/meson/issues/new with the output of `uname -a` and `cat /proc/cpuinfo`
WARNING: Unknown CPU family 'ipad6,7', please report this at https://github.com/mesonbuild/meson/issues/new with the output of `uname -a` and `cat /proc/cpuinfo`
WARNING: Unknown CPU family 'ipad6,7', please report this at https://github.com/mesonbuild/meson/issues/new with the output of `uname -a` and `cat /proc/cpuinfo`
Host machine cpu family: ipad6,7
Host machine cpu: ipad6,7
WARNING: Unknown CPU family 'ipad6,7', please report this at https://github.com/mesonbuild/meson/issues/new with the output of `uname -a` and `cat /proc/cpuinfo`
Objective-C compiler for the host machine: cc (clang 14.0.0)
Objective-C linker for the host machine: cc ld64 609
Objective-C++ compiler for the host machine: c++ (clang 14.0.0)
Objective-C++ linker for the host machine: c++ ld64 609
WARNING: Unknown CPU family 'ipad6,7', please report this at https://github.com/mesonbuild/meson/issues/new with the output of `uname -a` and `cat /proc/cpuinfo`
Checking if "compiling for macOS" compiles: NO 
Checking if "compiling for iOS" compiles: YES 
Has header "android/api-level.h" : NO 
Program python3 found: YES (/private/preboot/15C4E8BD455092F48176EAFD3FF8496C402D0840/jb-JHP37VM6/procursus/usr/bin/python3.9)
Program flex found: YES (/var/jb/usr/bin/flex)
Program ext/toolchain/usr/bin/bison.py found: YES (/private/preboot/15C4E8BD455092F48176EAFD3FF8496C402D0840/jb-JHP37VM6/procursus/var/root/frida-cycript/ext/toolchain/usr/bin/bison.py)
Run-time dependency threads found: YES
Program npm found: NO

meson.build:120:8: ERROR: Program 'npm' not found or not executable

A full log can be found at /private/preboot/15C4E8BD455092F48176EAFD3FF8496C402D0840/jb-JHP37VM6/procursus/var/root/frida-cycript/build/meson-logs/meson-log.txt
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

Any chance to run node.js / npm? nvm can't install a compatible version:

nvm install --lts
Installing latest LTS version.
Downloading and installing node v20.9.0...
Downloading https://nodejs.org/dist/v20.9.0/node-v20.9.0-darwin-iPad6,7.tar.xz...
--2023-11-10 07:10:51--  https://nodejs.org/dist/v20.9.0/node-v20.9.0-darwin-iPad6,7.tar.xz
Resolving nodejs.org (nodejs.org)... 2606:4700:10::6814:172e, 2606:4700:10::6814:162e, 104.20.22.46, ...
Connecting to nodejs.org (nodejs.org)|2606:4700:10::6814:172e|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2023-11-10 07:10:52 ERROR 404: Not Found.

Binary download from https://nodejs.org/dist/v20.9.0/node-v20.9.0-darwin-iPad6,7.tar.xz failed, trying source.
grep: /var/jb/var/root/.nvm/.cache/bin/node-v20.9.0-darwin-iPad6,7/node-v20.9.0-darwin-iPad6,7.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 2 CPU core(s)
Number of CPU core(s) less than or equal to 2, running in single-threaded mode
Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!
Local cache found: ${NVM_DIR}/.cache/src/node-v20.9.0/node-v20.9.0.tar.xz
Checksums match! Using existing downloaded archive ${NVM_DIR}/.cache/src/node-v20.9.0/node-v20.9.0.tar.xz
tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
nvm: install v20.9.0 `failed!

I'm on palera1n rootless
iPad6,7 16.7.2

...or is there a deb-package or a compiled bin somewhere to find?

Cycript choose()

Do you plan to implement choose() function?

In my case when use it returns

cy# choose(UIView)
throw new ReferenceError("identifier 'choose' undefined")

Implement RTLD_NEXT

RTLD_NEXT is bugged on MacOS 10.15.7//xnu.

cy# RTLD_NEXT
failed to parse cached code for RTLD_NEXT: syntax error, unexpected )
throw new ReferenceError("'RTLD_NEXT' is not defined")

While expected:

Specifies the next object after this one that defines name. This one refers to the object containing the invocation of dlsym(). The next object is the one found upon the application of a load order symbol resolution algorithm (see dlopen()). The next object is either one of global scope (because it was introduced as part of the original process image or because it was added with a dlopen() operation including the RTLD_GLOBAL flag), or is an object that was included in the same dlopen() operation that loaded this one. [1]

[1] https://pubs.opengroup.org/onlinepubs/009695399/functions/dlsym.html#tag_03_112_07

So; examine the pointer to RTLD via invoking dlopen on exacta. If next object is visible, report back to user. This way, the dlsym hierarchy would be present.

Can't attach to some apps

Running on unc0ver iOS 13.3 A12. I believe it has problems attaching to some of the default apple apps.

Unexpected error while starting thread (act_set_state returned '(os/kern) protection failure') is the result of trying to attach the Clock app.

iOS 11 support

Any idea how to compile and run this for a jailbroken iOS 11 device?

Cant compile

:frida-cycript m1entus$ make -j8
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
CXX libcycript_la-Scanner.lo
./Analyze Analysis.cpp g++ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fvisibility=hidden -fobjc-exceptions -g -O2 -std=gnu++11 -Werror -Wno-deprecated-declarations -Wno-dangling-else -Wno-empty-body -Wno-overloaded-virtual -Wno-parentheses -Wno-tautological-undefined-compare -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -DCY_JAVA=1 -DCY_PYTHON=1 -DCY_OBJECTIVEC=1 >Bridge.def
cd Class; dx --dex --output=../Class/classes.dex .class
/bin/sh: dx: command not found
make[4]: *
* [Class/classes.dex] Error 127
make[4]: *** Waiting for unfinished jobs....
'dirent.h' file not found
cat ./Bridge.old >>Bridge.def
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Can't Replace Methods

I'm trying replace methods doing the standard:

NSObject.prototype.description = function() { return "hello" }

but it doesn't seem to be doing anything.

Is there anything specific I should be doing with this version of cycript?
I'm doing this on a jailbroken device (if that helps).

Cant Compile due to Module version mismatch & more

Environment

OS X 10.11.6
XCode 8.1
node 4.5.0 & 6.10.3 (both failed)

Reproduction Steps

// brew install readline, this was skipped as brew replied readline is a keg-only and another version is linked to opt.

$ export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/readline/include"
$ export LDFLAGS="$LDFLAGS -L/usr/local/opt/readline/lib"

$ git clone https://github.com/nowsecure/frida-cycript.git
$ cd frida-cycript
$ git submodule init
$ git submodule update

$ ./autogen.sh
$ ./configure --enable-static --with-libclang="-rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib" --with-python=/usr/bin/python-config

$ make -j8

Error Log

➜  frida-cycript git:(master) make -j8
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
node_modules/.bin/frida-compile Agent -o libcycript-runtime.js
/Users/its/Project/tools/frida/frida-cycript/src/node_modules/frida-compile/node_modules/cylang/node_modules/bindings/bindings.js:83
        throw e
        ^

Error: Module version mismatch. Expected 48, got 46.
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at bindings (/Users/its/Project/tools/frida/frida-cycript/src/node_modules/frida-compile/node_modules/cylang/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/Users/its/Project/tools/frida/frida-cycript/src/node_modules/frida-compile/node_modules/cylang/index.js:3:36)
    at Module._compile (module.js:570:32)
make[4]: *** [libcycript-runtime.js] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
➜  frida-cycript git:(master)

I run cd src && rm -rf node_modules && npm install. First time, No luck, same error.
I re-run rm -rf node_modules && npm install. node modules installed successfully.

Reproduction Steps (cont.)

Run make -j8 again.

➜  frida-cycript git:(master) make -j8
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
  CXXLD    libcycript.la
0  0x105f4499e  __assert_rtn + 144
1  0x105f7b207  archive::File<x86_64>::makeObjectFileForMember(archive::File<x86_64>::Entry const*) const + 1131
2  0x105f7a866  archive::File<x86_64>::justInTimeforEachAtom(char const*, ld::File::AtomHandler&) const + 112
3  0x105f8eb25  ld::tool::InputFiles::searchLibraries(char const*, bool, bool, bool, ld::File::AtomHandler&) const + 265
4  0x105f96763  ld::tool::Resolver::resolveUndefines() + 165
5  0x105f98deb  ld::tool::Resolver::resolve() + 75
6  0x105f457a7  main + 940
A linker snapshot was created at:
	/tmp/libcycript.dylib-2017-04-15-165650.ld-snapshot
ld: Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /Library/Caches/com.apple.xbs/Sources/ld64/ld64-264.3.102/src/ld/parsers/archive_file.cpp, line 355.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [libcycript.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

fcy is sigfaulting

Upon latest build from master, frida-cycript is failing upon start. To replicate, you need to start fcy# prompt and start writing something; ie:

./cycript
fcy# choose
[1]    31013 segmentation fault  ./cycript

Backtrace dumps on istreambuf iterator:

galaxy@devil. frida-cycript/build/src update-meson-build ∙ lldb cycript
Voltron loaded.
(lldb) target create "cycript"
Current executable set to '/Users/hduraki/dev/frida-cycript/build/src/cycript' (x86_64).
(lldb) r
Process 19773 launched: '/Users/hduraki/dev/frida-cycript/build/src/cycript' (x86_64)
2022-04-06 01:43:39.622959+0200 cycript[19773:41072626] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=19773
2022-04-06 01:43:39.623537+0200 cycript[19773:41072626] SecTaskCopyDebugDescription: cycript[19773]/0#-1 LF=0
fcy#
fcy# chooseProcess 19773 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
    frame #0: 0x00007ff8120498aa libc++.1.dylib` std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_unsigned<unsigned short>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, unsigned short&) const  + 54
libc++.1.dylib`std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_unsigned<unsigned short>:
->  0x7ff8120498aa <+54>: mov    eax, dword ptr [rcx + 0x8]
    0x7ff8120498ad <+57>: and    eax, 0x4a
    0x7ff8120498b0 <+60>: je     0x7ff8120498c4            ; <+80>
    0x7ff8120498b2 <+62>: cmp    eax, 0x40
    0x7ff8120498b5 <+65>: je     0x7ff8120498c9            ; <+85>
    0x7ff8120498b7 <+67>: cmp    eax, 0x8
    0x7ff8120498ba <+70>: jne    0x7ff8120498d1            ; <+93>
    0x7ff8120498bc <+72>: mov    r15d, 0x10
Target 0: (cycript) stopped.
(lldb)

global halts the repl

Trying to list all globals yields in unresponsive tty. Signals are ignored until suspended (Cmd+Z),

$ build/src/cycript
cy# global
Target process terminated


^C^D

Expected value; global definitions in a list/ary or ReferenceError exception.

ie.
[1, 2, 3 ... global(n)] // definitons

I cannot compile this on 10.13

For once, this uses readline 6. Brew nowdays installs readline 7, so I had to compile readline on my own.

Secondly, BISON_PKGDATADIR=../ext/toolchain/usr/share/bison ../ext/toolchain/usr/bin/bison-macos-x86_64 -v --report=state -Werror -o Parser.cpp Parser.ypp fails with SIGABRT and no additional details on my machine (macOS 10.13.4).

Thirdly, this seems to need a certain Java-related dx utility. I had no idea what to do about it, so I symlinked the one in Android SDK.

Tests failing & 'dirent.h' file not found

Hi, i have followed the steps you told with installing and compiling.
I also included android SDK to my path for the 'dx' executable.

This is what i get when i run 'make -j8'

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
  CC       libcycript_la-ConvertUTF.lo
  CXX      libcycript_la-Decode.lo
  CXX      libcycript_la-Driver.lo
  CXX      libcycript_la-Error.lo
  CXX      libcycript_la-Highlight.lo
  CXX      libcycript_la-Library.lo
  CXX      libcycript_la-Output.lo
  CXX      libcycript_la-Replace.lo
  CXX      libcycript_la-Syntax.lo
./Filter.sh Parser.ypp.in >Parser.ypp C Java Ruby Python ObjectiveC
./Filter.sh Scanner.lpp.in >Scanner.lpp C Java Ruby Python ObjectiveC
  CXX      sig/libcycript_la-parse.lo
  CXX      sig/libcycript_la-copy.lo
  CXX      libcycript_la-Complete.lo
  CXX      libcycript_la-Execute.lo
  CXX      Java/libcycript_la-Execute.lo
  CXX      Ruby/libcycript_la-Execute.lo
  CXX      Python/libcycript_la-Execute.lo
  CXX      ObjectiveC/libcycript_la-Output.lo
  CXX      ObjectiveC/libcycript_la-Replace.lo
  CXX      Console.o
g++ -g -O2 -std=c++11  -DCY_JAVA=1 -DCY_PYTHON=1 -DCY_OBJECTIVEC=1 -I./extra -o Analyze Analyze.cpp Error.cpp Output.cpp Replace.cpp Syntax.cpp -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib -Wno-bitwise-op-parentheses -Wno-dangling-else -Wno-logical-op-parentheses
cd Class; jar cf ../libcycript.jar *
BISON_PKGDATADIR=../ext/toolchain/usr/share/bison ../ext/toolchain/usr/bin/bison-mac-x86_64 -v --report=state -Werror -o Parser.cpp Parser.ypp
/usr/bin/flex --full --ecs -o Scanner.cpp -T Scanner.lpp 2>Scanner.output || (grep -F 'Scanner.lpp:' Scanner.output; false)
perl -pi -e 's/yytranslate_ \(yylex \(/(yylex_ (/g' Parser.cpp
  CXX      libcycript_la-Parser.lo
  CXX      libcycript_la-Scanner.lo
./Analyze Analysis.cpp g++ -I/usr/local/opt/readline/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fvisibility=hidden  -fobjc-exceptions -g -O2 -std=gnu++11 -Werror -Wno-deprecated-declarations -Wno-dangling-else -Wno-empty-body -Wno-overloaded-virtual -Wno-parentheses -Wno-tautological-undefined-compare -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -DCY_JAVA=1 -DCY_PYTHON=1 -DCY_OBJECTIVEC=1  >Bridge.def
'dirent.h' file not found
cat ./Bridge.old >>Bridge.def
./libcycript.py 1 libcycript.db ../ext <Bridge.def
  CXXLD    libcycript.la
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
copying selected object files to avoid basename conflicts...
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libcycript.a(lt1-libcycript_la-Execute.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libcycript.a(lt2-libcycript_la-Execute.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libcycript.a(lt3-libcycript_la-Execute.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libcycript.a(lt1-libcycript_la-Execute.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libcycript.a(lt2-libcycript_la-Execute.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .libs/libcycript.a(lt3-libcycript_la-Execute.o) has no symbols
  CXXLD    cycript
make[2]: Nothing to be done for `all-am'.

Also, when i run 'npm run test'

> [email protected] test /Users/zsh/mobile/tools/frida-cycript/test
> DYLD_LIBRARY_PATH=$(pwd)/../src/.libs node node_modules/mocha/bin/_mocha .



  Types
    ✓ should support primitive types
    ✓ should support `new` semantics
    1) should support pretty-printing function pointers
    ✓ should support pointer casting
    ✓ should support declaring functions
    2) should source types from the database
    3) should support structs
    ✓ should support arrays
    ✓ should support C strings
    4) should support completion of database types
    ✓ should support Objective-C types
    ✓ should support Objective-C literals
    ✓ should keep Objective-C objects alive until GCed
    ✓ should support NSString objects seamlessly
    ✓ should support NSArray objects seamlessly
    ✓ should support NSDictionary objects seamlessly
    5) should support calling a selector
    6) should support Objective-C completion
    ✓ should support symbol lookups
    7) should support hooking functions
    8) should support swizzling methods


  13 passing (489ms)
  8 failing

  1) Types should support pretty-printing function pointers:

      AssertionError: expected 'throw new ReferenceError("dlopen is not defined")' to be '(extern "C" void *dlopen(char const*, int))'
      + expected - actual

      -throw new ReferenceError("dlopen is not defined")
      +(extern "C" void *dlopen(char const*, int))
      
      at Assertion.fail (node_modules/should/cjs/should.js:205:17)
      at Assertion.value (node_modules/should/cjs/should.js:277:19)
      at Context.<anonymous> (types.js:26:38)

  2) Types should source types from the database:

      AssertionError: expected 'throw new ReferenceError("fopen is not defined")' to be '(extern "C" struct __sFILE *fopen(char const*, char const*))'
      + expected - actual

      -throw new ReferenceError("fopen is not defined")
      +(extern "C" struct __sFILE *fopen(char const*, char const*))
      
      at Assertion.fail (node_modules/should/cjs/should.js:205:17)
      at Assertion.value (node_modules/should/cjs/should.js:277:19)
      at Context.<anonymous> (types.js:42:37)

  3) Types should support structs:

      AssertionError: expected 'throw new ReferenceError("Dl_info is not defined")' to be '&{dli_fname:null,dli_fbase:null,dli_sname:null,dli_saddr:null}'
      + expected - actual

      -throw new ReferenceError("Dl_info is not defined")
      +&{dli_fname:null,dli_fbase:null,dli_sname:null,dli_saddr:null}
      
      at Assertion.fail (node_modules/should/cjs/should.js:205:17)
      at Assertion.value (node_modules/should/cjs/should.js:277:19)
      at Context.<anonymous> (types.js:57:53)

  4) Types should support completion of database types:
     AssertionError: expected '[]' to contain 'memcpy'
      at Assertion.fail (node_modules/should/cjs/should.js:205:17)
      at Assertion.value [as containEql] (node_modules/should/cjs/should.js:277:19)
      at Context.<anonymous> (types.js:93:57)

  5) Types should support calling a selector:

      AssertionError: expected 'throw new ReferenceError("capitalize is not defined")' to be '@"Hello"'
      + expected - actual

      -throw new ReferenceError("capitalize is not defined")
      +@"Hello"
      
      at Assertion.fail (node_modules/should/cjs/should.js:205:17)
      at Assertion.value (node_modules/should/cjs/should.js:277:19)
      at Context.<anonymous> (types.js:159:57)

  6) Types should support Objective-C completion:

      AssertionError: expected 'throw new ReferenceError("object_getClass is not defined")' to be '["cy$complete"]'
      + expected - actual

      -throw new ReferenceError("object_getClass is not defined")
      +["cy$complete"]
      
      at Assertion.fail (node_modules/should/cjs/should.js:205:17)
      at Assertion.value (node_modules/should/cjs/should.js:277:19)
      at Context.<anonymous> (types.js:165:95)

  7) Types should support hooking functions:

      AssertionError: expected 'throw new ReferenceError("fopen is not defined")' to be '[["/etc/hosts","r"],["/etc/passwd","r"]]'
      + expected - actual

      -throw new ReferenceError("fopen is not defined")
      +[["/etc/hosts","r"],["/etc/passwd","r"]]
      
      at Assertion.fail (node_modules/should/cjs/should.js:205:17)
      at Assertion.value (node_modules/should/cjs/should.js:277:19)
      at Context.<anonymous> (types.js:194:15)

  8) Types should support swizzling methods:
     AssertionError: expected 'throw new ReferenceError("sel_registerName is not defined")' to match /#"<NSObject: 0x[0-9a-f]+> \(of doom\)"/
      at Assertion.fail (node_modules/should/cjs/should.js:205:17)
      at Assertion.value (node_modules/should/cjs/should.js:277:19)
      at Context.<anonymous> (types.js:206:15)




npm ERR! Darwin 16.1.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] test: `DYLD_LIBRARY_PATH=$(pwd)/../src/.libs node node_modules/mocha/bin/_mocha .`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the [email protected] test script 'DYLD_LIBRARY_PATH=$(pwd)/../src/.libs node node_modules/mocha/bin/_mocha .'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cycript-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     DYLD_LIBRARY_PATH=$(pwd)/../src/.libs node node_modules/mocha/bin/_mocha .
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cycript-test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cycript-test
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/zsh/mobile/tools/frida-cycript/test/npm-debug.log

So i got 8 tests failing out of 21. Is this a 'works as designed behaviour' or the result of something else?

Regards,
zs

Upgrade to frida 10 breaks the compilation

Description

Error returned when compiled

Error Log

node_modules/.bin/frida-compile Agent -o libcycript-runtime.js
  CXXLD    libcycript.la
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
Undefined symbols for architecture x86_64:
  "_audit_token_to_pid", referenced from:
      __frida_handshake_port_perform_exchange_as_receiver in libfrida-core.a(port-glue.o)
  "_mkostemp", referenced from:
      _open_temp_exec_file_dir in libfrida-core.a(closures.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [libcycript.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Environment

  • OS X 10.11.6
  • XCode 8.1
  • node 6.10.3

Reproduction Steps

$ export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/readline/include"
$ export LDFLAGS="$LDFLAGS -L/usr/local/opt/readline/lib"

$ git clone https://github.com/nowsecure/frida-cycript.git
$ cd frida-cycript
$ git submodule init
$ git submodule update

Modify frida version in Makefile

frida_version = 10.0.3
$ ./autogen.sh
$ ./configure --enable-static --with-libclang="-rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib" --with-python=/usr/bin/python-config

$ make -j8

be a decent person and rename this to "frida-cycript"

I left a comment on your blog post (which was eaten in some way due to moderation/spam), left a comment on reddit, and also sent you some e-mails, but I see that you are now back on GitHub coding away on this fork of my project.

My comments in various places have a bunch of complaints about this architecture and the characterization of my project, as I think it is entirely unfair and you seem to fundamentally miss the point of what Cycript even is at its core.

Regardless, this is the one thing that I think is downright evil: I'm morally opposed to GitHub, so Cycript is never going to have an official home here. Yet, you have now made a public fork of my project which you are intending to maintain seemingly forever, one which I am never going to merge (and I explain why in those other places), one which is extremely different internally from my implementation and which you are likely going to go around advertising as "better" (which again, I disagree for various reasons): and yet you didn't even have the common decency to change the name to something like "frida-cycript" to avoid confusion. You have bumped the version number 1.0.0, and have a release page that makes it look like the releases just continue right on from my most recent 0.9.594 release from last week. You even seem to be intending to register npm packages named "cycript-*" (though I don't quite know enough about npm to be sure of what that particular package is for).

A lot of people, for worse (only, as this is absolutely not a good thing) equate open source software distribution and storage with GitHub, so now people are going to look on GitHub and essentially always find your project as the most current and maintained and highest version of Cycript. You are essentially hijacking my project directly by name. This seems like it should be really simple, and is kind of "the least you could do".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.