Code Monkey home page Code Monkey logo

instruction2vec's Introduction

Instruction2vec

Yongjun Lee, Hyun Kwon, Sang-Hoon Choi, Seung-Ho Lim, Sung Hoon Baek, Ki-Woong Park* - Instruction2vec:Efficient Preprocessor of Assembly Code to Detect Software Weakness with CNN (https://www.mdpi.com/2076-3417/9/19/4086)

What?

Instruction2vec is a preprocessor that vectorizes the instructions of the assembly code. The output of Instruction2vec is a vector value that can be trained on various models. Instruction2vec has the following characteristics:

  • Gives a vector value of fixed length.
  • Considers the syntax of the assembly code.
  • Works based on Word2vec.

Example

import sys
import core.gen_gensim_model as gen
import core.instruction2vec as inst2vec


test_asmcode = """
push   ebp
mov    ebp,esp
sub    esp,0x18
mov      ebp -0xc ,eax
call wmemset
mov      ebp -0x34 ,0x41414141
mov      ebp + eax * 4 -0x38 ,0x1"""


fd = open("./sample/asmcode_corpus", "r")
asmcode_corpus = fd.read()

vectorsize = 5

model = gen.gen_instruction2vec_model(asmcode_corpus,vectorsize,"test_model")

for one_instruction in test_asmcode.split('\n'):
	print one_instruction
	vector_of_intruction = inst2vec.instruction2vec(one_instruction,model,vectorsize)
	print vector_of_intruction

instruction2vec's People

Contributors

firmcode avatar tushartushar avatar

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.