Merge branch 'master' of https://git.mcdevitt.tech/bpmcdevitt/misc_rbtools
This commit is contained in:
commit
c23f5b6165
4 changed files with 1135716 additions and 122811 deletions
1240290
rpm_to_cve_parser/rpm-to-cve.xml
1240290
rpm_to_cve_parser/rpm-to-cve.xml
File diff suppressed because it is too large
Load diff
1
strace_parser/.gitignore
vendored
Normal file
1
strace_parser/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
strace.out
|
18199
strace_parser/strace.out
Normal file
18199
strace_parser/strace.out
Normal file
File diff suppressed because it is too large
Load diff
37
strace_parser/strace_parser.rb
Executable file
37
strace_parser/strace_parser.rb
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env ruby
|
||||
require 'pry'
|
||||
class StraceParser
|
||||
SYS_CALL_MATCHER = /\A[a-zA-Z_]*\(/
|
||||
|
||||
attr_accessor :file_lines
|
||||
def initialize(filepath)
|
||||
@file_lines = File.readlines(filepath).map(&:chomp)
|
||||
end
|
||||
|
||||
def sys_calls
|
||||
@file_lines.map do |line|
|
||||
matches = line.match(SYS_CALL_MATCHER)
|
||||
# catch any non-sys-call-matches. maybe we can fix the regex but this is fine for now.
|
||||
sys_call = matches.to_s.chomp("(") unless matches.to_s == ""
|
||||
end.compact
|
||||
end
|
||||
|
||||
def sys_call_counts
|
||||
sys_calls.group_by(&:itself).map {|k,v| [k, v.count] }.sort_by {|k,v|v}.reverse
|
||||
end
|
||||
|
||||
def open_sys_calls
|
||||
end
|
||||
|
||||
def read_sys_calls
|
||||
end
|
||||
|
||||
def write_sys_calls
|
||||
end
|
||||
end
|
||||
|
||||
# to test - why is my dbb-app segfaulting on my manjaro linux install?
|
||||
# something to do with qt5 but lets see if we can write a better tool to help
|
||||
filepath = './strace.out'
|
||||
parser = StraceParser.new(filepath)
|
||||
binding.pry
|
Loading…
Add table
Reference in a new issue