Total Internal Reflection

Technology and Art



Code

Cobol REKT
Tape/Z
Plenoxels
Transformer
Basis-Processing
Cataract
COMRADE
Duck-Angular
Exo
IRIS
MuchHeap
Snail-MapReduce
Underline
Lambda-Queuer
jQuery-Jenkins Radiator

Contact

Github
Twitter
LinkedIn

Site Feed

Techniques of Reverse Engineering: Eliminating GOTOs

Avishek Sen Gupta on 22 June 2025

Abstract

In this post, we talk of how to eliminate unconditional arbitrary jumps (aka GOTOs) by manipulating the Abstract Syntax Tree of a program, in a way that preserves the semantic flow of the program, while making it amenable to structured programming representations (i.e., using control flow constructs like while, do...while). The aim is to transform the program into a form which can make it easier to represent in modern programming languages which use only structured programming constructs.

This post has not been written or edited by AI.

The basic principle

Case 1: Forward Jumps

Case 2: Backward Jumps

References


tags: Reverse Engineering - GOTO