{"id":1115,"date":"2017-11-01T20:32:05","date_gmt":"2017-11-01T20:32:05","guid":{"rendered":"https:\/\/www.codedread.com\/blog\/?p=1115"},"modified":"2017-11-01T20:40:59","modified_gmt":"2017-11-01T20:40:59","slug":"comic-book-archive-files-with-rarvm","status":"publish","type":"post","link":"https:\/\/www.codedread.com\/blog\/archives\/2017\/11\/01\/comic-book-archive-files-with-rarvm\/","title":{"rendered":"Comic Book Archive files with RarVM in JavaScript"},"content":{"rendered":"<p><a href=\"https:\/\/codedread.github.io\/kthoom\/index.html\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codedread.com\/clipart\/kthoom.svgz\" width=\"100\" height=\"100\" style=\"float:right\" alt=\"Logo for the kthoom comic book reader\"\/><\/a><\/p>\n<p>I use my open source comic book reader, <a href=\"https:\/\/codedread.github.io\/kthoom\/index.html\">kthoom<\/a>, quite a bit (more than I probably should!).  Every once in awhile, I'll come across a comic book file that kthoom won't open and I'll delightedly set some time aside in the evening\/weekend to work on fixing the JavaScript.  Hacking keeps me sane.<!--more--><\/p>\n<p>This year, I uncovered several CBR files that use a little-known feature in the <a href=\"https:\/\/en.wikipedia.org\/wiki\/RAR_(file_format)\">RAR format<\/a> for a VM (virtual machine).  If it sounds ridiculous that an archive format has <a href=\"http:\/\/blog.cmpxchg8b.com\/2012\/09\/fun-with-constrained-programming.html\">support for a VM<\/a>, you're not alone - and I think it was removed in later versions of the RAR archiver (someone correct me if I'm wrong!).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codedread.com\/clipart\/zipper.svgz\" width=\"150\" height=\"150\" style=\"float:right\" alt=\"Clipart image of a zipper\" \/><\/p>\n<p>Anyway I've been steadily <a href=\"https:\/\/github.com\/codedread\/bitjs\/issues\/4\">building support<\/a> for the various filters in RarVM into my <a href=\"https:\/\/github.com\/codedread\/bitjs\">Binary Tools for JavaScript<\/a> open source library.  Perhaps the smarter thing to do would be to use <a href=\"http:\/\/asmjs.org\/\">asm.js<\/a> or <a href=\"http:\/\/webassembly.org\/\">WebAssembly<\/a> and some tools to convert the C\/C++ unrar project into JavaScript, but I'm having fun reverse-engineering the code and improving the documentation \/ understanding while porting it to a new language, so leave me alone! \ud83d\ude1b<\/p>\n<p>In terms of <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comic_book_archive\">Comic Book Archive files<\/a>, kthoom supports CBZ, CBR and CBT files.  I've never encountered a CB7 \/ CBA file - but it might be a fun and ambitious project to add support for 7zip and Ace compression formats to bitjs.archive... hint hint \ud83d\ude00<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use my open source comic book reader, kthoom, quite a bit (more than I probably should!). Every once in awhile, I&#8217;ll come across a comic book file that kthoom won&#8217;t open and I&#8217;ll delightedly set some time aside in the evening\/weekend to work on fixing the JavaScript. Hacking keeps me sane.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,200,25,11,28],"tags":[],"class_list":["post-1115","post","type-post","status-publish","format-standard","hentry","category-comic-books","category-open-source","category-software","category-technology","category-web"],"_links":{"self":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/1115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/comments?post=1115"}],"version-history":[{"count":7,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/1115\/revisions"}],"predecessor-version":[{"id":1124,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/posts\/1115\/revisions\/1124"}],"wp:attachment":[{"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/media?parent=1115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/categories?post=1115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codedread.com\/blog\/wp-json\/wp\/v2\/tags?post=1115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}