{"id":226,"date":"2006-03-18T15:08:18","date_gmt":"2006-03-18T23:08:18","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=226"},"modified":"2006-03-18T15:20:42","modified_gmt":"2006-03-18T23:20:42","slug":"xan-binary-decoding","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/xan-binary-decoding\/","title":{"rendered":"Xan Binary Decoding"},"content":{"rendered":"<p>In the time-honored tradition of avoiding real work, I made an extension to <a href=\"http:\/\/www.xinehq.de\/\">xine<\/a> that will decode <a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=Origin_Xan_Codec\">Origin&#8217;s Xan codec<\/a> (FourCC: Xxan). This is despite my long-standing policy that I will not invest any effort into making open source programs leverage closed, binary code in order to decode data.<\/p>\n<p><center><br \/>\n<img decoding=\"async\" src=\"\/eggs\/images\/wc4-title.jpg\" alt=\"Wing Commander IV Title\" \/><br \/>\n<\/center><\/p>\n<p>I have no intention of committing it to the xine codebase because, really, who cares? But let&#8217;s see <a href=\"http:\/\/www.mplayerhq.hu\/\">MPlayer<\/a> decode Xan data! Ha! <em>Oh, why do I provoke them so? They&#8217;re going to have a workable decoder 20 minutes after I post this.<\/em><\/p>\n<p>If you care, I posted the xine plugin code here: <a href=\"http:\/\/multimedia.cx\/xan\/\">http:\/\/multimedia.cx\/xan\/<\/a>. This is based on <a href=\"http:\/\/wcrevival.de\/hcl\/\">M\u00e1rio Brito&#8217;s<\/a> extensive Wing Commander research. It needs a very large table for decoding (128KB of data expressed in ASCII text) and that&#8217;s contained in xandata.h[.bz2]. Ideally, I think that table is supposed to be generated by some DLL function. Xan samples and the xanlib.dll are located at the <a href=\"http:\/\/www.mplayerhq.hu\/MPlayer\/samples\/game-formats\/wc4-xan\/\">MPlayer samples repository<\/a>.<\/p>\n<p>This particular plugin is based on one of my old <a href=\"http:\/\/multimedia.cx\/pre\/re-xan.html\">reverse engineering experiments<\/a>. The reason I took on this task is because loading xanlib.dll and calling into it isn&#8217;t especially difficult. At least, none of the relevant functions are dependent upon any external functions. Thus, I just used a few strategic mmap() functions and loaded the binary code directly into specific memory regions. Oh, the code only works on x86 architectures, of course.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finally &#8212; watch those WC4 movies&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,22,4],"tags":[],"class_list":["post-226","post","type-post","status-publish","format-standard","hentry","category-open-source-multimedia","category-origin-xan","category-reverse-engineering"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":0,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/226\/revisions"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}