News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

c-- name conflict

Started by Emil_halim, April 10, 2018, 06:05:43 AM

Previous topic - Next topic

Emil_halim

Hi All

There are some c-- structure's names or member's names conflict with uasm keyword , such as 'Name'

so in my cmm2masm project , there are two solutions

1- i have to changing all conflicted keywords in all header's files , so hard mission!! also for users they must changing their structure's member or name

2- i can let cmm2masm to check that and prefix the conflict name with '_' char. , how can i get those keyword?

any help please?

habran

It is defined in coffspec.h

struct IMAGE_SECTION_HEADER {
    char Name[IMAGE_SIZEOF_SHORT_NAME];
    union {
        uint_32 PhysicalAddress;
        uint_32 VirtualSize;
    } Misc;
    uint_32 VirtualAddress;
    uint_32 SizeOfRawData;
    uint_32 PointerToRawData;
    uint_32 PointerToRelocations;
    uint_32 PointerToLinenumbers;
    uint_16 NumberOfRelocations;
    uint_16 NumberOfLinenumbers;
    uint_32 Characteristics;
};
Cod-Father

Emil_halim

thanks habran.

where can i find all the conflict keywords?

habran

bin.c, coff.c, coffspec.h, pespec.h, preproc.c, sal.h
Cod-Father

jj2007

\Masm32\include\Windows.inc:
IMAGE_SECTION_HEADER STRUCT
    Name1 db IMAGE_SIZEOF_SHORT_NAME dup(?)

nidud

#5
deleted

Emil_halim

thanks all,

Here is my function that return a non conflict name , also it fire a warning message.

char* keywrd[] = { "name","short","TYPE" };
int   keywrdnum = 3;
char keyCnflctName[255];

char* doConflictCheck(char* name)
{
   int k = 0;
   while (k < keywrdnum)
   {
      if (!stricmp(name, keywrd[k++]))
      {
         keyCnflctName[0] = '_';
         printf("warnning : found conflict object \'%s\' changed to \'_%s\'\n", name,name);
         return strcpy(keyCnflctName+1, name)-1;
      }
   }
   return  name;
}

i will increase it sooner , but if any one has faster one , please let me know.