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

Converting the complete environment from Bash to Python because of portability #147

Closed
0xBEEEF opened this issue Feb 2, 2018 · 6 comments

Comments

@0xBEEEF
Copy link

0xBEEEF commented Feb 2, 2018

I wanted to ask if there are any plans to remove the bash completely from the project? In the presentation for the release of the project as open source, there was still talk of the need to switch to Python to make it more portable than before.

portable

Unfortunately, I don't see any plans on the roadmap for this anymore. In my opinion, however, it would be quite desirable if Python could be used to depict the whole thing. This way you wouldn't have to do such a headstand under Windows to get the system up and running. The best way to do this is to simply run the program without external dependencies. That makes it entirely portable.

@s3rvac s3rvac changed the title Converting the complete environment from bash to python because of portability. Converting the complete environment from Bash to Python because of portability Feb 3, 2018
@PeterMatula
Copy link
Collaborator

I added it to the long term plan. We would like to do it, but there are quite a few more important goals.

@0xBEEEF
Copy link
Author

0xBEEEF commented Feb 6, 2018

Thank you very much! Of course there are more important topics than this one, but I was just wondering why it was missing on the list. I'm closing the issue now! Thanks for the quick response!

@0xBEEEF 0xBEEEF closed this as completed Feb 6, 2018
@s3rvac
Copy link
Member

s3rvac commented Feb 7, 2018

I am re-opening this as we surely want to do it, although not right now.

@s3rvac s3rvac reopened this Feb 7, 2018
@TheCodez
Copy link
Contributor

TheCodez commented Jun 8, 2018

I did some work towards converting all scripts to Python, which can be seen in my Branch. The python scripts reside in the scripts folder but follow a different naming scheme e.g. retdec-unpacker becomes retdec_unpacker

It's still early work in progress. Apart from retdec-decompiler (which is half way done) every script is converted. Converted meaning they compile and look reasonable like a python script. However some scripts still emplace some non portable bash commands, which should be replaced by their python equivalent.

This could be used as a starting point, so any feedback or help would be greatly appreciated. I especially need help in replacing some of the bash commands, as I'm not really familiar with the Bash environment.

[UPDATE]
Python Decompiler script can now be used.

PeterMatula pushed a commit that referenced this issue Jul 12, 2018
* Convert most Bash scripts to Python

* Port cmake/install-share to python

* Some cleanup

* Replaced install-share in cmake file with fully working python version

* Attemp to fix compile error

* Fix compile for older python version

* Try calling python 3 instead

* Make install-share.py executable
Compilable decompiler version

* Decompiler script now runs successfully until unpacking

* Running until calling bin2llvmir now

* [skip ci] Integrate @silverbacknet changes + some fixes

* [skip ci] Use CmdRunner.run_cmd everywhere in retdec_decompiler
Small fixes and cleanup
Early out if an error occurs

* [skip ci] Latest fixes
add retdec_tests_runner.py

* [skip ci] Check that options are correct + cleanup and fixes

* [skip ci] Fixed various errors

* Try to fix running install-share script

* Should now work on every os

* Fix compile error

* Convert compile-yara to python

* [skip ci] Make test runner more portable

* [skip ci] Use correct code style

* [skip ci] Decompiler script now runs successfully

* Now generates the same output as the bash script

* Try fixing Travis on macOS

* Upgrade python instead

* Test scripts in travis

* Fix build

* Fix path

* Update build
Small cleanup

* Fix error in decompiler script

* Try to debug failure reason
Fix test runner
Use Python 3.5 on ubuntu

* Use newer Python version and fix some errors

* [skip ci] Little cleanup to make the code more clear
Don't parse_args twice

* [skip ci] First version of reimplementing logging

* [skip ci] Some fixes and cleanup

* [skip ci] Print memory usage, print output from unpacker, match code convention and some other fixes

* [skip ci] Fix crash when using cleanup option; fix crash when using color ida

* [skip ci] Fix --backend-aggressive-opts argument

* [skip ci] Fix error when file arch is followed by a comment

* [skip ci] Match Bash script more closely

* [skip ci] Fix a few comments

* [skip ci] Add some comments

* [skip ci] Add early type_extractor/gen_cstdlib_and_linux_jsons.py and type_extractor/gen_windows_and_windrivers_jsons.py version

* Try Unit tests

* Try to fix test

* Use absolute path instead

* [skip ci] Add check for python scripts

* scripts/retdec_decompiler.py: use output if specified via -o option
@PeterMatula
Copy link
Collaborator

Done - everything is in master. We will do a new release with this in the next few days.

@0xBEEEF
Copy link
Author

0xBEEEF commented Aug 14, 2018

That's great news! Thank you for your efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants