## A Structuring Algorithm for Decompilation (1993)

Venue: | In XIX Conferencia Latinoamericana de Inform'atica |

Citations: | 8 - 2 self |

### BibTeX

@INPROCEEDINGS{Cifuentes93astructuring,

author = {Cristina Cifuentes},

title = {A Structuring Algorithm for Decompilation},

booktitle = {In XIX Conferencia Latinoamericana de Inform'atica},

year = {1993},

pages = {267--276}

}

### Years of Citing Articles

### OpenURL

### Abstract

This paper presents a structuring algorithm for arbitrary reducible, unstructured graphs. Graphs are structured into semantically equivalent graphs, without the need of code replication or introduction of new variables. The algorithm makes use of structures such as, if..then..elses, while, repeat and loop loops, and case statements. Gotos are only used when the graph cannot be structured with any of the above constructs. This algorithm is adequate for the analysis needed in the decompilation of programs, given that a binary program does not contain information as to the language and compiler used to compile the original source program. And given that unstructuredness is introduced by the use of gotos (still widely available in today's compilers) and optimizations produced by the compiler, we have to assume an unstructured graph for our decompilation analysis. This algorithm has been implemented as part of the dcc decompiler, currently under development at the Queensland University of ...

### Citations

1126 | Depth search and linear graph algorithms
- Tarjan
- 1972
(Show Context)
Citation Context ...graph. Figure 2 describes such an algorithm. Depth first search, DFS, is a traversal method that selects edges to traverse emanating from the most recently visited node which still has unvisited edges=-=[13]-=-. A depth first spanning tree (DFST) of a flow graph G 1 = G. I 1 = intervals(G 1 ). i = 2. Repeat /* Construction of G i */ Make each interval of G i\Gamma1 a node in G i . immedPreds(n) n 2 G i = im... |

99 |
Control flow analysis
- Allen
- 1970
(Show Context)
Citation Context ...presented v 1 ! v n , is a sequence of edges (v 1 ; v 2 ); (v 2 ; v 3 ); : : : ; (v n\Gamma1 ; vn ). An interval is a graph theoretic construct first defined by J.Cocke[10], and widely used by F.Allen=-=[11, 12]-=-. An interval I(h) is the maximal, single-entry subgraph in which h is the only entry node and in which I := fg. H := fhg. for (all unprocessed n 2 H) do I(n) := fng. repeat I(n) := I(n) + fm 2 G : 8p... |

83 |
Testing flow graph reducibility
- TARJAN
- 1974
(Show Context)
Citation Context ... == False) add (x; s) to DFST DFS(s) fi endFor x.revPostorder = i i = i \Gamma 1 end procedure Figure 3: Depth first search G is a directed, rooted, ordered spanning tree of G grown by a DFS algorithm=-=[14, 15, 2]-=-. A DFST T can partition the edges in G into three sets: 1. Back edges = f(v; w) : w ! v 2 Tg. 2. Forward edges = f(v; w) : v ! w 2 Tg. 3. Cross edges = f(v; w) : 6 9 (v ! w or w ! v) and wsv in preor... |

67 |
Global common subexpression elimination
- Cocke
- 1970
(Show Context)
Citation Context ... V . A path from v 1 to v n , represented v 1 ! v n , is a sequence of edges (v 1 ; v 2 ); (v 2 ; v 3 ); : : : ; (v n\Gamma1 ; vn ). An interval is a graph theoretic construct first defined by J.Cocke=-=[10]-=-, and widely used by F.Allen[11, 12]. An interval I(h) is the maximal, single-entry subgraph in which h is the only entry node and in which I := fg. H := fhg. for (all unprocessed n 2 H) do I(n) := fn... |

49 |
An Algorithm for Structuring Flowgraphs
- Baker
- 1977
(Show Context)
Citation Context ...rol structures available in the language leads to very unstructured programs. A structuring algorithm that structured Fortran programs into Ratfor (a structured version of Fortran) was develop in 1977=-=[6]-=-. This algorithm made use of if..then..elses, loops, multilevel exit and continue, and gotos. It proved to be very useful, as the structured version of a program was easier to understand. In the case ... |

36 |
Eliminating goto’s while preserving program structure
- Ramshaw
- 1988
(Show Context)
Citation Context ...l not only within the procedure, but also from one procedure to another. Different methods have been proposed; most of them introduce new local and global variables[3], or make use of multilevel exits=-=[7]-=-. Only one method was directly related to decompilation, and it explained only how to structure loops by means of intervals; other constructs were not mentioned[8]. Since this decompiler took as input... |

29 |
Linear Optimization
- Spivey, Thrall
- 1970
(Show Context)
Citation Context ...presented v 1 ! v n , is a sequence of edges (v 1 ; v 2 ); (v 2 ; v 3 ); : : : ; (v n\Gamma1 ; vn ). An interval is a graph theoretic construct first defined by J.Cocke[10], and widely used by F.Allen=-=[11, 12]-=-. An interval I(h) is the maximal, single-entry subgraph in which h is the only entry node and in which I := fg. H := fhg. for (all unprocessed n 2 H) do I(n) := fng. repeat I(n) := I(n) + fm 2 G : 8p... |

24 |
Structural analysis: A new approach to flow analysis in optimizing compilers
- Sharir
- 1980
(Show Context)
Citation Context ...thms make use of node splitting techniques (i.e. code replication) and introduce new Boolean variables[3, 4], or choose a set of high level language constructs not available in commonly used languages=-=[5]-=-. In Fortran, the lack of control structures available in the language leads to very unstructured programs. A structuring algorithm that structured Fortran programs into Ratfor (a structured version o... |

14 |
Analysis of structured programs
- Kosaraju
- 1973
(Show Context)
Citation Context ...done by the compiler. Even more, the optimizer might even produce irreducible graphs. It is not hard to demonstrate that structured high level languages which do not make use of the goto are reducible=-=[1, 2]-=-. A structuring algorithm is concerned with arbitrary graphs, that is, graphs produced by a structured or unstructured high level language, and that in most cases have been optimized and therefore tra... |

8 |
A Study of Decompiling Machine Languages into High-Level Machine Independent Languages
- Housel
- 1973
(Show Context)
Citation Context ...s[3], or make use of multilevel exits[7]. Only one method was directly related to decompilation, and it explained only how to structure loops by means of intervals; other constructs were not mentioned=-=[8]-=-. Since this decompiler took as input only programs compiled in the Mixal language, it did not have to consider complex control structures such as case statements, multiexit, or multientry loops. The ... |

2 |
Analysis of Computer Programs. 52 Vanderbilt Avenue
- Hecht
- 1977
(Show Context)
Citation Context ...done by the compiler. Even more, the optimizer might even produce irreducible graphs. It is not hard to demonstrate that structured high level languages which do not make use of the goto are reducible=-=[1, 2]-=-. A structuring algorithm is concerned with arbitrary graphs, that is, graphs produced by a structured or unstructured high level language, and that in most cases have been optimized and therefore tra... |

2 |
J.Cocke, "Graph theoretic constructs for program control flow analysis
- Allen
- 1972
(Show Context)
Citation Context ...ly with reducible flow graphs, given that any irreducible graph can be transformed into an equivalent reducible graph by means of node splitting. Different methods have been proposed in the literature=-=[9, 2]-=-. For decompilation, once the graph has been structured, an extra pass can be done to structure even further. This restructuring stage deals with specific control structures available in the target la... |

2 |
J.Ullman, "A simple algorithm for global data flow analysis problems
- Hecht
- 1975
(Show Context)
Citation Context ... == False) add (x; s) to DFST DFS(s) fi endFor x.revPostorder = i i = i \Gamma 1 end procedure Figure 3: Depth first search G is a directed, rooted, ordered spanning tree of G grown by a DFS algorithm=-=[14, 15, 2]-=-. A DFST T can partition the edges in G into three sets: 1. Back edges = f(v; w) : w ! v 2 Tg. 2. Forward edges = f(v; w) : v ! w 2 Tg. 3. Cross edges = f(v; w) : 6 9 (v ! w or w ! v) and wsv in preor... |

1 |
G.Chen, "Restructuring pascal programs containing goto statements
- Williams
- 1985
(Show Context)
Citation Context ...d to structure flowgraphs produced by unstructured languages such as Fortran. Most of these algorithms make use of node splitting techniques (i.e. code replication) and introduce new Boolean variables=-=[3, 4]-=-, or choose a set of high level language constructs not available in commonly used languages[5]. In Fortran, the lack of control structures available in the language leads to very unstructured program... |