Open op2786 opened 10 months ago
@op2786 do you have a binary to reproduce this?
I think the problem here is that the enumeration we have defined is not an un-ambiguous bit field enumeration
For instance:
PAGE_ENCLAVE_SS_FIRST
== PAGE_ENCLAVE_DECOMMIT | PAGE_NOACCESS
and
PAGE_ENCLAVE_MASK == PAGE_ENCLAVE_DECOMMIT
Currently we don't have any way to disambiguate enumeration masks. Or provide multiple different ways to view an enumeration's component parts. I bet if you remove SEC_IMAGE_NO_EXECUTE
and PAGE_ENCLAVE_*
then it would work as you expect.
So I see one of 3 possibilities here:
Hmm I guess there is one other way of doing this 🤔 ... perhaps we don't need to guarantee the whole enumeration is a bitfield but instead we can just ensure that they constants in use are unambiguous.... this could actually be pretty easy to do.
v35 folks should search springbuck suffusive rustles neoplastic benzine
to find the binary
I'm not sure if this is a bug or missing feature. In the example below
0xf0
actually meansPAGE_EXECUTE_WRITECOPY|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_READ|PAGE_EXECUTE
but I cannot set that value to enumeration. It would be very useful if BN can do that when I try to set enumeration withM
shortcut.Actually I found other examples where BN automatically did that. For example:
SetErrorMode
have a type like this:uint32_t SetErrorMode(enum THREAD_ERROR_MODE uMode)
. So I assume BN do this automatically if enumeration type is set. I tried to change the type ofProtect
fromDWORD
toPAGE_PROTECTION_FLAGS
but it didn't work. Also I don't think that this should be the solution for this issue, instead, BN should be able to do it even if there is no enumeration type is set.