read()
all of that?<tjepsen@wisc.edu>
struct Record {
int id;
char name[32];
};
struct Record records[NUM_RECORDS];
for (int i = 0; i < NUM_RECORDS; i++)
read(fh, &records[i], sizeof(struct Record));
for (int i = 0; i < NUM_RECORDS; i++)
if (records[i].id == 7)
printf("%s\n", records[i].name);
read(fh, buff, 3);
(buff+0, buff+1, buff+2 are now tainted)0x123abc -> file.txt:37
$ xxd file.bin
0000000: 0102 ..
char a, b;
read(fd, &a, 1);
read(fd, &b, 1);
char x = a + b;
<A>
<B>7</B>
<C x="2"></C>
</A>
$ xmllint --xpath "//A/B/text()" file.xml
7
key1=value1
key2=value2
needle=haystack
foo=bar
document.getElementById('mycode').style.display = 'none';
document.getElementById('touch_lc').contentWindow.setLinksStyle(0.4);
var f = document.getElementById('touch_lc').contentWindow; f.setLinksStyle(0.4); f.highlightIns('400780', 'green');
var f = document.getElementById('touch_lc').contentWindow; f.setLinksStyle(0.4); f.highlightIns('400780', 'green'); f.highlightIns('400820', 'rgb(230, 85, 13)');
jnz
instructionCluster #0 [ 'k e y 1', 'k e y 2', 'f o o', 'b a r' ]
Cluster #1 [ '=', '0xa', '=', '0xa', '=', '0xa', '=', '0xa' ]
Cluster #2 [ 'v a l u e 1', 'v a l u e 2', 'n e e d l e', 'h a y s t a c k' ]
slicing is a method for automatically decomposing by analyzing their data flow and control flow. Starting from a subset of a program's behavior, slicing reduces that to a minimal form which still produces that behavior. The reduced , a "slice," is an independent guaranteed to represent faithfully the original within the domain of the specified subset of behavior.
Weiser, Mark. "Program slicing." Proceedings of the 5th international conference on Software engineering. IEEE Press, 1981.
read()
efficiency -- what % of bytes are used?
read()
efficiency: resultsunzip archive.zip a.txt
./gdbm-get-value key database.gdbm
SELECT * FROM Track WHERE TrackId=1337
jhead img.jpg
$ unzip -l archive.minimized.zip
Archive: archive.minimized.zip
Length Date Time Name
--------- ---------- ----- ----
33 12-05-2015 13:52 a.txt
7524 12-05-2015 14:48 LICENSE
--------- -------
7557 2 files
$ unzip archive.minimized.zip a.txt
Archive: archive.minimized.zip
inflating: a.txt
$ unzip archive.minimized.zip
Archive: archive.minimized.zip
inflating: a.txt
file #2: bad zipfile offset (local header sig): 95
read()
all of that!read()
ing all
those pages, you bookworms.
Explore more programs here: http://pages.cs.wisc.edu/~tjepsen/fileslice/
/