diff options
| author | comex <comexk@gmail.com> | 2009-02-17 23:46:31 -0500 |
|---|---|---|
| committer | comex <comexk@gmail.com> | 2009-02-17 23:46:31 -0500 |
| commit | 5089b4a5cd8b40a02187b4969bd97fba81f9d8f1 (patch) | |
| tree | 6bf871dfc15f02975e49b00997432ee3c4ad04c6 | |
| parent | 8504fb221559b57e38650be3a88bfafa02bf0998 (diff) | |
Helpfulness.
| -rw-r--r-- | ethyl.py | 2 | ||||
| -rw-r--r-- | parse-brlan.py | 6 | ||||
| -rw-r--r-- | parse-brlyt.py | 5 | ||||
| -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.py | 6 | ||||
| -rw-r--r-- | write-brlyt.py | 6 |
7 files changed, 25 insertions, 0 deletions
@@ -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..c2a2ce4 100644 --- a/write-brlan.py +++ b/write-brlan.py @@ -1,6 +1,12 @@ import sys, struct, re from ethyl import * +if len(sys.argv) != 2: + 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..b0119bb 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) != 2: + 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() |
