I have a so. library which I know the "C" interface but I don't have access to the source code only the disassembled code which is hard to understand at least for me. I know the input parameters (including the expected ranges of the parameters) and I get the corresponding result of the formula. I wrote a small program to test every combination of the input parameters and record the results.

For example I recorded these pairs (all possible combinations are over 430.000):


I already tried to train a neural network + back propagation with k=5 sigmoid activation neuron and 1 hidden layer with a learn factor of gamma=0.1 and 10000 steps but I get only poor results. It is possible to train a neural network to generate nearly the same results (for example with an error of ~0.001) as the so. library function? Is my neural network wrong? Is there a better method?

Any idea or help is welcome!


thanks @Rok Tavčar I added an image of the data points as a 3d plot. enter image description here It looks like two linear 2d surfaces but at some point it jumps a bit. I guess I can divide it as two linear functions. Now, I need to figure out how I do a 2d linear regression. If somebody could give me hint that would be grateful.

Nevertheless, the .so library has more complex functions, which dimensional is higher (up to 6). So I can't plot it anymore. I need a more general approach but I will also give it a try to understand the disassembled arm code as @0xC0000022L suggested.

  • 1
    Hi and welcome to RE.SE. The questions you ask are off-topic and what you don't ask is up to anyone's guess. What's wrong with trying to learn to understand the disassembly? Any specific questions regarding that would be perfectly on-topic here. – 0xC0000022L Aug 20 '18 at 20:34

No, you cannot use neural network (NN) to solve problems like this (you probably could, but it would be way to complex). If you already used NN you know that they can get output only if they see it in training set. For example in this case you would need to train NN on all possible outcomes. Another problem or how NN works is that they to set linear borders in each dimension of input data and try to find best match on which side of border is correct result. This is mostly usefull when output is discrete not continous.

What you could do beside disassembly is use SMT solver, but you will still need to know something about function you are trying to reverse.

Another out a box idea is that with so low possible combinations you can easily (Unless your function is slow) draw graph of (almost) all combinations and try to guess function.


thanks @all Finally, I was able to understand the disassembled code.

The function is as follow (I used IDA free for that):

static double test_function(double xmm0) {
    double xmm1 = 100.0;
    xmm1 = xmm1 - xmm0;
    xmm1 = xmm1 * 0.7;

    if (xmm1 < 50) {
        xmm1 = xmm1 * 1.02;
    } else {
        xmm1 = xmm1 * 0.98;

   return xmm1;

My first reverse engineered snippet from a disassembled code. Yay! :)

I will try to reverse engineer a more complex function. Maybe I need your help again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.