Skip to content

Commit 43a82f2

Browse files
authored
Merge pull request #595 from kernelwernel/dev
Updater script fix
2 parents efaa117 + 8b48d85 commit 43a82f2

File tree

4 files changed

+224
-169
lines changed

4 files changed

+224
-169
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ If you want to learn about the architecture and design of the library, head over
257257
<br>
258258

259259
## Issues, discussions, pull requests, and inquiries 📬
260-
If you have any suggestions, ideas, or any sort of contribution, feel free to ask! We'll be more than happy to discuss either in the [issue](https://github.com/kernelwernel/VMAware/issues) or [discussion](https://github.com/kernelwernel/VMAware/discussions) sections. We usually reply fairly quickly. If you want to personally ask something in private, our discords are `kr.nl` and `shenzken`
260+
If you have any suggestions, ideas, or any sort of contribution, feel free to ask! I'll be more than happy to discuss either in the [issue](https://github.com/kernelwernel/VMAware/issues) or [discussion](https://github.com/kernelwernel/VMAware/discussions) sections. If you want to personally ask something in private, my discord is `kr.nl`.
261261

262262
For email inquiries: `jeanruyv@gmail.com`
263263

auxiliary/updater.py

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# the structure of the headers for anybody reading it for the first
1818
# time, it's more of a guide to point which parts are this and that.
1919
#
20-
# 2. Update the dates in the banner, example: "1.9 (Septmber 2024)"
20+
# 2. Update the dates in the banner, example: "1.9 (September 2024)"
2121
#
2222
# ===============================================================
2323
#
@@ -308,16 +308,45 @@ def fetch_lib_info(enum_list):
308308
end_ptr = index
309309
break
310310

311+
312+
if start_ptr == -1:
313+
print(f"start position for technique table not found, aborting")
314+
sys.exit(1)
315+
316+
if end_ptr == -1:
317+
print(f"end position for technique table not found, aborting")
318+
sys.exit(1)
319+
320+
raw_technique_list = []
321+
322+
if end_ptr > start_ptr:
323+
raw_technique_list = [line.strip() for line in file_content[start_ptr+1:end_ptr]]
324+
311325
technique_list = []
312-
if start_ptr != -1 and end_ptr != -1 and end_ptr > start_ptr:
313-
technique_list = [line.strip() for line in file_content[start_ptr+1:end_ptr]]
326+
327+
for line in raw_technique_list:
328+
if line.startswith("#"):
329+
continue
330+
331+
if line == "":
332+
continue
333+
334+
technique_list.append(line)
314335

315336
for enum in enum_list:
316337
for enum_line in technique_list:
317338
if enum in enum_line:
318-
match = re.search(r'technique\((\d+)', enum_line)
319-
if match:
320-
technique[enum].score = int(match.group(1))
339+
matches = re.findall(r'\d+', enum_line)
340+
341+
if len(matches) == 0:
342+
print(f"could not find score number in technique table line, aborting")
343+
sys.exit(1)
344+
345+
if len(matches) > 2:
346+
print(f"found multiple score numbers in technique table line, aborting")
347+
sys.exit(1)
348+
349+
technique[enum].score = int(matches[0])
321350
break
322351

323352
# fetch more stuff, comment block surrounding the implementation line

0 commit comments

Comments
 (0)