Update on Overleaf.

This commit is contained in:
nb72soza Bittner
2025-05-27 23:23:07 +00:00
committed by node
parent 463c45f08d
commit ca61978462
3 changed files with 151 additions and 63 deletions

View File

@@ -307,88 +307,99 @@ The \gls{smdpp} client is primarily used by the \gls{isdr} application to execut
% use python pickle to store the whole mutation tree as a ".resim" file
% afterwards: clear the recorder, reset the link, reset card -> continue with next scenario
\begin{tikzpicture}[
level distance=3cm,
sibling distance=5cm,
edge from parent/.style={->, thick, draw},
mutation node/.style={rectangle, draw, rounded corners, minimum width=3.5cm, minimum height=1cm, align=center, fill=blue!10},
success node/.style={rectangle, draw, rounded corners, minimum width=3.5cm, minimum height=1cm, align=center, fill=green!20, text=black},
failure node/.style={rectangle, draw, rounded corners, minimum width=3.5cm, minimum height=1cm, align=center, fill=red!20, text=black},
node distance=1cm and 1.1cm,
every node/.style={align=center},
decision/.style={diamond, aspect=2, text centered, draw=black, fill=orange!20},
block/.style={rectangle, thick, minimum width=2.5cm, minimum height=1.2cm, draw=black, fill=gray!10},
startstop/.style={rectangle, rounded corners, minimum width=2.5cm, minimum height=1cm, text centered, draw=black, fill=blue!10},
line/.style={draw, thick, -{Latex[length=3mm]}},
]
% Root node
\node[mutation node] (root) {Root Node \\ func\_name: "root" \\ mutation: NONE}
child { node[success node] (child1) {Mutation Node\\ func\_name: "get\_euicc\_info\_1" \\ mutation: BIT\_FLIP \\ Status: Success }
child { node[success node] {Mutation Node\\
func\_name: "list\_profiles" \\ mutation: NONE \\ Status: Success }}
child { node[failure node] {Mutation Node\\
func\_name: "list\_profiles" \\ mutation: RANDOM\_BYTE \\ Status: Failure} }
child { node[failure node] {Mutation Node\\
func\_name: "list\_profiles" \\ mutation: BIT\_FLIP \\ Status: Failure} }
}
child { node[failure node] (child2) {Mutation Node\\ func\_name: "get\_euicc\_info\_1" \\ mutation: RANDOM\_BYTE \\ Status: Failure }
}
child { node[failure node] (child3) {Mutation Node\\ func\_name: "get\_euicc\_info\_1" \\ mutation: NONE \\ Status: Failure}
};
\node[startstop] (A) {Start};
\node[decision, below=of A] (B) {Current Node has\\ not tried mutations?};
\node[block, right=of B] (C) {Create new Node as\\ child and make it current};
\node[startstop, above=of C] (n1) {Return a not\\ tried mutation type};
\node[block, below=of B] (D) {Iterate over children};
\node[decision, below=of D] (n2) {Child function\\ execution failed?};
\node[decision, right=of n2] (n3) {Child has not\\ tried mutations?};
\node[startstop, above=of n3] (n4) {Make child current and\\ return its mutation type};
\node[decision, below=of n3] (n5) {Is mutation type\\ of child None?};
\node[block, left=of n5] (n6) {Set NoneNode to child};
\path[line] (A) -- (B);
\path[line] (B) -- node[above] {Yes} (C);
\path[line] (C) -- (n1);
\path[line] (B) -- node[left] {No} (D);
\path[line] (D) -- (n2);
\path[line] (n2) -- node[left] {Yes} (D);
\path[line] (n2) -- node[above] {No} (n3);
\path[line] (n3) -- node[right] {Yes} (n4);
\path[line] (n3) -- (n5);
\path[line] (n5) -- node[above] {Yes} (n6);
\end{tikzpicture}
\begin{tikzpicture}[
node distance=0.8cm and 1.1cm,
box/.style={draw, rounded corners, minimum width=3cm, minimum height=1cm, align=center},
arrow/.style={-{Stealth}, thick},
decision/.style={diamond, draw, aspect=2, align=center},
io/.style={trapezium, trapezium left angle=70, trapezium right angle=110, draw, minimum width=2.5cm, align=center}
]
node distance=1cm and 1.1cm,
startstop/.style={rectangle, rounded corners, minimum width=2.5cm, minimum height=1cm, text centered, draw=black, fill=blue!10},
process/.style={align=center, rectangle, minimum width=2.5cm, minimum height=1cm, text centered, draw=black, fill=gray!10},
decision/.style={align=center, diamond, aspect=2, text centered, draw=black, fill=orange!20},
arrow/.style={thick,->,>=Stealth}
]
% Nodes
\node[box] (start) {record\_card():\\ Init PcscLink, Card, Recorder};
\node[box, below=of start] (scenarioLoop) {For each Scenario\\ Instantiate and Run Scenario.run(card)};
\node[box, below=of scenarioLoop] (isdrcall) {Card ISD-R command};
\node (start) [startstop] {Start};
\node (check1) [decision, below=of start] {Current node has\\ not tried mutations?};
\node (addnode) [process, right=1.2cm of check1] {create a new node as child of current Node\\ and make it the current node};
\node (return1) [startstop, above=of addnode] {return a not tried mutation type};
% Mutation engine path
\node[decision, below=of isdrcall] (mutateQ) {Mutation Engine?};
\node (loopstart) [process, below=of check1] {Iterate over children};
\node (failcheck) [decision, below=of loopstart] {child function\\ execution failed?};
\node (mutcheck) [decision, right=1.2cm of failcheck] {child has\\ not tried mutations?};
\node (setcurrent) [process, above=of mutcheck] {set the child as current node};
\node (return2) [startstop, above=0.5cm of setcurrent] {return mutation type of child};
\node[box, right=1.2cm of mutateQ] (originalAPDU) {Send original APDU};
\node[box, left=1.2cm of mutateQ] (mutateAPDU) {Mutate APDU};
\node (nonecheck) [decision, below=of failcheck] {mutation\_type is NONE?};
\node (savechild) [process, right=1.2cm of nonecheck] {save as none\_mutation\_node};
\node[box, below=of mutateQ] (sendAPDU) {Transmit APDU to card};
\node[box, below=of sendAPDU] (record) {Record mutation result\\ in OperationRecorder};
% Error / reset path
\node[decision, below=of record] (errorQ) {Exception during scenario?};
\node[box, left=of errorQ] (logFail) {Log failure\\ in current mutation node};
\node[box, below=of errorQ] (checkTree) {All mutations tried?};
\node[box, right=of checkTree] (repeatScenario) {Repeat Scenario};
\node[box, below=of checkTree] (saveFile) {Save .resim file};
\node[box, below=of saveFile] (clearReset) {Clear recorder,\\ Reset card};
\node (assert) [process, below=of nonecheck] {assert none\_mutation\_node is not None};
\node (return3) [startstop, below=of assert] {return none\_mutation\_node};
% Arrows
\draw[arrow] (start) -- (scenarioLoop);
\draw[arrow] (scenarioLoop) -- (isdrcall);
\draw[arrow] (isdrcall) -- (mutateQ);
\draw [arrow] (start) -- (check1);
\draw [arrow] (check1.east) -- node[above] {Yes} (addnode.west);
\draw [arrow] (addnode) -- (return1);
\draw[arrow] (mutateQ) -- node[above] {No} (originalAPDU);
\draw[arrow] (mutateQ) -- node[above] {Yes} (mutateAPDU);
\draw [arrow] (check1.south) -- node[left] {No} (loopstart);
\draw [arrow] (loopstart) -- (failcheck);
\draw [arrow] (failcheck.east) -- node[above] {No} (mutcheck.west);
\draw [arrow] (mutcheck) -- node[right] {Yes} (setcurrent);
\draw [arrow] (setcurrent) -- (return2);
\draw[arrow] (mutateAPDU) |- (sendAPDU);
\draw[arrow] (originalAPDU) |- (sendAPDU);
\draw[arrow] (sendAPDU) -- (record);
\draw[arrow] (record) -- (errorQ);
\draw[arrow] (errorQ) -- node[above] {Yes} (logFail);
\draw[arrow] (logFail) |- (checkTree);
\draw[arrow] (errorQ) -- node[above] {No} (checkTree);
\draw[arrow] (checkTree) -- node[above] {No} (repeatScenario);
\draw[arrow] (checkTree) -- node[right] {Yes} (saveFile);
\draw[arrow] (saveFile) -- (clearReset);
\draw [arrow] (mutcheck.south) -- node[right] {No} ++(0,-1) -| (nonecheck.east);
\draw [arrow] (failcheck.south) -- node[left] {Yes} (loopstart);
\draw [arrow] (nonecheck.east) -- node[above] {Yes} (savechild);
\draw [arrow] (nonecheck.south) -- (assert);
\draw [arrow] (assert) -- (return3);
\end{tikzpicture}
\begin{figure}
\centering
\input{Graphics/mutation_tree.tikz}
\caption{Tree structure for recording.}
\label{fig:tree_structure}
\end{figure}
\begin{figure}
\centering
\input{Graphics/record_scenario_flow.tikz}
\caption{Flow for recording a scenario}
\label{fig:scenario_flow}
\end{figure}
\begin{figure}
\centering
\input{Graphics/scenario_runner.tikz}