 |
|
 |
Hi,
I've a requirement in my project where I need to find out No.of lines of Code(LOC) from a binary file. I've only the application's binary file not the source files.
I'd like to know is there a way we can find out the LOC from the available binary file. My purpose would be achieved even if the LOC inlcudes third party libraries stuff.
Kindly let me know is there any tool to find out this.
Thanks in advance,
Regards,
Skumar
|
|
|
|
 |
|
 |
There is no way you can calculate no of lines in the binary files, may be you can if debug info stored in the file is of any use.
But if the binary exe file is of release build, say good bye to connting no of lines. Simply not possible.
-prakash
|
|
|
|
 |
|
 |
Very mad, didn't think CP was turning into an advertisement site.
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
 |
|
|
 |
|
 |
Jerry,
the product articles you mentioned are in a special section of CodeProject called the "Showcase". This should be the only spot where there are advertorials, and if they do exist elsewhere I agree that they should not be there.
Troy
|
|
|
|
 |
|
 |
Ahhh. I didn't notice that myself.
So maybe it is just in the wrong section.
I like the idea of Binary Templates so am thinking of writing my own. I am trying to keep it as compatible with this one as possible but without a complete grammar it will be chancy.
Jerry
|
|
|
|
 |
|
 |
I'll tell you why there is no source code. It's because you will NEVER release the source code, and the reason for that is because your intention is to sell the product, and releasing the source code would be giving it away!!
If you are simply interested in selling your product, why don't you take out an 'ad' with CodeProject and no one will have any doubt as to what your true intention is?
To simply release a "watered down" version of what you're selling, is nothing more than a diversionary tactic to hide your real intent.
I don't have a problem with you (or anyone) trying to capitalize on something you (or they) may have worked hard to produced, but to sneak in your product this way in order to gain the attention of the huge CodeProject membership, is very much against one of the fundamental principles of CodeProject of providing the source code with what gets published on its website.
You've published a work you clearly intend to sell, and decided to use CodeProject as the place from which you hope to make some sale!! Nothing is wrong with that; just go ahead and take out an 'ad' with CodeProject to advertise the product.
William
Fortes in fide et opere!
|
|
|
|
 |
|
 |
I agree. This is nothing more than an ad, which is why I voted '1'.
That said, since I was doing a little reverse engineering yesterday, I decided to try out the product, and it's pretty slick. I've seen this idea of 'templates' before in a hex editor, but never so well implemented (IMO). It certainly speeds the reverse-engineering process.
The product isn't quite 'polished' enough to warrant my $40, but I'd certainly have to re-evaluate any new versions.
For the author's benefit, here's a summary of the errors and annoyances I encountered:
- I managed to get into some weird state where clicking in the template editor window gave an error message (every time), so I could no longer edit the template. Luckily I was able to save it, but the app crashed on exit.
- My preferred Cut/Copy/Paste hotkeys (Shift+Delete, Ctrl+Insert, Shift+Insert) don't work consistently.
- I want options to toggle between hex/decimal display in all windows (template, auto, etc.), for all columns (offset, length, value, etc.)
- The right-click 'copy' command on the template window doesn't work. And a 'copy all' (or the ability to multi-select) would be useful.
Ian J Prest
|
|
|
|
 |
|
 |
Thank you for your comments and suggestions. I apologize for the "commercial" nature of this article. We are interested in pushing Binary Templates as an open standard for other authors to use. I wrote this article to inform people about Binary Templates and maybe get other people interested in using them. Right now, only 010 Editor supports these Templates, but hopefully that will change in the future.
Binary Templates are really a new language and this is the source code that is provided. To get the "compiler" (i.e. 010 Editor) it is a commercial product - just like ANSI C is an open standard but you have to pay for Visual C++.
We apologize for any bugs and we'll work towards solving these problems right away. Your feature suggestions are great - some of these were already planned for the next version.
Thanks again.
Graeme
|
|
|
|
 |
|
 |
You're not the only hex editor that supports binary templates. Breakpoit Softwares HexWorkshop has supported them for a couple versions now. See http://www.hexworkshop.com/ for reference.
HexWorkshop's is more mature and looks like C++ versus the painfully outdated Delphi look. I'd encourage you to write it in C++.
Having said all that, I do like some of your features but will not buy or use it because I dislike the dreadful gui. I also agree that this should not have been posted due to it's commercial nature. This is CODEproject.com not ADproject.com.
Thanks,
Darren
|
|
|
|
 |
|
 |
If Binary Templates are a new language and are being pushed as an open standard for other authors to use, then really we need a complete grammar so that we can implement them in our own programs.
I am interested in using them but there isn't enough info in this article to allow me to do that. We do have a reference implementation - the 010 Editor, but can you supply a grammar and other tools that would allow this open standard to be used by others?
Jerry
|
|
|
|
 |
|
 |
We are still interested in pushing Binary Templates as an open standard and are hoping to release some sort of SDK and/or grammar definition to allow other tools to use Binary Templates. Because of other time commitments, these have been slow in coming out but we hope to have something released near the end of the summer. Thanks for your feedback!
Graeme
|
|
|
|
 |
|
 |
> We are interested in pushing Binary Templates as an open standard ...
Dear gsweet,
I would like to remind you that I emailed soon after you released the first version of 0101 editor (after I noticed that you had copied many of my ideas in your hex editor). I offered that we should work together to create some sort of standard template file format, to which you declined.
Andrew Phillips
http://www.hexedit.com
andrew @ hexedit.com
|
|
|
|
 |
|
 |
Often I need to read and understand some obscure binary file formats and this is just what I needed.
Great idea!
You got my 5!
Trying to make bits uncopyable is like trying to make water not wet.
-- Bruce Schneier
By the way, dog_spawn isn't a nickname - it is my name with an underscore instead of a space. -- dog_spawn
|
|
|
|
 |
|
 |
I was very tempted to do something like this in C#, but it seems like a huge job (lack of unions/fixed arrays). IMO this is excellent
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
 |
|
 |
I no more have to take my hand calculator to compute data offset, just loading a template that highlight data areas
Already writing some templates for JPEG files, PNG files, MPG files, ... I ever dreamt of ! Now I can !
Kochise
PS : The article is ugly, short, not well explained, but hey dog_spawn, that's not only what makes the interrest of a submission
In Code we trust !
|
|
|
|
 |
|
 |
Thanks for the great comments. Sorry about the brevity of the article - it really does need some more information to make it easier to understand. Cheers!
Graeme
|
|
|
|
 |
|
 |
> Great idea!
I only just came across this article but I should correct a few misconceptions.
Binary templates as they are called in this article are a great idea, but they are MY idea. This like many other features of the 010 editor are borrowed from my hex editor (see http://www.hexedit.com).
Also the FREE version of my hex editor (HexEdit 2.5F) includes templates. You can also get the source for free (although it includes the commercial BCG library - but that will be incorporated info MFC shortly).
Andrew Phillips
http://www.hexedit.com
andrew @ hexedit.com
|
|
|
|
 |
|
 |
I do not think this is better than doing IO the normal way. Typically we use either the STL or some other kind of stream and reader/writer based architecture. I doubt many people use old style C/procedural techniques in this day and age. If there are many simple and reliable techniques to do IO in C++, why is the system this article presents any better? Surely, your system actually adds another layer of complexity?
To convince me otherwise, you need to make far more detailed comparisons. Good luck
|
|
|
|
 |
|
 |
Hello dog_spawn
Binary Templates are not meant to replace the IO your program does. Instead Binary Templates are used as an easy way to parse apart binary files and visually inspect and edit them. For example, I can run a Template on a corrupted ZIP files and visually see where the corruption starts quite easily. Streams are a great way of doing IO in C++, but many binary file formats are easily described in terms of C/C++ structures. If you have a binary format written with streams then it may not be worth it to write a Binary Template. However, if you run into problems with the file, you can fairly easily write up a Template so you can visually inspect the file with 010 Editor.
Hope this answers some of your questions. Cheers!
Graeme
|
|
|
|
 |
|
 |
Thanks, that has helped me to understand Ok, I can see the need of looking at files outside the original intended program, but I still find it a bit hard to believe it would be better than just getting out Visual Studio. I need convincing on the practical side of things: can data be looked at in a useful way not in the context of the original program? But, this is obviously where the examples come in.
I'll look at this tool in more detail, because it is very interesting!
gsweet wrote:
For example, I can run a Template on a corrupted ZIP files and visually see where the corruption starts quite easily.
Sounds scary, but also useful
|
|
|
|
 |
|
 |
> ...but I still find it a bit hard to believe it would be better than just getting out Visual Studio.
Believe me you can write templates in hours that would take weeks or months to code in C++.
Andrew Phillips
http://www.hexedit.com
andrew @ hexedit.com
|
|
|
|
 |