flat assembler
Message board for the users of flat assembler.

Index > Main > Specialty Disassembler, limited instruction set

Author
Thread Post new topic Reply to topic
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Hey, I'm making a ... specialty ... disassembler, but I need to figure out a nice, stable instruction set that it will work with. I have disasmed several HLL programs (with Olly) and see that many include some libraries from who-knows-where that have quite a bit of FPU workings.

This project is in it's early stages of planning, and what I really need to do is make a list (smaller preferably) of instructions that will cover the majority of programs, but my main roadblock is FPU. I haven't used it before, and if you have could you please list the most common instructions used in FPU, that will cover 90% of FPU-using programs?
Post 12 Jun 2008, 17:26
View user's profile Send private message Visit poster's website Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak
No more giving back...


Last edited by kohlrak on 07 Aug 2008, 14:47; edited 1 time in total
Post 12 Jun 2008, 18:30
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Hmm, okay. I decided that I will only length-disassemble FPU instructions, but that clears things up. Thanks!
Post 12 Jun 2008, 18:40
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
A bit of advertisement Wink

All x87 FPU instructions:

http://ref.x86asm.net/coder32.html#xD8

The column that goes right before the mnemonic column indicates if the instruction pops the stack (p), or pushes (s), or pops twice (P).
Post 14 Jun 2008, 12:11
View user's profile Send private message Visit poster's website Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Hmm, thank you MazeGen.

My current step is to list all of the instructions that I will support, along with every possible form and thus opcodes that the disassembler will have to look for.

I decided to split it up into a length disassembler (to catch instructions that I don't support, marking them non-mutatable for next step), then processing the opcodes that I do know. Should work fine.
Post 14 Jun 2008, 17:04
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Why reinvent wheel? Use some existing disassembler. There is great one free opensource (BSD license) called DiStorm, google it.
Post 15 Jun 2008, 08:19
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade
Not a disassembler per-se, but its a debugger that includes disassembly support (they all need it), made by Feryno. It is 64-bit, but since this is for intel, it has to support all the 32-bit instructions too (except maybe push r32, i dont think your allowed to do any 32-bit push/pop in 64-bit), but anyway.. its just something for you to read over if you want, and the source is all fasm syntax.

http://board.flatassembler.net/topic.php?t=5045
Post 15 Jun 2008, 08:26
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17669
Location: In your JS exploiting you and your system
revolution
vid wrote:
Why reinvent wheel? Use some existing disassembler. There is great one free opensource (BSD license) called DiStorm, google it.
We all have to start learning somewhere. I saw this as a way for AlexP to get a feel for the CPU instructions and disassemblers etc. I see nothing wrong with writing some code and learning.

Why reinvent the car? The Ford model-T was cheap and reliable, just buy one and stop the car makers from wasting their time to reinvent.
Post 15 Jun 2008, 08:28
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
As for learning, it is a very good lesson of course, I too learnt instruction encoding by writing disassembler.

But if he wants to "get program done", not learn, in that case I suggest to use existing disasm.

By the way, there is very little i could imagine that could be improved in DiStorm.
Post 15 Jun 2008, 08:43
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Quote:
We all have to start learning somewhere. I saw this as a way for AlexP to get a feel for the CPU instructions and disassemblers etc. I see nothing wrong with writing some code and learning.
Exactly, plus it's not something that I can use a normal disassembler for. Maybe it would help me develop the main loop, but the nature of the beast is that it can be as un-optimized as I want.

The only catch is I cannot use any tables. this shouldn't be a problem at all, because the only disasmers I've seen with tables used were all LDE's. Again, I cannot use any existing disassembler, it is a limited set plus it will not be ... how should I say ... disasmed to something for humans.

It is part of a much larger project, but it is a very important part and I really like your suggestions. I have been looking at sources such as Olly's disasmer (in C, kind of odd style) and some LDE's. If I can agree on a good instr. set that will cover most programs (the disasmer will not cover anything but general-purpose instr.s), then all should go well.
Post 15 Jun 2008, 17:24
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.