I don't see parameters being used within the code.

Open
#77 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp

Research direction

No repository file, test, or input binary is identified. Start by reproducing the output for the function sub_7FF673237C10 with IDA Pro 7.7 and RetDec 1.0-ida77, then determine whether the missing parameter use is a decompiler defect; done means documenting a confirmed cause and a focused reproduction or test.

Written by the indexing model from the issue text.

Description

#include <stdint.h>

// ------------------- Function Prototypes --------------------

void sub_7FF673237C10(int64_t a1, int32_t a2);

// ------------------------ Functions -------------------------

// Address range: 0x7ff673237c10 - 0x7ff673237c8f
void sub_7FF673237C10(int64_t a1, int32_t a2) {
// 0x7ff673237c10
int64_t v1; // 0x7ff673237c10
int64_t v2 = *(int64_t *)(v1 + 16); // 0x7ff673237c10
int64_t v3 = *(int64_t )(v2 + 8); // 0x7ff673237c17
int64_t v4 = v2; // 0x7ff673237c1f
if (
(char *)(v3 + 25) == 0) {
uint32_t v5 = (int32_t)v1; // 0x7ff673237c21
int64_t v6 = v2;
int64_t v7 = v3;
uint32_t v8 = *(int32_t *)(v7 + 32); // 0x7ff673237c21
v6 = v8 >= v5 ? v7 : v6;
int64_t v9 = *(int64_t )(v8 >= v5 ? v7 : v7 + 16);
v4 = v6;
while (
(char *)(v9 + 25) == 0) {
// 0x7ff673237c21
v7 = v9;
v8 = *(int32_t *)(v7 + 32);
v6 = v8 >= v5 ? v7 : v6;
v9 = *(int64_t )(v8 >= v5 ? v7 : v7 + 16);
v4 = v6;
}
}
int64_t v10 = v4;
if (
(char *)(v10 + 25) == 0) {
// 0x7ff673237c3f
if (!((v10 == v2 | *(int32_t *)(v10 + 32) > (int32_t)v1))) {
// 0x7ff673237c4a
return;
}
}
int64_t v11 = *(int64_t )((int64_t )(v1 + 32) + 8); // 0x7ff673237c56
if (
(char *)(v11 + 25) != 0) {
// 0x7ff673237c4a
return;
}
int64_t v12 = v11;
uint32_t v13 = *(int32_t *)(v12 + 32); // 0x7ff673237c60
int64_t v14 = *(int64_t )(v13 >= (int32_t)v1 ? v12 : v12 + 16);
while (
(char *)(v14 + 25) == 0) {
// 0x7ff673237c60
v12 = v14;
v13 = *(int32_t *)(v12 + 32);
v14 = *(int64_t *)(v13 >= (int32_t)v1 ? v12 : v12 + 16);
}
}

Could the decompiler be producing very incomplete and erroneous output? For instance, why is parameter usage not specified in the code above?

IDA PRO 7.7
Retdec 1.0-ida77
Windows 10

Dominant language
C++
Stars
799
Forks
132
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from avast/retdec-idaplugin

All issues in avast/retdec-idaplugin

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.