chausner / PriTools

Tools for parsing and exploring PRI (Package Resource Index) files
Apache License 2.0
31 stars 7 forks source link

UnknownProperty0x87CB #1

Closed CuteLasty closed 4 years ago

CuteLasty commented 4 years ago

I saw an unknown property. How can I solve it?

chausner commented 4 years ago

This is an issue of XBF decompilation which should be reported and fixed in the original repository: https://github.com/misenhower/XbfAnalyzer. That library was last updated for the Anniversary Update in 2016. It does not know about any new framework types or properties that have been introduced since then. I'll check if we can easily update the type information.

CuteLasty commented 4 years ago

After some reverse engineering, it's looks like GenXBF.dll decode type at const struct MetaDataType const __stdcall DirectUI::MetadataAPI::GetBuiltinClassInfoByName() function..

But how to decode enumValues ?

chausner commented 4 years ago

I can post the code which I used to extract the data. It should be all contained in these static tables:

c_aKnownTypeToStableXbfType: WORD[], mapping from c_aTypeNameInfos index to stable xbf type
c_aKnownPropertyToStableXbfProperty: WORD[], mapping from c_aPropertyNames index to stable xbf property

c_aTypeNames: WORD[], entries are indices into c_aTypeNameInfos and c_aTypes

c_aTypeNameInfos: (20 bytes)[]
    wchar* name
    DWORD  nameLength
    wchar* fullName
    DWORD  fullNameLength
    DWORD  namespace index

c_aTypes: (8 bytes)[]

c_aProperties: (16 bytes)[]

c_aPropertyNames: (8 bytes)[]
    wchar* name
    DWORD  nameLength
CuteLasty commented 4 years ago

I'm planning use DbgHelp DLL to query symbol address, then extract data to table.

EnumValue can call GetEnumValueTable() in GenXBF.dll to get.

int GetEnumValueTable(__int16 EnumValue, _DWORD pCount, const struct XTABLE const **ppTable)

chausner commented 4 years ago

Yes, I obtained the addresses manually from a debugger but you can probably automate it with dbghelp.dll.

I created a MR at the original repository which updates the type information for the latest Windows SDK. I'll post my code for extracting it tomorrow.

chausner commented 4 years ago

Here is the code I used to extract and generate the tables: https://github.com/chausner/XbfGenExtractor

CuteLasty commented 4 years ago

Thanks for help!