Import scanners read resolved addresses as names when the import name table is missing
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 62/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- cpp
- Domínio
- desktop-dev, reverse-engineering
Direção de pesquisa
Start with the import walk in clean/rr_f/proxy/src/hook_dll.cpp around lines 849-861, where names come from OriginalFirstThunk with a FirstThunk fallback, then check the same pattern in clean/rr_f/proxy/src/setupapi_identity.cpp near line 390. The proposed fix is to skip a descriptor whose OriginalFirstThunk is zero and log once. Done means a synthetic PE64 test with a zero OriginalFirstThunk asserts nothing is patched and nothing faults, and the scanner must first be exported or compiled into the test.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
This was found by reading the code. It has not been reproduced.
What happens
The import scanner in clean/rr_f/proxy/src/hook_dll.cpp:853-861 reads names from OriginalFirstThunk, and falls back to FirstThunk when it is zero. It then dereferences base + names->u1.AddressOfData as an IMAGE_IMPORT_BY_NAME. At run time FirstThunk holds resolved absolute addresses. The ordinal check passes (the top bit is clear for user-mode addresses). The result is base + address, which is unmapped, so the read faults.
The scanner runs on every loaded module (hook_dll.cpp:1105-1115). Only descriptors whose DLL name equals the interface file name reach the walk (hook_dll.cpp:849). There is no __try around do_hook.
The same fallback and interpretation is in clean/rr_f/proxy/src/setupapi_identity.cpp:390. That scanner only runs for Spider-Man2.exe.
When it can happen
Only for a module that imports the game interface (or, for the SetupAPI scanner, a Spider-Man2.exe that imports SetupAPI) and was linked or packed without an import name table. Current MSVC and LLVM x64 linkers always emit one. This is old-Borland or packer territory. No known RR game qualifies. Low severity: a crash at load if it ever occurs.
To do
- In both scanners:
if (!OriginalFirstThunk) { log once; continue; }. - Optionally bounds-check each name RVA against
SizeOfImage. - Caution: none in practice. A module without an import name table is simply not patched, and that is logged.
Test
CPU-only. Build a synthetic in-memory PE64 image: DOS and NT headers, one import descriptor naming the interface, OriginalFirstThunk = 0, FirstThunk filled with a real function address. Call the scanner (it needs to be exported to the test or compiled into it). Assert nothing is patched and nothing crashes.
- Linguagem predominante
- C++
- Estrelas
- 12
- Forks
- 2
- Merge médio
- 3h 10min
- PRs com merge (30d)
- 171
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de phantoslayer21/wronggpu
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
phantoslayer21/wronggpu#275 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
phantoslayer21/wronggpu#274 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
phantoslayer21/wronggpu#241 ·
Mantenedores costumam responder em até 1 dia
-
bug build
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
phantoslayer21/wronggpu#234 ·
Mantenedores costumam responder em até 1 dia
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildAbertabug build
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
phantoslayer21/wronggpu#233 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de phantoslayer21/wronggpu
Issues semelhantes
-
ai_p2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
ClickHouse/ClickHouse#132519 ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
juce-framework/JUCE#1810 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
petercorke/robotics-toolbox-python#952 ·
Mantenedores costumam responder em até 1 dia
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit statusAbertafunc:engine type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NatronGitHub/Natron#1276 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia