惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
Security Latest
Security Latest
S
Secure Thoughts
H
Heimdal Security Blog
The Last Watchdog
The Last Watchdog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security Affairs
PCI Perspectives
PCI Perspectives
C
CERT Recently Published Vulnerability Notes
C
CXSECURITY Database RSS Feed - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
爱范儿
爱范儿
腾讯CDC
P
Privacy & Cybersecurity Law Blog
量子位
T
Threat Research - Cisco Blogs
V
V2EX
S
Schneier on Security
P
Proofpoint News Feed
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
Forbes - Security
Forbes - Security
The Hacker News
The Hacker News
月光博客
月光博客
C
Cybersecurity and Infrastructure Security Agency CISA
Schneier on Security
Schneier on Security
L
LINUX DO - 最新话题
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Visual Studio Blog
S
SegmentFault 最新的问题
G
GRAHAM CLULEY
人人都是产品经理
人人都是产品经理
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cisco Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tenable Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

SumSec's Blog

AI Agent 工程的必然演进:CLI、Skills、Harne… 从安全角度谈Java反射机制--前章 · SUMSEC 从安全角度谈Java反射机制--终章 · SUMSEC 逆向学习fastjson反序列化始 · SUMSEC 2020年研究回顾总结 · SUMSEC Abstract syntax tree classes for … Analyzing data flow in Java · SUM… Annotations in Java · SUMSEC Basic query for Java code · SUMSEC BypassSuper使用介绍说明 · SUMSEC CodeQL Create OpenJdk/Jdk8 Databa… CodeQL library for Java · SUMSEC Navigating the call graph · SUMSEC Overflow-prone comparisons in Jav… Types in Java · SUMSEC Working with source locations · S… Expression · SUMSEC Formulas · SUMSEC Javadoc · SUMSEC Modules · SUMSEC Predicates · SUMSEC Queries · SUMSEC Type · SUMSEC Variables · SUMSEC 一道shiro反序列化题目引发的思考 · SUMSEC 修改ysoserial使其支持任意代码执行 · SUMSEC 自定义 ClassLoader 隔离运行不同版本jar包的方式 ·… 2020网鼎杯---Java文件上传wp · SUMSEC CNVD-2020-10487(CVE-2020-1938)tom… JDSRC安全课笔记 · SUMSEC Java反序列化链回显解决方案 · SUMSEC Skipped breakpoint because it hap… Windows Terminal 配置文件 · SUMSEC bypass 学习笔记之绕安全狗bypass safedog · … 一次意外的代码审计----JfinalCMS审计 · SUMSEC 一篇文章读懂Java代码审计之XXE · SUMSEC 从安全角度谈Java反射机制--序章 · SUMSEC 小楼昨夜又春风,你知ysoserial-Gadget-URLDNS… 春眠不觉晓,RCE知多少? · SUMSEC 漫谈Commons-Collections反序列化 · SUMSEC 漫谈Java反序列化 · SUMSEC 白头搔更短,SSTI惹人心! · SUMSEC 记一次面试题 · SUMSEC About Me 关于我 · SUMSEC Apache Flink任意Jar包上传导致远程代码执行 · SU… CVE-2019-1388 UAC提权复现 · SUMSEC CVE-2019-16097 || Harbor任意管理员注册漏洞… Python加密shellcode免杀 · SUMSEC Telegram机器人作为渗透测试框架 · SUMSEC VM虚拟机无法安装vmtools解决|本程序需要您将此虚拟机上安装… 谁能想到,电视遥控器竟成了 Vibe Coding 神器 · SU… 从手改 Skill 到自动进化:评测结果和执行轨迹如何让 Agen… 模型人人都能用,什么才是你能带走的?我的答案是一个可进化的SKIL… 模型人人都能用,什么才是你能带走的?我的答案是一个可进化的Skil… AI 时代 ShiroAttack2 5.x:修改了什么 · SU… 在 AGI 降临前,先给 AI 开一条”脑内弹幕”通道 · SUM… 一篇博文,三种时间:网页幻灯与 Remotion 动效的交付逻辑 … 🔍 别让大模型”想太多”:SKILL开发中的语义陷阱与抗幻觉设计 … 2022 年年度总结 · SUMSEC Java Swing To RCE 漏洞分析 · SUMSEC SpringBoot GatewayEL表达式漏洞分析 · SUM… Sensitive keys in codebases · SUM… 论如何优雅注入 Java 内存马 · SUMSEC SUMSEC 知识点 · SUMSEC VMWare Workspace ONE Access Auth … Spring Framework RCE CVE-2022-229… 相似度算法调研 · SUMSEC CVE-2022-33891 Apache Spark shell… 正则匹配配置不当 · SUMSEC Spring Data MongoDB SpEL CVE-2022… CodeQl Usage Tricks · SUMSEC Spring Boot RCE到内存马探索 · SUMSEC Shiro后渗透拓展面 · SUMSEC shiro反序列化漏洞攻击拓展面–修改key · SUMSEC GitHub Java CodeQL CTF · SUMSEC Hack-Tools 转化成Web · SUMSEC CodeQL与Shiro550碰撞 · SUMSEC CodeQL初见Shiro550 · SUMSEC CodeQL与AST之间联系 · SUMSEC Java加载动态链接库 · SUMSEC Log4j2 漏洞分析 · SUMSEC Interprocedural-Analysis 过程间分析 · … Data Analysis Foundation 数据分析基础 ·… Data Flow Analysis · SUMSEC Intermediate Representation 中间代表(… PII泄露–用CodeQL识别日志中的PII数据 · SUMSEC CodeQL workshop for Java: Unsafe … 前言 · SUMSEC 漏洞环境的搭建 · SUMSEC Fastjson回显 · SUMSEC Tomcat通用回显学习笔记 · SUMSEC 从Java反序列化漏洞题看CodeQL数据流 · SUMSEC 概述 · SUMSEC 记一次Log4j失败的Gadget挖掘记录 · SUMSEC Ysoserial改造记录 · SUMSEC JNDI注入 · SUMSEC shiro JRMP gadget · SUMSEC Fastjson MySQL gadget复现 · SUMSEC 2021年度总结 · SUMSEC
Aliases · SUMSEC
2026-07-17 · via SumSec's Blog

Aliases

Aliases

An alias is an alternative name for an existing QL entity.

别名是现有QL实体的替代名称。

Once you’ve defined an alias, you can use that new name to refer to the entity in the current module’s namespace.

一旦你定义了一个别名,你就可以使用这个新名字来引用当前模块命名空间中的实体。


Defining an alias定义别名

You can define an alias in the body of any module. To do this, you should specify:

您可以在任何模块的主体中定义别名。要做到这一点,您应该指定:

  1. The keyword module, class, or predicate to define an alias for a module, type, or non-member predicate respectively.

    关键字,或分别定义模块类型非成员谓词的别名。module``class``predicate

  2. The name of the alias. This should be a valid name for that kind of entity. For example, a valid predicate alias starts with a lowercase letter.

    别名的名字。这应该是此类实体的有效名称。例如,有效的谓词别名以小写字母开头。

  3. A reference to the QL entity. This includes the original name of the entity and, for predicates, the arity of the predicate.

    对QL实体的引用。这包括实体的原始名称,对于谓词,包括谓词的原名。

You can also annotate an alias. See the list of annotations available for aliases.

您还可以注释别名。请参阅可用于别名的注释列表。

Note that these annotations apply to the name introduced by the alias (and not the underlying QL entity itself). For example, an alias can have different visibility to the name that it aliases.

请注意,这些注释适用于别名引入的名称(而不是基础 QL 实体本身)。例如,别名可以与它所别名的名称具有不同的可见性。


Module aliases模块别名

Use the following syntax to define an alias for a module:

使用以下语法定义模块的别名:

module ModAlias = ModuleName;

For example, if you create a new module NewVersion that is an updated version of OldVersion, you could deprecate the name OldVersion as follows:

例如,如果您创建了更新版本的新模块,则可以将名称弃用如下:NewVersion``OldVersion``OldVersion

deprecated module OldVersion = NewVersion;

That way both names resolve to the same module, but if you use the name OldVersion, a deprecation warning is displayed.

这样,两个名称都会解决到同一模块,但如果您使用该名称,将显示弃用警告。OldVersion


Type aliases类型别名

Use the following syntax to define an alias for a type:

使用以下语法定义一种类型的别名:

class TypeAlias = TypeName;

Note that class is just a keyword. You can define an alias for any type—namely, primitive types, database types and user-defined classes.

请注意,这只是一个关键字。您可以为任何类型定义别名,即原始类型数据库类型和用户定义的类class

For example, you can use an alias to abbreviate the name of the primitive type boolean to bool:

例如,可以使用别名将基元类型boolean的名称缩写为bool

class bool = boolean;

Or, to use a class OneTwo defined in a module M in OneTwoThreeLib.qll, you could create an alias to use the shorter name OT instead:

或者,如果要使用OneTwoThreeLib.qll中M模块中定义的OneTwo类,你可以创建一个别名,使用更短的名字OT来代替。

import OneTwoThreeLib

class OT = M::OneTwo;

...

from OT ot
select ot

image-20210316160600475


Predicate aliases谓词别名

Use the following syntax to define an alias for a non-member predicate:

使用以下语法来定义非成员谓词的别名:

predicate PredAlias = PredicateName/Arity;

This works for predicates with or without result.

这适用于有结果或无结果的谓词。

For example, suppose you frequently use the following predicate, which calculates the successor of a positive integer less than ten:

例如,假设你经常使用下面的谓词,它计算一个小于10的正整数getSuccessor:

int getSuccessor(int i) {
  result = i + 1 and
  i in [1 .. 9]
}

You can use an alias to abbreviate the name to succ:

你可以用别名来缩写名字succ

predicate succ = getSuccessor/1;

示例:

int getSuccessor(int i) {
    result = i + 1 and
    i in [1 .. 9]
}

predicate succ = getSuccessor/1;

from int i
select succ(i)

image-20210316161029513

As an example of a predicate without result, suppose you have a predicate that holds for any positive integer less than ten:

另一个没有结果的谓词的例子,假设你有一个对任何小于10的正整数都成立的谓词。

predicate isSmall(int i) {
  i in [1 .. 9]
}

You could give the predicate a more descriptive name as follows:

您可以给谓词一个更描述性的名称如下:

predicate lessThanTen = isSmall/1;

示例:

predicate isSmall(int i) {
    i in [1 .. 9]
}

predicate lessThanTen = isSmall/1;

from int i
where lessThanTen(i)
select i

image-20210316162008023