avast / avast/retdec

Symbol size information is not used

Open
#154 0 comments 0 reactions 0 assignees View on GitHub
C-bin2llvmir enhancement P-output
Dominant language
C++
Stars
8.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Symbols can have size set (mostly in ELF). We are not always using this information. E.g. in the following case:
```c
#include

volatile int foo[100];

int main() {
for (int i = 0; i < 100; ++i) {
printf("%dn", foo[i]);
}
return 0;
}
```
compiled into [test.zip](https://github.com/avast-tl/retdec/files/1699433/test.zip), there is this record in the symbol table:
```
65 foo DATA OBJECT GLOBAL Default visibility 24 134518752 400
```
We could use it to infer global object's type - the size of an array.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the example from test.zip and inspect how ELF symbol-table information is handled for the global object foo. Trace where its reported size is currently discarded, then verify that the size can inform the inferred array type and that the example decompiles with the expected type.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, reverse-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.