aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ethyl.py2
-rw-r--r--parse-brlan.py6
-rw-r--r--parse-brlyt.py5
-rw-r--r--test.rlan.py (renamed from testrlan.py)0
-rw-r--r--test.rlyt.py (renamed from testrlyt.py)0
-rw-r--r--write-brlan.py6
-rw-r--r--write-brlyt.py6
7 files changed, 25 insertions, 0 deletions
diff --git a/ethyl.py b/ethyl.py
index 2e01409..0d283b4 100644
--- a/ethyl.py
+++ b/ethyl.py
@@ -356,3 +356,5 @@ def put_opt(var, flags, bit, size, item_type=None):
else:
raise Exception('unhandled')
return ret, flags
+def i2f(int):
+ return struct.unpack('>f', struct.pack('>I', int))[0] \ No newline at end of file
diff --git a/parse-brlan.py b/parse-brlan.py
index 2320e42..a2e57e9 100644
--- a/parse-brlan.py
+++ b/parse-brlan.py
@@ -1,6 +1,10 @@
import sys, struct, re
from ethyl import *
+if len(sys.argv) != 2:
+ print 'Usage: python parse-brlan.py something.brlan'
+ sys.exit(1)
+
f = open(sys.argv[1], 'rb')
rlan = f.read()
f.close()
@@ -35,7 +39,9 @@ for typ, chunk in ch:
offs = struct.unpack('>I', chunk[pos:pos+4])[0] - 8
name = chunk[offs:offs + 0x14].rstrip('\0')
+
aunk, aoffs = struct.unpack('>II', chunk[offs + 0x14:offs + 0x1c])
+ print name, hex(aoffs)
aoffs += offs
atyp = chunk[aoffs:aoffs+4]
#print hex(aoffs), hex(offs), name
diff --git a/parse-brlyt.py b/parse-brlyt.py
index 694cc12..44a0da0 100644
--- a/parse-brlyt.py
+++ b/parse-brlyt.py
@@ -1,6 +1,11 @@
import sys, struct, re
from ethyl import *
+if len(sys.argv) != 2:
+ print 'Usage: python parse-brlyt.py something.brlyt'
+ sys.exit(1)
+
+
f = open(sys.argv[1], 'rb')
rlyt = f.read()
f.close()
diff --git a/testrlan.py b/test.rlan.py
index 2abec49..2abec49 100644
--- a/testrlan.py
+++ b/test.rlan.py
diff --git a/testrlyt.py b/test.rlyt.py
index b260f49..b260f49 100644
--- a/testrlyt.py
+++ b/test.rlyt.py
diff --git a/write-brlan.py b/write-brlan.py
index e9fa710..f4a45fd 100644
--- a/write-brlan.py
+++ b/write-brlan.py
@@ -1,6 +1,12 @@
import sys, struct, re
from ethyl import *
+if len(sys.argv) != 3:
+ print 'Usage: python write-brlan.py input.rlan.py output.brlan'
+ print '(for example, see test.rlan.py)'
+ sys.exit(1)
+
+
CAT_COORDS = 0x1000000
CAT_2_UNK = 0x2000000 # alpha and stuff
COORD_X = 0
diff --git a/write-brlyt.py b/write-brlyt.py
index 3ff94bc..3b217ad 100644
--- a/write-brlyt.py
+++ b/write-brlyt.py
@@ -1,6 +1,12 @@
import sys, struct, re, random
from ethyl import *
+if len(sys.argv) != 3:
+ print 'Usage: python write-brlyt.py input.rlyt.py output.brlyt'
+ print '(for example, see test.rlyt.py)'
+ sys.exit(1)
+
+
f = open(sys.argv[1], 'r')
chunks = eval(f.read())
f.close()