Patent ID: 7685584

Claim:
A method for the analysis of putative switch tables in position-independent binary code in a computer system comprising: determining a current function and an initial value for a switch table wherein target addresses are computed based on the initial value for the switch table; evaluating each of the target addresses to determine if the target addresses are possible entries in the switch table; defining a block of data as a potential switch table by computing one or more switch targets; computing said one or more switch targets by, determining a reference address of the potential switch table; determining the size of an entry in the potential switch table; and determining a target address by adding the value of the entry to the reference address, wherein said reference address and said target address define a selected block of data; evaluating the selected block of data as the potential switch table by analyzing instructions at said one or more switch targets as well as adjacent instructions; determining a best value and a best split for the selected block of data; and determining a best list of switch tables from the selected block of data.