Skip to content

Commit

Permalink
Updates cache module (#97)
Browse files Browse the repository at this point in the history
* cache module
  • Loading branch information
Beakerboy committed Mar 2, 2023
1 parent 9d40101 commit b766bde
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions tests/Functional/test_dirObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ def test_dirStream():
"FF FF 00 00 01 00 53 94 FF FF FF FF 00 00 00 00",
"02 3C FF FF FF FF 00 00")
module_cache.object_table = bytes.fromhex(" ".join(object_table))
module_cache.pcode = b''
module_cache.misc = [0x0316, 0x032D, 0x0123, 0x88, 8,
module_cache.misc = [0x0316, 0x0123, 0x88, 8,
0x18, "00000000", 1]

this_workbook = DocModule("ThisWorkbook")
Expand All @@ -81,7 +80,7 @@ def test_dirStream():
module1.cookie.value = 0xB241
module_cache.clear_variables()
module_cache.cookie = module1.cookie.value
module_cache.misc = [0x0316, 0x027D, 3, 0, 2,
module_cache.misc = [0x0316, 3, 0, 2,
0xFFFF, "FFFFFFFF", 0]
module_cache.indirect_table = struct.pack("<iI", -1, 0x78)
module1.set_cache(module_cache.to_bytes())
Expand Down
5 changes: 2 additions & 3 deletions tests/Functional/test_fullFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_fullFile():
project.setPerformanceCacheVersion(0x00B5)

module_cache = ModuleCache(0xB5, 0x08F3)
module_cache.misc = [0x0316, 0x032D, 0x0123, 0x88, 8, 0x18, "00000000", 1]
module_cache.misc = [0x0316, 0x0123, 0x88, 8, 0x18, "00000000", 1]
indirect_table = ("02 80 FE FF FF FF FF FF 20 00 00 00 FF FF FF FF",
"30 00 00 00 02 01 FF FF 00 00 00 00 00 00 00 00",
"FF FF FF FF FF FF FF FF 00 00 00 00 2E 00 43 00",
Expand All @@ -79,7 +79,6 @@ def test_fullFile():
"FF FF 00 00 01 00 53 94 FF FF FF FF 00 00 00 00",
"02 3C FF FF FF FF 00 00")
module_cache.object_table = bytes.fromhex(" ".join(object_table))
module_cache.pcode = b''

# Add Modules
this_workbook = DocModule("ThisWorkbook")
Expand Down Expand Up @@ -107,7 +106,7 @@ def test_fullFile():
module1 = StdModule("Module1")
module1.cookie.value = 0xB241
module_cache.clear_variables()
module_cache.misc = [0x0316, 0x027D, 3, 0, 2, 0xFFFF, "FFFFFFFF", 0]
module_cache.misc = [0x0316, 3, 0, 2, 0xFFFF, "FFFFFFFF", 0]
module_cache.indirect_table = struct.pack("<iI", -1, 0x78)
module_cache.module_cookie = 0xB241
module1.addWorkspace(26, 26, 1349, 522, 'Z')
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/Models/Entities/test_doc_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def test_normalize():

cache = ModuleCache(0xB5, 0x08F3)
cache.module_cookie = 0xB81C
cache.misc = [0x0316, 0x032D, 0x0123, 0x88, 8, 0x18, "00000000", 1]
cache.misc = [0x0316, 0x0123, 0x88, 8, 0x18, "00000000", 1]
guid = uuid.UUID('0002081900000000C000000000000046')
cache.guid = bytes(("0{" + str(guid) + "}").upper(), "utf_16_le")

Expand All @@ -22,7 +22,6 @@ def test_normalize():
"FF FF 00 00 01 00 53 94 FF FF FF FF 00 00 00 00",
"02 3C FF FF FF FF 00 00")
cache.object_table = bytes.fromhex(" ".join(object_table))
cache.pcode = b''

module = DocModule("foo")
path1 = "vbaProjectCompiler/blank_files/ThisWorkbook.cls"
Expand Down

0 comments on commit b766bde

Please sign in to comment.