<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://sound.bai-hua.org/index.php?action=history&amp;feed=atom&amp;title=Dynasty_Warriors_Online_file_extractor</id>
		<title>Dynasty Warriors Online file extractor - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://sound.bai-hua.org/index.php?action=history&amp;feed=atom&amp;title=Dynasty_Warriors_Online_file_extractor"/>
		<link rel="alternate" type="text/html" href="https://sound.bai-hua.org/index.php?title=Dynasty_Warriors_Online_file_extractor&amp;action=history"/>
		<updated>2026-10-01T13:44:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>https://sound.bai-hua.org/index.php?title=Dynasty_Warriors_Online_file_extractor&amp;diff=286&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;&lt;pre&gt; #!/usr/bin/python # # Dynasty Warriors Online file extractor 0.1 by hcs  import io from sys import argv from struct import unpack  def unpack_file(infile, offset, name):   ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://sound.bai-hua.org/index.php?title=Dynasty_Warriors_Online_file_extractor&amp;diff=286&amp;oldid=prev"/>
				<updated>2011-05-24T17:06:06Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; #!/usr/bin/python # # Dynasty Warriors Online file extractor 0.1 by hcs  import io from sys import argv from struct import unpack  def unpack_file(infile, offset, name):   ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
#&lt;br /&gt;
# Dynasty Warriors Online file extractor 0.1 by hcs&lt;br /&gt;
&lt;br /&gt;
import io&lt;br /&gt;
from sys import argv&lt;br /&gt;
from struct import unpack&lt;br /&gt;
&lt;br /&gt;
def unpack_file(infile, offset, name):&lt;br /&gt;
    infile.seek(offset)&lt;br /&gt;
&lt;br /&gt;
    # check the header&lt;br /&gt;
    if infile.read(4) != &amp;quot;KOVS&amp;quot;:&lt;br /&gt;
        return 0&lt;br /&gt;
&lt;br /&gt;
    # read file size&lt;br /&gt;
    file_size = unpack(&amp;#039;&amp;lt;I&amp;#039;,infile.read(4))[0]&lt;br /&gt;
&lt;br /&gt;
    # skip padding&lt;br /&gt;
    # TODO: check that padding is all 0s?&lt;br /&gt;
    infile.seek(offset+0x20)&lt;br /&gt;
&lt;br /&gt;
    # read the file&lt;br /&gt;
    oggbuf = bytearray(file_size)&lt;br /&gt;
    infile.readinto(oggbuf)&lt;br /&gt;
&lt;br /&gt;
    # deobfuscate&lt;br /&gt;
    for i in range(0,0x100):&lt;br /&gt;
        oggbuf[i] = oggbuf[i] ^ i&lt;br /&gt;
&lt;br /&gt;
    # write to the output&lt;br /&gt;
    outfile = open(name,&amp;#039;wb&amp;#039;)&lt;br /&gt;
    outfile.write(oggbuf)&lt;br /&gt;
&lt;br /&gt;
    print name, file_size, &amp;quot;bytes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    return 1&lt;br /&gt;
&lt;br /&gt;
###&lt;br /&gt;
&lt;br /&gt;
if len(argv) != 2:&lt;br /&gt;
    print &amp;quot;Decrypt Ogg files from Dynasty Warriors Online&amp;quot;&lt;br /&gt;
    print &amp;quot;usage: dwo_xor.py input.bin&amp;quot;&lt;br /&gt;
    exit(1)&lt;br /&gt;
&lt;br /&gt;
# open input&lt;br /&gt;
infile_name = argv[1]&lt;br /&gt;
infile = open(infile_name,&amp;#039;rb&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
# try to just dump file straightaway&lt;br /&gt;
if unpack_file(infile, 0, &amp;#039;%s.ogg&amp;#039; % infile_name):&lt;br /&gt;
    print &amp;quot;ok&amp;quot;&lt;br /&gt;
    exit(0)&lt;br /&gt;
&lt;br /&gt;
# read known parts of header&lt;br /&gt;
infile.seek(0xC)&lt;br /&gt;
header_size, subfile_count = unpack(&amp;#039;&amp;lt;IxxxxI&amp;#039;,infile.read(12))&lt;br /&gt;
&lt;br /&gt;
if header_size != 0x18 + 4*subfile_count:&lt;br /&gt;
    print &amp;quot;header consistency check failed&amp;quot;&lt;br /&gt;
    exit(1)&lt;br /&gt;
&lt;br /&gt;
file_offsets = unpack(&amp;#039;&amp;lt;&amp;#039;+&amp;#039;I&amp;#039;*subfile_count,infile.read(4*subfile_count))&lt;br /&gt;
for offset in file_offsets:&lt;br /&gt;
    if not unpack_file(infile, offset, \&lt;br /&gt;
        &amp;#039;%s_%08x.ogg&amp;#039; % \&lt;br /&gt;
        (infile_name, offset)):&lt;br /&gt;
        print &amp;quot;unpack failed&amp;quot;&lt;br /&gt;
        exit(1)&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;ok!&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>