Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: Interpreting Assembly

by misc (Friar)
on Dec 02, 2019 at 18:13 UTC ( [id://11109559]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Interpreting Assembly
in thread Interpreting Assembly

> ..what Addressing Modes are.

I'd say, it's only about parsing the syntax.
The registers ( ds, cs , .. ), depending on the architecture,
have to be stored anyways.

Furthermore, I didn't get so close yet,
but the MIPS architecture/assembly seems to be a good target as intermediate language between c and perl.
(according to schmorp, who chose the architecture cause it's simplicity for his emulator
http://blog.schmorp.de/2015-07-01-emulating-linux-mips-in-perl-3.html)

Oh, and I did find the movfuscator,
which "compiles programs into "mov" instructions, and only "mov" instructions. Arithmetic, comparisons, jumps, function calls, and everything else a program needs are all performed through mov operations; there is no self-modifying code, no transport-triggered calculation, and no other form of non-mov cheating."
:)) haven't got the thing to compile yet.
And I can't imagine yet, how this should work at all.

But this would not only solve the problem of addressing the pseudo ram,
it might render the resulting code close to undebuggable.
As long as there is no tool, which translates back into "normal" code.
When this is possible at all.

Replies are listed 'Best First'.
Re^5: Interpreting Assembly
by LanX (Saint) on Dec 03, 2019 at 12:41 UTC
    > it's only about parsing the syntax

    Not only, by far not...

    ... but this doesn't matter much because your approach(es) are far away from what I would ever consider. :)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      > ... but this doesn't matter much because your approach(es) are far away from what I would ever consider. :)

      ;) That's close to challenging me.

      Admittedly, the whole approach is not exactly, what I'd consider good programming practice.

      But since I've got a special goal, this might justify the .special. tools.

      And an assembly interpreter could be of some use; for debugging, e.g.

      Oh, about reverse engineering and the obfuscator,
      youtube: REcon 2015 - The movfuscator (Christopher Domas) 33m20s
      --nope. :)

      There are a few parts, the password hashing, salting and storage to be exact, where this is exactly what I need.

      I still don't really get, how a program consisting of only mov instructions can work.
      But this seems perfect.

      Albeit I again have to reread the encryption algorithms now, I must find a way to separate the "secret" passphrase from the rest of the algorithm.
      Movfusculating the whole enc-/decryption algorithm might be a tiny little bit hungry for resources.
      Even this is great for a cryptographic tool. But the process should finish within, say, a few minutes..
        > I still don't really get, how a program consisting of only mov instructions can work.

        I didn't look into the concrete implementation but...

        In the assembler I used JMP was basically just a MOV into the PC register.

        And any arithmetic calculation can be simulated with lookup tables.

        So what's left?

        > But this seems perfect

        From an academic point of view ... ;)

        Honestly it shouldn't be too difficult to decode once the approach is obvious.

        And security by obscurity is not a very strong approach.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11109559]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-03-28 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found