This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
indent -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 \ | |
-cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai \ | |
-saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1 \ | |
$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[suchakra@moria tracing]$ sudo ./open2ctf.py | |
trace path: /tmp/tmp26ga140x | |
^C[suchakra@moria tracing]$ babeltrace /tmp/tmp26ga140x | |
[00:24:50.796162597] (+?.?????????) 0 do_sys_open: { }, { pid = 909, comm = "iio-sensor-prox", filename = "/dev/iio:device2" } | |
[00:24:50.796399646] (+0.000237049) 0 do_sys_open: { }, { pid = 909, comm = "iio-sensor-prox", filename = "/dev/iio:device4" } | |
[00:24:50.801229686] (+0.004830040) 0 do_sys_open: { }, { pid = 1206, comm = "gnome-shell", filename = "/proc/self/stat" } | |
[00:24:50.801430938] (+0.000201252) 0 do_sys_open: { }, { pid = 1734, comm = "gnome-shell", filename = "/proc/self/stat" } | |
[00:24:50.807656245] (+0.006225307) 0 do_sys_open: { }, { pid = 18399, comm = "gnome-settings-", filename = "/proc/self/fd" } | |
[00:24:50.808197672] (+0.000541427) 0 do_sys_open: { }, { pid = 18399, comm = "gnome-settings-", filename = "" } | |
[00:24:50.816850646] (+0.008652974) 0 do_sys_open: { }, { pid = 18399, comm = "gsd-backlight-h", filename = "/etc/ld.so.cache" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.define :kerneldev do |kerneldev| | |
kerneldev.vm.box = "fedora/23-cloud-base" | |
kerneldev.vm.provider :libvirt do |domain| | |
domain.memory = 2048 | |
domain.cpus = 4 | |
end | |
config.vm.provision :shell, :path => "bootstrap.sh" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* addons/lttng-sched-filter.c | |
* | |
* A filtered version of sched_switch | |
* | |
* Copyright (C) 2014 Suchakra Sharma <suchakrapani.sharma@polymtl.ca> | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* addons/lttng-netif-filter.c | |
* | |
* A filtered version of netif_receive_skb | |
* | |
* Copyright (C) 2014 Suchakra Sharma <suchakrapani.sharma@polymtl.ca> | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void doGet(HttpServletRequest req, HttpServletResponse resp) { | |
String resourceName = req.getParameter( "resourceName" ); | |
BufferedReader r = new BufferedReader( new FileReader( resourceName ) ); | |
while ( ( x = r.readLine() ) != null ) { | |
resp.getWriter().println( x ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"groupId": "net.lingala.zip4j", | |
"artifactId": "zip4j", | |
"version": "1.3.2", | |
"callGraph": { | |
"cveId": "CVE-2018-1002202", | |
"versionRanges": [ | |
"[0,1.3.3)" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Basic Commands | |
============== | |
sl ocular -- --import scripts/deps.sc | |
import $file.scripts.java.ROOTKIT_suspicious_literals | |
cpg.method.fullName.l | |
cpg.method.name("executeQuery").caller.fullName.l | |
cpg.sink.method.name.l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// calltree.sc | |
// ----------- | |
// | |
// Suchakra Sharma <suchakra@shiftleft.io> (2019) | |
// | |
// Prints the complete call-tree with all possible branches starting from the top of the input method. It is recommended to increase | |
// the max steps per query to a higher number (eg. "config.query.maxStepsPerCallQuery = 1000000L") for better results. | |
// | |
// Example Usage: | |
// ocular> import $file.scripts.calltree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Get address from symbol (libdwarf version) | |
* Based on code by : Eli Bendersky (http://eli.thegreenplace.net) | |
* | |
*/ | |
#include <stdio.h> | |
#include <stdarg.h> | |
#include <stdlib.h> | |
#include <string.h> |