All Projects → JetBrains → Ruby Type Inference

JetBrains / Ruby Type Inference

Licence: apache-2.0
Dynamic definitions and types provider for ruby static analysis

Programming Languages

ruby
36898 projects - #4 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Ruby Type Inference

ethereum-dasm
An ethereum evm bytecode disassembler and static/dynamic analysis tool
Stars: ✭ 121 (-6.2%)
Mutual labels:  static-analysis, dynamic-analysis
Engine
Droidefense: Advance Android Malware Analysis Framework
Stars: ✭ 386 (+199.22%)
Mutual labels:  static-analysis, dynamic-analysis
Android-Malware-Detection
Android malware detection using static and dynamic analysis
Stars: ✭ 18 (-86.05%)
Mutual labels:  static-analysis, dynamic-analysis
r2frida-book
The radare2 + frida book for Mobile Application assessment
Stars: ✭ 38 (-70.54%)
Mutual labels:  static-analysis, dynamic-analysis
Habomalhunter
HaboMalHunter is a sub-project of Habo Malware Analysis System (https://habo.qq.com), which can be used for automated malware analysis and security assessment on the Linux system.
Stars: ✭ 627 (+386.05%)
Mutual labels:  static-analysis, dynamic-analysis
maloss
Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages
Stars: ✭ 46 (-64.34%)
Mutual labels:  static-analysis, dynamic-analysis
Bap
Binary Analysis Platform
Stars: ✭ 1,385 (+973.64%)
Mutual labels:  static-analysis, dynamic-analysis
aparoid
Static and dynamic Android application security analysis
Stars: ✭ 62 (-51.94%)
Mutual labels:  static-analysis, dynamic-analysis
R2frida
Radare2 and Frida better together.
Stars: ✭ 610 (+372.87%)
Mutual labels:  static-analysis, dynamic-analysis
Crosshair
An analysis tool for Python that blurs the line between testing and type systems.
Stars: ✭ 586 (+354.26%)
Mutual labels:  static-analysis, dynamic-analysis
tiro
TIRO - A hybrid iterative deobfuscation framework for Android applications
Stars: ✭ 20 (-84.5%)
Mutual labels:  static-analysis, dynamic-analysis
Mobile Security Framework Mobsf
Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis.
Stars: ✭ 10,212 (+7816.28%)
Mutual labels:  static-analysis, dynamic-analysis
jitana
A graph-based static-dynamic hybrid DEX code analysis tool
Stars: ✭ 35 (-72.87%)
Mutual labels:  static-analysis, dynamic-analysis
opem
OPEM (Open Source PEM Fuel Cell Simulation Tool)
Stars: ✭ 107 (-17.05%)
Mutual labels:  static-analysis, dynamic-analysis
awesome-malware-analysis
Defund the Police.
Stars: ✭ 9,181 (+7017.05%)
Mutual labels:  static-analysis, dynamic-analysis
Enlightn
Your performance & security consultant, an artisan command away.
Stars: ✭ 378 (+193.02%)
Mutual labels:  static-analysis, dynamic-analysis
Mobileapp Pentest Cheatsheet
The Mobile App Pentest cheat sheet was created to provide concise collection of high value information on specific mobile application penetration testing topics.
Stars: ✭ 3,051 (+2265.12%)
Mutual labels:  static-analysis, dynamic-analysis
SDA
SDA is a rich cross-platform tool for reverse engineering that focused firstly on analysis of computer games. I'm trying to create a mix of the Ghidra, Cheat Engine and x64dbg. My tool will combine static and dynamic analysis of programs. Now SDA is being developed.
Stars: ✭ 98 (-24.03%)
Mutual labels:  static-analysis, dynamic-analysis
Saferwall
A hackable malware sandbox for the 21st Century
Stars: ✭ 419 (+224.81%)
Mutual labels:  static-analysis, dynamic-analysis
Intellidroid
A targeted input generator for Android that improves the effectiveness of dynamic malware analysis.
Stars: ✭ 46 (-64.34%)
Mutual labels:  static-analysis, dynamic-analysis

Automated Type Contracts Generation JetBrains incubator project Build Status

ruby-type-inference project is a completely new approach to tackle the problems of Ruby dynamic nature and provide more reliable symbol resolution and type inference. It collects some run time data to build type contracts for the methods.

Every time a method is being called, some arguments of particular types are being passed to it. Type Tracker collects all such argument combinations and then builds a special contract which satisfies all encountered argument type tuples.

The approach has its own pros and cons:

  • The obtained contracts utilize real-world usages of code of any complexity so it provides true results even if a method utilizes dynamic Ruby features heavily.
  • The completeness of the contracts obtained for a method highly depends on the coverage of that method, including its callees. That implies the need to merge the data obtained from the different sources (e.g. different projects using the same gem).

This implementation addresses the stated coverage problem by providing the possibility to merge any type contracts at any time.

Usage

For simple usage you need to install the Ruby Dynamic Code Insight plugin for RubyMine. Then this plugin will require the arg_scanner gem to be installed. See arg_scanner installation instruction if you have problems while installation.

After that, you will have the possibility to run your programs under type tracker:

Run with type tracker

Or you can run your programs in terminal via the rubymine-type-tracker binary (But you have to keep your project opened in RubyMine). E.g.:

rubymine-type-tracker bin/rails server

The rubymine-type-tracker binary is included into the arg_scanner gem.

See FEATURES.md for understanding what benefits you will have after running your program under type tracker.

Architecture

  • arg_scanner is a gem with a native extension to attach to ruby processes and trace and intercept all method calls to log type-wise data flow in runtime.

    See arg_scanner documentation for details on usage.

  • The type contract processor server listens for incoming type data (from arg_scanner) and processes it to a compact format.

    The data stored may be used later for better code analysis and also can be shared with other users.

  • Code analysis clients (a RubyMine/IJ+Ruby plugin) use the contract data to provide features for the users such as code completion, better resolution, etc.

  • (todo) Signature server receives contracts anonymously from the users and provides a compiled contract collections for popular gems.

Running project from sources

Prerequisites

The arg_scanner gem is used for collecting type information. It can be installed manually to the target SDK and requires MRI Ruby at least 2.3.

Running type tracker

There are two possibilities to use the type tracker: (I) using IJ/RubyMine plugin or (II) requiring it from Ruby code.

Using RubyMine plugin

The easiest way to run the plugin (and the most convenient for its development) is running it with special gradle task against IJ Ultimate snapshot:

./gradlew ide-plugin:runIde

The task will compile the plugin, run IJ Ultimate with plugin "installed" in it. There is no need in running anything manually in that case.

If you want to try it with existing RubyMine instance, you should:

  1. Build it via ./gradlew ide-plugin:buildPlugin
  2. Install plugin in the IDE
    • Navigate to File | Settings | Plugins | Install plugin from disk...
    • Locate plugin in ide-plugin/build/distributions and select.
    • Restart IDE.

Note that due to API changes the plugin may be incompatible with older RM instances.

Using command line
  1. In order to collect the data for the script needs a contract server to be up and running; it could be run by running

    ./gradlew contract-creator:runServer --args path-to-db.mv.db
    

    where path-to-db.mv.db is path where type contracts will be stored (H2 database file).

  2. Run the ruby script to be processed via arg-scanner binary.

  3. Use the data collected by the contract server.

Contributions

Any kind of ideas, use cases, contributions and questions are very welcome as the project is just incubating. Please feel free to create issues for any sensible request.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].