avast / avast/retdec

Add an option to specify radix for numeric constants

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

Description

Hi, is it possible to implement an option to specify numeral systems Decimal or Hex because now it's inconsistent I mean decimal numbers are mixed with hex in the code ...

```
// Address range: 0x8048e90 - 0x8048ef0
int32_t function_8048e90(int32_t result, int32_t a2) {
int32_t v1 = 0; // edi
g1 = function_8048740(g3);
int32_t v2 = g3; // 0x8048e9b
g3 = v2 + 0x2165;
g2 = result;
function_8048568();
__pseudo_call(*(int32_t *)(g3 - 248 + 4 * v1));
int32_t v3 = v1 + 1; // 0x8048ee2
// branch -> 0x8048ec8
while (v3 != (v2 + 0x2071 - (g3 - 248)) / 4) { //in the mix
// 0x8048ec8
// 0x8048ec8
__pseudo_call(*(int32_t *)(g3 - 248 + 4 * v3));
v3++;
// branch -> 0x8048ec8
}
// 0x8048ee9
return result;
}
```
Also I personally prefer hex much more since it's easier to notice different stuff and constants used.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue does not name files, tests, or an entry point. Start by locating the component that renders numeric constants in RetDec's decompiler output and checking how output options are represented; done means users can select decimal or hexadecimal formatting consistently.

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.