diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1afad73e..6498207a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,13 @@ on: branches: - master +# Automatically cancel any previous workflow on new push. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + env: - R2V: 5.7.8 + R2V: 5.8.8 jobs: linux: @@ -28,19 +33,46 @@ jobs: sudo dpkg -i *.deb - name: make build run: CFLAGS=-DR2DEC_HOME="\\\"$(r2 -H R2_LIBR_PLUGINS)\\\"" make -j -C p - - name: test - run: make -C p install && r2 -Qc 'af;pdd' /bin/ls + - name: test with javascript files + run: | + sudo make -C p install + r2 -Qc 'Lc' malloc://10 + OUTPUT=$(r2 -Qc 'af;pdd' /bin/ls) + CHECK=$(echo -e "$OUTPUT" | grep "r2dec pseudo code output") + echo -e "$OUTPUT" + if [ -z "$CHECK" ]; then + exit 1 + fi + sudo make -C p uninstall - name: make jsc build run: make -C p clean && CFLAGS=-DR2DEC_HOME="\\\"$(r2 -H R2_LIBR_PLUGINS)\\\"" make -j -C p USE_JSC=1 - - name: test - run: make -C p install && r2 -Qc 'af;pdd' /bin/ls + - name: test with jsc + run: | + sudo make -C p install + r2 -Qc 'Lc' malloc://10 + OUTPUT=$(r2 -Qc 'af;pdd' /bin/ls) + CHECK=$(echo -e "$OUTPUT" | grep "r2dec pseudo code output") + echo -e "$OUTPUT" + if [ -z "$CHECK" ]; then + exit 1 + fi + sudo make -C p uninstall - name: meson build run: cd p ; meson -Djsc_folder=".." b && ninja -C b - name: packaging run: make -C p/dist/debian - - name: test - run: make -C p install && r2 -Qc 'af;pdd' /bin/ls - - uses: actions/upload-artifact@v2 + - name: test deb + run: | + sudo dpkg -i p/dist/debian/*.deb + dpkg-query -L r2dec + r2 -Qc 'Lc' malloc://10 + OUTPUT=$(r2 -Qc 'af;pdd' /bin/ls) + CHECK=$(echo -e "$OUTPUT" | grep "r2dec pseudo code output") + echo -e "$OUTPUT" + if [ -z "$CHECK" ]; then + exit 1 + fi + - uses: actions/upload-artifact@v3 with: name: r2dec-${{env.R2V}}_amd64.deb path: p/dist/debian/*.deb @@ -62,7 +94,7 @@ jobs: sudo installer -pkg *.pkg -target / - name: packaging run: make -C p/dist/macos - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: r2dec-${{env.R2V}}-amd64.pkg path: p/dist/macos/r2dec*.pkg @@ -111,7 +143,7 @@ jobs: copy b\*.dll "%PLUGINDIR%" cd %BINDIR% radare2.exe -Qc "pdd? ; aa ; pdd" radare2.exe - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: r2dec-${{env.R2V}}-w64.zip path: r2dec-plugin @@ -160,7 +192,7 @@ jobs: copy b\*.dll "%PLUGINDIR%" cd %BINDIR% radare2.exe -Qc "pdd? ; aa ; pdd" radare2.exe - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: r2dec-${{env.R2V}}-w32.zip path: r2dec-plugin diff --git a/.github/workflows/continuous-tests.yml b/.github/workflows/continuous-tests.yml index 372f3746..ed1af637 100644 --- a/.github/workflows/continuous-tests.yml +++ b/.github/workflows/continuous-tests.yml @@ -1,6 +1,11 @@ name: continuous-tests on: [push] +# Automatically cancel any previous workflow on new push. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + jobs: eslint: name: eslint diff --git a/p/Makefile b/p/Makefile index 5e48e753..c84106cf 100644 --- a/p/Makefile +++ b/p/Makefile @@ -59,10 +59,11 @@ endif $(V)$(CC) $(CFLAGS) $(CFLAGS_PKG) -c $< -o $@ $(DESTDIR)$(R2DEC_HOME) $(DESTDIR)$(R2DEC_HOME)/libdec $(DESTDIR)$(PLUGDIR): + $(V)$(ECHO) "[MKDIR] $@" $(V)$(MKDIR) $@ install-plugin: $(DESTDIR)$(R2DEC_HOME)/libdec $(DESTDIR)$(PLUGDIR) $(BIN) - $(V)$(CP) $(BIN) $(DESTDIR)$(PLUGDIR) + $(V)$(CP) -v $(BIN) $(DESTDIR)$(PLUGDIR) symstall symlink: $(DESTDIR)$(PLUGDIR) $(DESTDIR)/$(R2DEC_HOME)/libdec $(V)$(LN) $(shell pwd)/$(BIN) $(DESTDIR)$(PLUGDIR) @@ -82,22 +83,22 @@ ifeq ($(USE_JSC),0) endif ifeq ($(USE_JSC),1) -install-libdec: $(DESTDIR)$(R2DEC_HOME) - $(V)$(CP) -r ../r2dec-duk.js ../require.js ../libdec "$(DESTDIR)$(R2DEC_HOME)" +install-libdec: + $(V)$(ECHO) "ignoring installing js files." user-install-libdec: - $(V)$(MAKE) install-libdec PLUGDIR=$(shell r2 -H R2_USER_PLUGINS) R2DEC_HOME=$(shell r2 -H R2_USER_PLUGINS)/r2dec-js + $(V)$(ECHO) "ignoring installing js files." else install-libdec: - $(V)$(CP) -r ../r2dec-duk.js ../require.js ../libdec "$(DESTDIR)$(R2DEC_HOME)" + $(V)$(CP) -rv ../r2dec-duk.js ../require.js ../libdec "$(DESTDIR)$(R2DEC_HOME)" user-install-libdec: - $(V)$(CP) -r ../r2dec-duk.js ../require.js ../libdec "$(shell r2 -H R2_USER_PLUGINS)"/r2dec-js + $(V)$(CP) -rv ../r2dec-duk.js ../require.js ../libdec "$(shell r2 -H R2_USER_PLUGINS)"/r2dec-js endif uninstall: - $(V)$(RM) $(DESTDIR)$(PLUGDIR)/$(BIN) - $(V)$(RM) -r $(DESTDIR)$(PLUGDIR)/r2dec-js + $(V)$(RM) -v $(DESTDIR)$(PLUGDIR)/$(BIN) + $(V)$(RM) -rv $(DESTDIR)$(R2DEC_HOME) user-uninstall: $(V)$(MAKE) uninstall PLUGDIR=$(shell r2 -H R2_USER_PLUGINS) diff --git a/p/dist/cydia/DESCR b/p/dist/cydia/DESCR index 7f81bd0a..9decc19d 100644 --- a/p/dist/cydia/DESCR +++ b/p/dist/cydia/DESCR @@ -1,2 +1,2 @@ -Frida plugin for radare2 -This plugin will allow r2 on iOS to use the frida:// URI handler in the IO plugin in order to communicate with a local or remote Frida server and get the benefits of R2 and Frida together! +r2dec plugin for radare2 +This plugin enables r2 to converts assembly to pseudo-C code. diff --git a/p/dist/debian/DESCR b/p/dist/debian/DESCR index b2fb6533..9decc19d 100644 --- a/p/dist/debian/DESCR +++ b/p/dist/debian/DESCR @@ -1,2 +1,2 @@ -Frida plugin for radare2 -This plugin enables r2 to talk with frida-server in local or remote devices running on Windows, Linux, Mac, iOS or Android via the frida:// URI handler. +r2dec plugin for radare2 +This plugin enables r2 to converts assembly to pseudo-C code.