Repository navigation
Conversation
… the vtable load calleereginputs' virtual-call rule now accepts an ECX write between the vtable load and the call when it copies the object back (mov eax,[ebx]; push 6; mov ecx,ebx; call eax), and judges a caller cleanup only up to the next call: past a later call the calleeargs scan reads frame teardown, or a later callee's pops of earlier pushes, as cleanup of the virtual call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A store through FS (mov fs:[0],ecx) unlinks an MSVC SEH frame; the pop ecx after it frees the frame's own slot and is no cleanup of an earlier call. An MSVC virtual call right before such an epilogue kept the default model and lost its receiver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On x86-32 Windows, an MSVC virtual call still prints without
thiswhen ECX is set after the vtable load, or when a later call follows it before the epilogue:With this change:
Fix
mov eax,[ebx]; mov eax,[eax+0x24]; push 6; mov ecx,ebx; call eax. An ECX write between the vtable load and the call is now accepted when it copies the object back. One that loads another object still keeps the default.calleeargs) now ends at a store through FS.mov fs:[0],ecxunlinks an MSVC SEH frame, and thepop ecxafter it frees the frame's own slot. It is not a cleanup of the call before it.__cdecltable call (the caller cleans up after it) now counts only a cleanup made before the next call. Thecalleeargsscan it used takes the virtual call to pop only its return address. Past a later call, that scan read frame teardown (pop ecxbeforepop edi) as a cleanup of the virtual call. It also read a later callee popping pushes made before the virtual call (o->child()->take(1, 2)) as one.Apart from the FS stop, the
calleeargsscan is unchanged. Thedocs/spec/04section on virtual calls drops the "not recognized" note for this shape.Tests
vcall_pe_i386.exegains five functions after the existing ones, so no address moves.tests/stages/kuna-calleereginputs.xmlgains assertionsCALLEEREGINPUTS #31–#39:latecopysets ECX after the vtable load;lateotherloads another object into ECX and gets no receiver;vepiloghas a later call and apop ecxepilogue;vouteriso->child()->take(1, 2);vsehis a call right before an SEH epilogue.On
main,CALLEEREGINPUTS #32,#35,#37and#39fail.python -m scripts.prepr.aritydiffagainstmain:mov edx,[edi]; push ...; mov ecx,edi; call [edx+k]./GScookie slot after a call such aspush esi; call f; add esp,4;decompile-alltime is unchanged.Not fixed: in
o->child()->take(1, 2),take's pushes are still offered tochild().Fixes #1590
🤖 Generated with Claude Code