-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathragsplit
executable file
·88 lines (72 loc) · 2.43 KB
/
ragsplit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
#
# fenris - program execution path analysis tool
# ---------------------------------------------
#
# Copyright (C) 2001, 2002 by Bindview Corporation
# Portions Copyright (C) 2001, 2002 by their respective contributors
# Developed and maintained by Michal Zalewski <lcamtuf@coredump.cx>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
echo "ragnarok output file splitter -- written by negative, fixed by lcamtuf"
if [ "$2" = "" ]; then
echo "Usage: $0 ragnarok_outfile output_dir"
echo
exit 1
fi
WHEREIS=./splitter.pl
if [ ! -x splitter.pl ]; then
WHEREIS=`which splitter.pl 2>/dev/null`
if [ "$WHEREIS" = "" ]; then
echo "Error: 'splitter.pl' must be in current directory or in path."
echo
exit 1
fi
fi
$WHEREIS $1 $2
if [ ! -d $2 ]; then
echo "Error: no output generated."
echo
exit 1
fi
cd $2
RULE='s/#A1/index.html/g;s/#A2/calls.html/g;s/#A3/params.html/g;s/#A4/buffers.html/g;s/#A5/io.html/g;s/#A6/raw.html/g;s/#f/calls.html#f/g;s/#d/io.html#d/g;s/#l/raw.html#l/g;s/#S/params.html#S/g;'
# index.html
cat header.txt > index.html
cat index.txt | sed $RULE >> index.html
cat footer.txt >> index.html
# calls.html
cat header.txt > calls.html
cat calls.txt | sed $RULE >> calls.html
cat footer.txt >> calls.html
# params.html
cat header.txt > params.html
cat params.txt | sed $RULE >> params.html
cat footer.txt >> params.html
# buffers.html
cat header.txt > buffers.html
cat buffers.txt | sed $RULE >> buffers.html
cat footer.txt >> buffers.html
# io.html
cat header.txt > io.html
cat io.txt | sed $RULE >> io.html
cat footer.txt >> io.html
# raw.html
cat header.txt > raw.html
cat raw.txt | sed $RULE >> raw.html
cat footer.txt >> raw.html
# delete the unused
rm -f raw.txt footer.txt header.txt io.txt buffers.txt params.txt calls.txt index.txt