icoa-cli 2.19.459 → 2.19.461

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/commands/ai4ctf.js +1 -1
  2. package/dist/commands/ctf4ai-demo.js +1 -1
  3. package/dist/commands/ctf4vla.js +1 -1
  4. package/dist/commands/exam.js +1 -1
  5. package/dist/commands/learn.js +1 -1
  6. package/dist/commands/ref.js +1 -1
  7. package/dist/lib/lazy-assets.js +1 -0
  8. package/dist/lib/learn-curricula.js +1 -1
  9. package/dist/lib/learn-render.js +1 -1
  10. package/dist/lib/learn-replies.js +1 -1
  11. package/dist/lib/py-syntax.js +1 -1
  12. package/package.json +1 -2
  13. package/refs/ROPgadget.txt +0 -67
  14. package/refs/base64.txt +0 -63
  15. package/refs/bash.txt +0 -79
  16. package/refs/binwalk.txt +0 -43
  17. package/refs/bs4.txt +0 -61
  18. package/refs/checksec.txt +0 -57
  19. package/refs/curl.txt +0 -73
  20. package/refs/cyberchef.txt +0 -78
  21. package/refs/exiftool.txt +0 -50
  22. package/refs/ffuf.txt +0 -73
  23. package/refs/gcc.txt +0 -66
  24. package/refs/gdb.txt +0 -83
  25. package/refs/hashcat.txt +0 -64
  26. package/refs/hint.txt +0 -48
  27. package/refs/icoa.txt +0 -72
  28. package/refs/john.txt +0 -74
  29. package/refs/linux.txt +0 -58
  30. package/refs/nc.txt +0 -64
  31. package/refs/nmap.txt +0 -57
  32. package/refs/numpy.txt +0 -59
  33. package/refs/openssl.txt +0 -75
  34. package/refs/pillow.txt +0 -67
  35. package/refs/pwntools.txt +0 -79
  36. package/refs/pycrypto.txt +0 -77
  37. package/refs/python.txt +0 -103
  38. package/refs/r2.txt +0 -85
  39. package/refs/regex.txt +0 -73
  40. package/refs/requests.txt +0 -83
  41. package/refs/rules.txt +0 -28
  42. package/refs/scapy.txt +0 -80
  43. package/refs/sqlmap.txt +0 -69
  44. package/refs/steghide.txt +0 -71
  45. package/refs/struct.txt +0 -61
  46. package/refs/sympy.txt +0 -77
  47. package/refs/tshark.txt +0 -65
  48. package/refs/vim.txt +0 -74
  49. package/refs/volatility.txt +0 -41
  50. package/refs/z3.txt +0 -78
package/refs/python.txt DELETED
@@ -1,103 +0,0 @@
1
- Python 3 Quick Reference
2
- ========================
3
-
4
- DATA TYPES
5
- x = 42 int
6
- x = 3.14 float
7
- s = "hello" str
8
- b = b"\x41\x42" bytes
9
- L = [1, 2, 3] list
10
- T = (1, 2, 3) tuple
11
- D = {"a": 1} dict
12
- S = {1, 2, 3} set
13
-
14
- STRINGS
15
- s.upper() / s.lower() Case conversion
16
- s.strip() Remove whitespace
17
- s.split(",") Split to list
18
- ",".join(L) Join list to string
19
- s.replace("a", "b") Replace
20
- s.startswith("he") Check prefix
21
- s.encode() str → bytes
22
- b.decode() bytes → str
23
- f"Value: {x}" F-string formatting
24
-
25
- BYTES & ENCODING
26
- bytes.fromhex("4142") Hex string → bytes
27
- b.hex() Bytes → hex string
28
- import base64
29
- base64.b64encode(b) Base64 encode
30
- base64.b64decode(s) Base64 decode
31
-
32
- LIST OPERATIONS
33
- L.append(x) Add to end
34
- L.extend([4,5]) Extend list
35
- L.pop() Remove last
36
- L[1:3] Slice
37
- L[::-1] Reverse
38
- sorted(L) Sort (new list)
39
- [x*2 for x in L] List comprehension
40
- len(L) Length
41
-
42
- DICT OPERATIONS
43
- D["key"] Get value
44
- D.get("key", default) Get with default
45
- D.keys() All keys
46
- D.values() All values
47
- D.items() Key-value pairs
48
- {**D1, **D2} Merge dicts
49
-
50
- FILE I/O
51
- with open("f.txt") as f:
52
- content = f.read()
53
-
54
- with open("f.txt", "w") as f:
55
- f.write("data")
56
-
57
- with open("f.bin", "rb") as f:
58
- data = f.read()
59
-
60
- USEFUL MODULES
61
- import os OS operations
62
- import sys System-specific
63
- import re Regular expressions
64
- import json JSON parsing
65
- import hashlib Hash functions
66
- import struct Binary packing
67
- import socket Network sockets
68
- import subprocess Run commands
69
- import itertools Iteration tools
70
- import collections Specialized containers
71
-
72
- COMMON PATTERNS
73
- # Read binary file
74
- data = open("file", "rb").read()
75
-
76
- # Decode an attached-data file (exam practicals save the blob to
77
- # challenges/q<N>.txt inside the sandbox — base64, hex, or plain text)
78
- import base64, re
79
- blob = open("challenges/q36.txt").read().strip() # replace N
80
- raw = base64.b64decode(blob) # if base64
81
- # raw = bytes.fromhex(blob) # if hex
82
- m = re.search(rb"ICOA\{[^}]+\}", raw)
83
- print(m.group().decode() if m else "no flag in raw bytes")
84
-
85
- # Hex dump
86
- print(data.hex())
87
-
88
- # XOR bytes
89
- result = bytes(a ^ b for a, b in zip(d1, d2))
90
-
91
- # HTTP request
92
- import requests
93
- r = requests.get(url)
94
- r = requests.post(url, data={"key": "val"})
95
-
96
- # Run command
97
- import subprocess
98
- out = subprocess.check_output(["cmd", "arg"])
99
-
100
- # Regex
101
- import re
102
- m = re.search(r"pattern", text)
103
- matches = re.findall(r"pattern", text)
package/refs/r2.txt DELETED
@@ -1,85 +0,0 @@
1
- Radare2 Quick Reference
2
- =======================
3
-
4
- STARTING
5
- r2 binary Open binary
6
- r2 -d binary Debug mode
7
- r2 -A binary Auto-analyze on open
8
- r2 -w binary Write mode
9
-
10
- ANALYSIS
11
- aaa Full analysis
12
- afl List functions
13
- afl~main Find main function
14
- afn name addr Rename function
15
- axt addr Cross-references to
16
- axf addr Cross-references from
17
-
18
- NAVIGATION
19
- s main Seek to function
20
- s 0x401000 Seek to address
21
- s+10 / s-10 Seek forward/back
22
-
23
- DISASSEMBLY
24
- pd 20 Disassemble 20 instructions
25
- pdf Disassemble current function
26
- pdf @ main Disassemble main
27
- pD 100 Disassemble 100 bytes
28
-
29
- PRINT DATA
30
- px 64 Hex dump 64 bytes
31
- ps @ addr Print string
32
- pf d @ addr Print as integer
33
- p8 16 Print 16 hex bytes
34
-
35
- VISUAL MODE
36
- V Enter visual mode
37
- VV Graph mode
38
- p/P Cycle views in visual
39
- q Quit visual
40
-
41
- SEARCHING
42
- / string Search for string
43
- /x 90909090 Search hex pattern
44
- /R pop rdi Search ROP gadget
45
- iz List strings in data
46
- izz List all strings
47
-
48
- INFORMATION
49
- i File info
50
- ie Entry point
51
- iS Sections
52
- ii Imports
53
- iE Exports
54
- is Symbols
55
- il Libraries
56
-
57
- FLAGS / COMMENTS
58
- f name @ addr Set flag (bookmark)
59
- CC comment @ addr Add comment
60
- CCu Remove comment
61
-
62
- WRITE MODE (r2 -w)
63
- wx 9090 @ addr Write hex bytes
64
- wa "nop" @ addr Write assembly
65
-
66
- DEBUG
67
- db addr Breakpoint
68
- dc Continue
69
- ds Step
70
- dr Show registers
71
- dr rax=0 Set register
72
-
73
- COMMON CTF PATTERNS
74
- # Quick analysis
75
- r2 -A binary
76
- afl # list functions
77
- s main # go to main
78
- pdf # disassemble
79
-
80
- # Find strings
81
- iz~flag
82
- iz~password
83
-
84
- # Decompile (with r2ghidra)
85
- pdg @ main # Ghidra decompiler output
package/refs/regex.txt DELETED
@@ -1,73 +0,0 @@
1
- Regular Expressions Quick Reference
2
- ====================================
3
-
4
- BASIC PATTERNS
5
- . Any character (except newline)
6
- \d Digit [0-9]
7
- \D Non-digit
8
- \w Word character [a-zA-Z0-9_]
9
- \W Non-word character
10
- \s Whitespace
11
- \S Non-whitespace
12
- \b Word boundary
13
-
14
- ANCHORS
15
- ^ Start of string/line
16
- $ End of string/line
17
- \A Start of string only
18
- \Z End of string only
19
-
20
- QUANTIFIERS
21
- * 0 or more
22
- + 1 or more
23
- ? 0 or 1
24
- {n} Exactly n
25
- {n,} n or more
26
- {n,m} Between n and m
27
- *? +? ?? Non-greedy versions
28
-
29
- CHARACTER CLASSES
30
- [abc] a, b, or c
31
- [a-z] Lowercase letters
32
- [A-Z] Uppercase letters
33
- [0-9] Digits
34
- [^abc] NOT a, b, or c
35
- [a-zA-Z0-9] Alphanumeric
36
-
37
- GROUPS & REFERENCES
38
- (pattern) Capture group
39
- (?:pattern) Non-capture group
40
- (?P<name>pat) Named group (Python)
41
- \1 Back-reference to group 1
42
- (?=pattern) Lookahead
43
- (?!pattern) Negative lookahead
44
- (?<=pattern) Lookbehind
45
- (?<!pattern) Negative lookbehind
46
-
47
- ALTERNATION
48
- a|b a or b
49
- (cat|dog) cat or dog
50
-
51
- COMMON CTF PATTERNS
52
- # Flag format
53
- icoa\{[^}]+\}
54
-
55
- # IP address
56
- \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
57
-
58
- # Hex string
59
- [0-9a-fA-F]+
60
-
61
- # Base64
62
- [A-Za-z0-9+/]+=*
63
-
64
- # Email
65
- [\w.+-]+@[\w-]+\.[\w.]+
66
-
67
- # URL
68
- https?://[^\s]+
69
-
70
- GREP EXAMPLES
71
- grep -E "icoa\{.*\}" file Find flags
72
- grep -oP "\d+\.\d+\.\d+\.\d+" f Extract IPs
73
- grep -rn "password" . Search recursively
package/refs/requests.txt DELETED
@@ -1,83 +0,0 @@
1
- Python Requests Quick Reference
2
- ===============================
3
-
4
- INSTALLATION
5
- pip install requests
6
-
7
- BASIC REQUESTS
8
- import requests
9
-
10
- r = requests.get(url)
11
- r = requests.post(url, data={"key": "val"})
12
- r = requests.put(url, json={"key": "val"})
13
- r = requests.delete(url)
14
- r = requests.head(url)
15
- r = requests.options(url)
16
-
17
- RESPONSE
18
- r.status_code HTTP status code
19
- r.text Response body (str)
20
- r.content Response body (bytes)
21
- r.json() Parse JSON response
22
- r.headers Response headers
23
- r.cookies Response cookies
24
- r.url Final URL (after redirects)
25
- r.elapsed Time elapsed
26
- r.history Redirect history
27
-
28
- PARAMETERS
29
- # URL parameters
30
- r = requests.get(url, params={"q": "search"})
31
-
32
- # Headers
33
- r = requests.get(url, headers={"Authorization": "Bearer tok"})
34
-
35
- # Cookies
36
- r = requests.get(url, cookies={"session": "abc"})
37
-
38
- # POST data (form-encoded)
39
- r = requests.post(url, data={"user": "admin"})
40
-
41
- # POST JSON
42
- r = requests.post(url, json={"user": "admin"})
43
-
44
- # File upload
45
- r = requests.post(url, files={"file": open("f", "rb")})
46
-
47
- # Timeout
48
- r = requests.get(url, timeout=5)
49
-
50
- # Disable SSL verification
51
- r = requests.get(url, verify=False)
52
-
53
- # Follow redirects
54
- r = requests.get(url, allow_redirects=False)
55
-
56
- # Proxy
57
- r = requests.get(url, proxies={"http": "http://127.0.0.1:8080"})
58
-
59
- SESSIONS (persist cookies, headers)
60
- s = requests.Session()
61
- s.headers.update({"Authorization": "Bearer tok"})
62
- s.get(url) # cookies persist
63
- s.post(url, data=data) # same session
64
-
65
- AUTH
66
- from requests.auth import HTTPBasicAuth
67
- r = requests.get(url, auth=HTTPBasicAuth("user", "pass"))
68
- # shorthand:
69
- r = requests.get(url, auth=("user", "pass"))
70
-
71
- CTF PATTERNS
72
- # SQL injection test
73
- r = requests.get(url, params={"id": "1' OR '1'='1"})
74
-
75
- # Cookie manipulation
76
- r = requests.get(url, cookies={"admin": "true"})
77
-
78
- # Brute force
79
- for word in open("wordlist.txt"):
80
- r = requests.post(url, data={"pass": word.strip()})
81
- if "Success" in r.text:
82
- print(f"Found: {word}")
83
- break
package/refs/rules.txt DELETED
@@ -1,28 +0,0 @@
1
- ICOA 2026 Competition Rules
2
- ===========================
3
-
4
- FORMAT
5
- Jeopardy-style CTF
6
- Categories: Crypto, Web, Pwn, Reverse, Forensics
7
- Day 1: AI4CTF — Classic CTF with AI-assisted solving
8
- Day 2: CTF4AI — Attacking AI models
9
-
10
- HINT BUDGET
11
- Level A (General Guidance): 50 uses
12
- Level B (Deep Analysis): 10 uses
13
- Level C (Critical Assist): 2 uses
14
- Token Cap: 50,000 tokens
15
-
16
- RULES
17
- - All tools must run inside the Docker sandbox
18
- - Flag format: icoa{...}
19
- - No collaboration between teams during competition
20
- - All AI prompts are logged and auditable
21
- - Competition times are enforced server-side
22
- - Submitting after competition ends is not allowed
23
-
24
- SCORING
25
- - Each challenge has fixed point value
26
- - First-blood bonus may apply
27
- - Final ranking by total score
28
- - Ties broken by submission time
package/refs/scapy.txt DELETED
@@ -1,80 +0,0 @@
1
- Scapy Quick Reference
2
- =====================
3
-
4
- INSTALLATION
5
- pip install scapy
6
-
7
- BASIC USAGE
8
- from scapy.all import *
9
-
10
- PACKET CREATION
11
- # IP packet
12
- pkt = IP(dst="10.0.0.1")
13
-
14
- # TCP SYN
15
- pkt = IP(dst="10.0.0.1")/TCP(dport=80, flags="S")
16
-
17
- # UDP packet
18
- pkt = IP(dst="10.0.0.1")/UDP(dport=53)/DNS()
19
-
20
- # ICMP ping
21
- pkt = IP(dst="10.0.0.1")/ICMP()
22
-
23
- # HTTP request
24
- pkt = IP(dst="10.0.0.1")/TCP(dport=80)/Raw(b"GET / HTTP/1.1\r\n\r\n")
25
-
26
- SEND / RECEIVE
27
- send(pkt) Layer 3 send (no response)
28
- sr(pkt) Send and receive (layer 3)
29
- sr1(pkt) Send and receive 1 packet
30
- sendp(pkt) Layer 2 send
31
- srp(pkt) Layer 2 send and receive
32
-
33
- READING PCAP
34
- pkts = rdpcap("capture.pcap")
35
- pkts.summary()
36
- pkts[0].show()
37
-
38
- # Filter packets
39
- tcp_pkts = [p for p in pkts if TCP in p]
40
- http = [p for p in pkts if p.haslayer(Raw)]
41
-
42
- # Extract data
43
- for p in pkts:
44
- if Raw in p:
45
- print(p[Raw].load)
46
-
47
- WRITING PCAP
48
- wrpcap("output.pcap", pkts)
49
-
50
- PACKET INSPECTION
51
- pkt.show() Show packet details
52
- pkt.summary() One-line summary
53
- ls(TCP) List TCP fields
54
- pkt[TCP].sport Access field
55
- pkt.haslayer(TCP) Check layer exists
56
- hexdump(pkt) Hex dump
57
-
58
- SNIFFING
59
- pkts = sniff(count=10)
60
- pkts = sniff(filter="tcp port 80", count=10)
61
- sniff(prn=lambda p: p.summary())
62
-
63
- COMMON CTF PATTERNS
64
- # Extract HTTP data from pcap
65
- pkts = rdpcap("capture.pcap")
66
- for p in pkts:
67
- if TCP in p and Raw in p:
68
- data = p[Raw].load
69
- if b"flag" in data or b"icoa{" in data:
70
- print(data)
71
-
72
- # DNS exfiltration
73
- dns_pkts = [p for p in pkts if DNS in p]
74
- for p in dns_pkts:
75
- if DNSQR in p:
76
- print(p[DNSQR].qname)
77
-
78
- # Reconstruct TCP stream
79
- from scapy.layers.http import *
80
- load_layer("http")
package/refs/sqlmap.txt DELETED
@@ -1,69 +0,0 @@
1
- SQLMap Quick Reference
2
- =====================
3
-
4
- BASIC USAGE
5
- sqlmap -u "http://target/page?id=1"
6
- sqlmap -u "http://target/page?id=1" --dbs List databases
7
- sqlmap -u "http://target/page?id=1" -D db --tables List tables
8
- sqlmap -u "http://target/page?id=1" -D db -T tbl --dump Dump table
9
-
10
- POST REQUEST
11
- sqlmap -u "http://target/login" --data="user=a&pass=b"
12
- sqlmap -u "http://target/login" --data="user=a&pass=b" -p user
13
-
14
- FROM FILE (Burp/ZAP request)
15
- sqlmap -r request.txt
16
-
17
- DETECTION
18
- --level=5 Increase test level (1-5)
19
- --risk=3 Increase risk level (1-3)
20
- -p param Test specific parameter
21
- --dbms=mysql Specify DBMS
22
- --technique=BEUSTQ Specify techniques
23
-
24
- ENUMERATION
25
- --current-user Current database user
26
- --current-db Current database
27
- --dbs List all databases
28
- --tables List tables
29
- --columns List columns
30
- --dump Dump data
31
- --dump-all Dump everything
32
- --passwords Enumerate password hashes
33
- --privileges User privileges
34
-
35
- AUTHENTICATION
36
- --cookie="session=abc" Cookie
37
- --headers="Authorization: Bearer tok" Header
38
- --auth-type=basic --auth-cred=user:pass
39
- --proxy=http://127.0.0.1:8080
40
-
41
- TECHNIQUES
42
- B Boolean-based blind
43
- E Error-based
44
- U Union query
45
- S Stacked queries
46
- T Time-based blind
47
- Q Inline queries
48
-
49
- OPTIONS
50
- --batch Auto-answer all questions
51
- --threads=5 Parallel threads
52
- --random-agent Random User-Agent
53
- --tamper=space2comment Use tamper script
54
- --os-shell OS command shell
55
- --sql-shell SQL interactive shell
56
- --file-read=/etc/passwd Read file
57
- --file-write=shell.php --file-dest=/var/www/shell.php
58
-
59
- COMMON CTF PATTERNS
60
- # Basic enumeration
61
- sqlmap -u "http://target/?id=1" --batch --dbs
62
- sqlmap -u "http://target/?id=1" --batch -D ctf --tables
63
- sqlmap -u "http://target/?id=1" --batch -D ctf -T flag --dump
64
-
65
- # Bypass WAF
66
- sqlmap -u URL --tamper=space2comment,between,randomcase
67
-
68
- # Read flag file
69
- sqlmap -u URL --file-read="/flag.txt"
package/refs/steghide.txt DELETED
@@ -1,71 +0,0 @@
1
- Steghide & Steganography Quick Reference
2
- =========================================
3
-
4
- STEGHIDE
5
- # Embed data in image
6
- steghide embed -cf image.jpg -ef secret.txt
7
- steghide embed -cf image.jpg -ef secret.txt -p "password"
8
-
9
- # Extract hidden data
10
- steghide extract -sf image.jpg
11
- steghide extract -sf image.jpg -p "password"
12
-
13
- # Get info about embedded data
14
- steghide info image.jpg
15
-
16
- # Supported formats: JPEG, BMP, WAV, AU
17
-
18
- ZSTEG (PNG/BMP)
19
- zsteg image.png All checks
20
- zsteg -a image.png Try all combinations
21
- zsteg image.png -b 1 Check LSB
22
- zsteg image.png -E "b1,r,lsb" Extract specific channel
23
-
24
- STEGSOLVE (GUI)
25
- java -jar stegsolve.jar
26
- # Cycle through bit planes
27
- # XOR / AND / OR images
28
-
29
- OTHER TOOLS
30
- # strings — find readable text
31
- strings file
32
- strings -n 10 file Min length 10
33
- strings -e l file Little-endian
34
-
35
- # exiftool — metadata
36
- exiftool image.jpg
37
- exiftool -all= image.jpg Remove all metadata
38
-
39
- # pngcheck — PNG structure
40
- pngcheck -v image.png
41
-
42
- # foremost — file carving
43
- foremost -i image.png -o ./output/
44
-
45
- # outguess
46
- outguess -r image.jpg output.txt
47
- outguess -k "password" -r image.jpg output.txt
48
-
49
- LSB STEGANOGRAPHY (Python)
50
- from PIL import Image
51
-
52
- img = Image.open("steg.png")
53
- px = img.load()
54
- bits = ""
55
- for y in range(img.height):
56
- for x in range(img.width):
57
- r, g, b = px[x, y][:3]
58
- bits += str(r & 1)
59
- bits += str(g & 1)
60
- bits += str(b & 1)
61
-
62
- msg = bytes(int(bits[i:i+8], 2) for i in range(0, len(bits), 8))
63
- print(msg)
64
-
65
- COMMON CTF WORKFLOW
66
- 1. strings file Look for readable text
67
- 2. exiftool file Check metadata / comments
68
- 3. binwalk file Check for embedded files
69
- 4. steghide info file Check for steghide data
70
- 5. zsteg file (if PNG) Check LSB channels
71
- 6. Compare with original Visual / binary diff
package/refs/struct.txt DELETED
@@ -1,61 +0,0 @@
1
- Python struct Module Quick Reference
2
- ====================================
3
-
4
- IMPORT
5
- import struct
6
-
7
- PACK (Python → bytes)
8
- struct.pack("<I", 0x41414141) Little-endian uint32
9
- struct.pack(">I", 0x41414141) Big-endian uint32
10
- struct.pack("<Q", addr) Little-endian uint64
11
- struct.pack("<HH", 0x1234, 0x5678) Two uint16
12
-
13
- UNPACK (bytes → Python)
14
- struct.unpack("<I", data) → (value,) tuple
15
- struct.unpack("<II", data) → (val1, val2)
16
- val = struct.unpack("<I", data)[0] Single value
17
-
18
- FORMAT CHARACTERS
19
- Byte order:
20
- < Little-endian
21
- > Big-endian
22
- ! Network (big-endian)
23
- = Native
24
-
25
- Types:
26
- b / B int8 / uint8 (1 byte)
27
- h / H int16 / uint16 (2 bytes)
28
- i / I int32 / uint32 (4 bytes)
29
- l / L int32 / uint32 (4 bytes)
30
- q / Q int64 / uint64 (8 bytes)
31
- f float (4 bytes)
32
- d double (8 bytes)
33
- s char[] (N bytes)
34
- x padding (1 byte)
35
-
36
- SIZE
37
- struct.calcsize("<IHH") Calculate packed size
38
-
39
- COMMON CTF PATTERNS
40
- # Read binary header
41
- with open("file", "rb") as f:
42
- magic = struct.unpack("<I", f.read(4))[0]
43
- size = struct.unpack("<H", f.read(2))[0]
44
-
45
- # Parse ELF header fields
46
- data = open("binary", "rb").read()
47
- e_entry = struct.unpack("<Q", data[0x18:0x20])[0]
48
-
49
- # Build payload with addresses
50
- payload = b""
51
- payload += struct.pack("<Q", 0x400000) # return addr
52
- payload += struct.pack("<Q", 0x601020) # GOT entry
53
-
54
- # Unpack multiple values
55
- fields = struct.unpack("<IIHH", data[:12])
56
- id, flags, type, size = fields
57
-
58
- # Iterate over array of structs
59
- ENTRY_SIZE = struct.calcsize("<IIQ")
60
- for i in range(0, len(data), ENTRY_SIZE):
61
- a, b, c = struct.unpack("<IIQ", data[i:i+ENTRY_SIZE])