Skip to content

Commit

Permalink
add changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbt4104 committed Mar 27, 2020
1 parent b57c297 commit 903a91e
Show file tree
Hide file tree
Showing 94 changed files with 177 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions .hypothesis/examples/d66acbfad5faf5ba/f89ef66f1c0f711c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
�?�1x
Binary file not shown.
Empty file.
16 changes: 16 additions & 0 deletions fuzz_GARDNER.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from math import sqrt
from hypothesis import *
import hypothesis.strategies as st

@given(st.data())
def calc(data):
for _ in range(data.draw(st.integers())):
a, b, c = data.draw(st.integers()), data.draw(st.integers()), data.draw(st.integers())
area = (sqrt(3) * (a*a + b*b + c*c))/8
s = (a + b + c)/2
assume(a+b > c and abs(a - b) < c)
area += (1.5 * sqrt(s*(s-a)*(s-b)*(s-c)))
print('%.2f' % area)

if __name__ == "__main__":
calc()
26 changes: 26 additions & 0 deletions fuzz_LASTDIG.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
def getIt():
testCases=int(input())
allCases=[]
for i in range(testCases):
allCases.append(map(int,input().split()))
print(allCases[i])
return allCases

def lastDig(a,b):
if b<=4:
lastDigit=str(a**b)[-1]
return lastDigit
else:
if b%4==0:
return lastDig(a,4)
else:
return lastDig(a,b%4)


def main():
Tcases=getIt()
for case in Tcases:
print(lastDig(case[0],case[1]))

if __name__ == "__main__":
main()
62 changes: 62 additions & 0 deletions fuzz_djikstra.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import sys
import afl

class Graph():

def __init__(self, vertices):
self.V = vertices
self.graph = [[0 for column in range(vertices)]
for row in range(vertices)]

def printSolution(self, dist):
print("Vertex \tDistance from Source")
for node in range(self.V):
print(node, "\t", dist[node])

def minDistance(self, dist, sptSet):

min = sys.maxsize

for v in range(self.V):
if dist[v] < min and sptSet[v] == False:
min = dist[v]
min_index = v

return min_index

def dijkstra(self, src):

dist = [sys.maxsize] * self.V
dist[src] = 0
sptSet = [False] * self.V

for cout in range(self.V):

u = self.minDistance(dist, sptSet)

sptSet[u] = True

for v in range(self.V):
if self.graph[u][v] > 0 and sptSet[v] == False and \
dist[v] > dist[u] + self.graph[u][v]:
dist[v] = dist[u] + self.graph[u][v]

self.printSolution(dist)

# Driver program
g = Graph(9)
g.graph = [[0, 4, 0, 0, 0, 0, 0, 8, 0],
[4, 0, 8, 0, 0, 0, 0, 11, 0],
[0, 8, 0, 7, 0, 4, 0, 0, 2],
[0, 0, 7, 0, 9, 14, 0, 0, 0],
[0, 0, 0, 9, 0, 10, 0, 0, 0],
[0, 0, 4, 14, 10, 0, 2, 0, 0],
[0, 0, 0, 0, 0, 2, 0, 1, 6],
[8, 11, 0, 0, 0, 0, 1, 0, 7],
[0, 0, 2, 0, 0, 0, 6, 7, 0]
];

afl.init()
g.dijkstra(int(sys.stdin.read()))

# This code is contributed by Divyanshu Mehta
1 change: 1 addition & 0 deletions in/test1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
1 change: 1 addition & 0 deletions out/.cur_input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
17 changes: 17 additions & 0 deletions out/crashes/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Command line used to find this crash:

afl-fuzz -m 500 -t 9000 -i in -o out python fuzz_djikstra.py

If you can't reproduce a bug outside of afl-fuzz, be sure to set the same
memory limit. The limit used for this fuzzing session was 500 MB.

Need a tool to minimize test cases before investigating the crashes or sending
them to a vendor? Check out the afl-tmin that comes with the fuzzer!

Found any cool bugs in open-source tools using afl-fuzz? If yes, please drop
me a mail at <[email protected]> once the issues are fixed - I'd love to
add your finds to the gallery at:

http://lcamtuf.coredump.cx/afl/

Thanks :-)
1 change: 1 addition & 0 deletions out/crashes/id:000000,sig:10,src:000000,op:flip1,pos:0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 change: 1 addition & 0 deletions out/crashes/id:000001,sig:10,src:000000,op:flip1,pos:0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
r
1 change: 1 addition & 0 deletions out/crashes/id:000002,sig:10,src:000000,op:flip4,pos:1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26
1 change: 1 addition & 0 deletions out/fuzz_bitmap

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions out/fuzzer_stats
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
start_time : 1585319575
last_update : 1585319663
fuzzer_pid : 6641
cycles_done : 205
execs_done : 107406
execs_per_sec : 1267.63
paths_total : 2
paths_favored : 1
paths_found : 1
paths_imported : 0
max_depth : 2
cur_path : 1
pending_favs : 0
pending_total : 0
variable_paths : 0
stability : 100.00%
bitmap_cvg : 0.06%
unique_crashes : 3
unique_hangs : 0
last_path : 1585319575
last_crash : 1585319575
last_hang : 0
execs_since_crash : 107348
exec_timeout : 9000
afl_banner : python
afl_version : 2.52b
target_mode : default
command_line : afl-fuzz -m 500 -t 9000 -i in -o out python fuzz_djikstra.py
19 changes: 19 additions & 0 deletions out/plot_data
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# unix_time, cycles_done, cur_path, paths_total, pending_total, pending_favs, map_size, unique_crashes, unique_hangs, max_depth, execs_per_sec
1585319575, 0, 0, 1, 1, 1, 0.06%, 0, 0, 1, 148.15
1585319580, 7, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1138.18
1585319585, 19, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1203.06
1585319590, 31, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1220.96
1585319595, 43, 0, 2, 0, 0, 0.06%, 3, 0, 2, 1213.48
1585319600, 55, 0, 2, 0, 0, 0.06%, 3, 0, 2, 1186.81
1585319605, 67, 0, 2, 0, 0, 0.06%, 3, 0, 2, 1184.44
1585319610, 79, 0, 2, 0, 0, 0.06%, 3, 0, 2, 1224.85
1585319615, 91, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1248.15
1585319620, 103, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1230.04
1585319625, 116, 0, 2, 0, 0, 0.06%, 3, 0, 2, 1243.49
1585319630, 128, 0, 2, 0, 0, 0.06%, 3, 0, 2, 1252.55
1585319635, 140, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1252.24
1585319640, 152, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1243.94
1585319645, 164, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1231.45
1585319651, 177, 0, 2, 0, 0, 0.06%, 3, 0, 2, 1229.93
1585319656, 189, 0, 2, 0, 0, 0.06%, 3, 0, 2, 1217.26
1585319661, 201, 1, 2, 0, 0, 0.06%, 3, 0, 2, 1228.44
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions out/queue/id:000000,orig:test1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
1 change: 1 addition & 0 deletions out/queue/id:000001,src:000000,op:flip1,pos:0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6

0 comments on commit 903a91e

Please sign in to comment.