Optimization for directly using global variables
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- reverse-engineering
Research direction
Start by locating the decompiler logic responsible for simplifying global-variable accesses and compare the three examples in this issue with cases that are already simplified. Determine which existing decision prevents removing the temporary locals, then verify that the transformation preserves behavior and handles all relevant cases.
Written by the indexing model from the issue text.
Description
140002b7d HANDLE rax_1
140002b7d rax_1 = CreateThread(nullptr, nullptr, MainThread, nullptr, THREAD_CREATE_RUN_IMMEDIATELY, nullptr)
140002b83 main_thread_handle = rax_1
could be simplified like this:
main_thread_handle = CreateThread(nullptr, nullptr, MainThread, nullptr, THREAD_CREATE_RUN_IMMEDIATELY, nullptr)
Another example:
140002a54 int64_t* rcx_6 = svc_status_handle
140002a62 ServiceStatus.dwCurrentState = SERVICE_STOPPED
140002a6c SetServiceStatus(rcx_6, &ServiceStatus)
which could be simplified like this:
140002a62 ServiceStatus.dwCurrentState = SERVICE_STOPPED
140002a6c SetServiceStatus(svc_status_handle, &ServiceStatus)
Another one:
140002aa0 HANDLE rcx_3 = main_thread_handle
140002aaa data_140033c5c = 1
140002ab1 WaitForSingleObject(rcx_3, 0xffffffff)
which cold be simplified to:
140002aaa data_140033c5c = 1
140002ab1 WaitForSingleObject(main_thread_handle, 0xffffffff)
Actually there is cases which codes like above already simplified, but because of some interesting decision these ones does not simplified.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Vector35/binaryninja-api
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Vector35/binaryninja-api#8540 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Vector35/binaryninja-api#8516 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Vector35/binaryninja-api#8503 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Vector35/binaryninja-api#8446 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Vector35/binaryninja-api#8444 ·
All issues in Vector35/binaryninja-api
Similar issues
-
Website Doc Typo Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
automated-analysis bug memory-safety
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100