Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 4_memcpy_definitions.ql
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
import cpp

from Function func
where func.getName() = "memcpy"
select func
5 changes: 4 additions & 1 deletion 5_macro_definitions.ql
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
import cpp


from Macro macro
where macro.getName() in ["ntohs", "ntohl", "ntohll"]
select macro
4 changes: 4 additions & 0 deletions 6_memcpy_calls.ql
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
import cpp

from FunctionCall call
where call.getTarget().getName() = "memcpy"
select call
4 changes: 4 additions & 0 deletions 7_macro_invocations.ql
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
import cpp

from MacroInvocation invocation
where invocation.getMacroName() in ["ntohs", "ntohl", "ntohll"]
select invocation
5 changes: 5 additions & 0 deletions 8_macro_expressions.ql
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@

import cpp

from MacroInvocation invocation
where invocation.getMacroName() in ["ntohs", "ntohl", "ntohll"]
select invocation.getExpr()
11 changes: 11 additions & 0 deletions 9_class_network_byteswap.ql
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
import cpp

class NetworkByteSwap extends Expr {
NetworkByteSwap() {
exists(MacroInvocation invocation |
invocation.getMacroName() in ["ntohs", "ntohl", "ntohll"] and
invocation.getExpr() = this
)
}
}

from NetworkByteSwap n select n