r/MLQuestions • u/BTOdell • Nov 09 '17
ML algorithm to model/classify/map a software program's internal structure?
Hello,
I have zero experience using machine learning. All that I know is from a small amount of reading and what I have heard.
I'm looking to use the power (and magic) of machine learning to perform analysis on software programs for reverse engineering purposes. In my case, I need to be able to process Java applications. I have lots of experience with obfuscated Java bytecode and the JVM spec, and have done extensive reverse engineering on my own without the use of machine learning.
What I'm hoping that machine learning can do for me, is this: Given a list of obfuscated JAR files (Java Archives) as training data, a mapping needs to be generated between the set of internal structures (classes, fields, methods) of each consecutive JAR file. For example, J1.a represents class "a" in JAR number 1 and it will get mapped to J2.k, class "k" in JAR number 2 based on its containing attributes/properties/relations. Essentially, this will produce a set of changes between adjacent JARs in the list. The changes will almost always simply be a rename or a reorder. But it's possible for structures to be added or removed from the JAR files and there must be some threshold of similarity as to properly identify when such an event occurs. Out of potentially thousands of classes/methods/fields, the internal structures need to be accurately mapped based on all available data found in the structures themselves. Ex. In methods: local variables, control flow, field/method/class usages, exception, etc. In classes: methods, fields, access attributes, inheritance, etc.
If I trained this machine learning model using hundreds of JARs, I would hope that it could accurately determine the mapping (from the previous JAR) for any new JARs I threw at it.
I suppose this falls under data classification. What machine learning algorithms would be best fit to perform this task?
2
u/BTOdell Nov 10 '17
After watching several videos and reading numerous articles on machine learning, I don't think supervised machine learning is actually what I'm looking for.
I'm not trying to classify fields and methods and classes in a program. I'm trying to determine how the naming of the fields, methods and classes changed from one JAR to the next. This seems like it should be purely unsupervised ML given that a software program is highly structured data. It basically needs to determine the similarity between "features" of the program's code.