You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
I'm looking for a very simple disassembler in PB source code to handle small chunks of code. The simpler the better, file handling not required. A few things on the forums, but either inconclusive or buggy (or I missed it!)
I'm looking for a very simple disassembler in PB source code to handle small chunks of code. The simpler the better, file handling not required.
Hmm, a "simple x86 disassembler" ... *scratches head*
Sorry, I don't think anybody can help you there
There's always going to be a fair bit of code to get the job done properly, or it's going to be a very ordinary disassembler that does a mediocre and often inaccurate job.
If you search the subjects of the Source Code forum in POFFS for "disas" you'll find two examples by Tony Burcham, the second in particular sounds what you're after ...
Line-by-Line PB Disassembly Generator (Dec 2003)
"This program creates a file of line-by-line disassembly of PowerBASIC code (PBDLL, PBWin7 or PBCC). That is, it takes a line of PB source code and follows it with the disassembly of that line from the compiled exe."
DisAsm: a free, open source disassembler for PBWin7 (May 2004)
"It currently disassembles all general-purpose, FPU and the &H0F-escaped instructions of the Pentium4 CPU. The code for all the remaining instructions is already "roughed in", and mainly needs operand decoders written for them. 99% or more of the output seems to be accurate at this time."
--
Also, TheirWare Corporation released DisAsm and DisProc in 2004, complete with Powerbasic source code. See http://home.midsouth.rr.com/theirware/
[edit - Tony Burcham is TheirWare Corp, so im guessing the code on his website is more up-to-date]
--
I also ported the LDE32 Length Disassembly Engine to Powerbasic a few years ago, I'll post it to the source code forum now but I don't think it will be useful for your current needs as it just breaks down a chunk of binary code into its instructions but doesn't add mnemonics. For example, 1BC0F7D8C3 would become:
1BC0
F7D8
C3
It may well be that Mr Burcham is just more honest about his work than others, but I got the impression that it is more of a work in progress than I was looking for. I could be wrong and if anyone has positive experience of this code I would be very interested in their experience. The current resting place of the code is explained on the Theirware site:
The DisAsm project has moved to SourceForge.net under the new name BinEditPlus. It has already had many bugs-fixed and improvements added. Only the source code has been published at SourceForge (in the CVS).
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment