DllExport icon indicating copy to clipboard operation
DllExport copied to clipboard

Allow exporting of variables / constants

Open OmegaExtern opened this issue 8 years ago • 3 comments

Read this comment.


Depends on:

  • [ ] https://github.com/3F/coreclr/issues/4 - Improve ILAsm grammar for export variables into Export Directory (IMAGE_OPTIONAL_HEADER - NT PE32/PE32+)

OmegaExtern avatar Dec 19 '16 00:12 OmegaExtern

But first we need to improve ILAsm grammar + writer and probably mscorpe I will look this later with similar task from #23

Today only this:

for(WORD j = 0; (pMD = pClass->m_MethodList.PEEK(j)); j++)
{
...
    EATEntry* pEATE;
    /*
        struct	EATEntry
        {
            DWORD	dwStubRVA;
            DWORD	dwOrdinal;
            char*	szAlias;
        };    
    */
    ...
    m_EATList.PUSH(pEATE);

another interesting, I forgot to implement support of this variables (constants) for Conari engine, hmm...

3F avatar Dec 19 '16 15:12 3F

to be clear for '.field' directives:

.field public static literal int32 'MyField' at '@00007400' // RVA: 0x00001CE8

will create field that have RVA associated with it, but that's another story with IMAGE_COR20_HEADER

3F avatar Dec 19 '16 15:12 3F

This would be super useful. For example NVIDIA and AMD drivers use variable to decide when to switch to dedicated video card.

extern "C" 
{
  __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
}

Licho1 avatar Jul 27 '21 11:07 Licho1