Esempio n. 1
0
 def _read_symbol_table_pexports(self, source):
     f = popen("pexports", source)
     try:
         for line in f:
             if line.strip() == 'EXPORTS':
                 break
         for line in f:
             line = line.strip()
             parts = line.split(' ')
             if len(parts) == 1:
                 self.functions.append(parts[0])
             else:
                 self.data.append(parts[0])
     finally:
         f.close()
Esempio n. 2
0
 def _read_symbol_table_pexports(self, source):
     f = popen("pexports", source)
     try:
         for line in f:
             if line.strip() == 'EXPORTS':
                 break
         for line in f:
             line = line.strip()
             parts = line.split(' ')
             if len(parts) == 1:
                 self.functions.append(parts[0])
             else:
                 self.data.append(parts[0])
     finally:
         f.close()
Esempio n. 3
0
 def _read_symbol_table_objdump(self, source):
     f = popen('objdump', '-T %s' % source)
     try:
         for line in f:
             if line.strip() == 'DYNAMIC SYMBOL TABLE:':
                 break
         for line in f:
             line = line.strip()
             if not line:
                 break
             flag = line[15]
             fields = line[17:].split()
             if len(fields) == 3:
                 section, size, name = fields
             if len(fields) == 4:
                 section, size, version, name = fields
             if section not in ('.bss', '.data', '.text'):
                 continue
             if flag == 'F':
                 self.functions.append(name)
             if flag == 'O':
                 self.data.append(name)
     finally:
         f.close()
Esempio n. 4
0
 def _read_symbol_table_objdump(self, source):
     f = popen('objdump', '-T %s' % source)
     try:
         for line in f:
             if line.strip() == 'DYNAMIC SYMBOL TABLE:':
                 break
         for line in f:
             line = line.strip()
             if not line:
                 break
             flag = line[15]
             fields = line[17:].split()
             if len(fields) == 3:
                 section, size, name = fields
             if len(fields) == 4:
                 section, size, version, name = fields
             if section not in ('.bss', '.data', '.text'):
                 continue
             if flag == 'F':
                 self.functions.append(name)
             if flag == 'O':
                 self.data.append(name)
     finally:
         f.close()
Esempio n. 5
0
def GetPexportsLines(path):
    stream = popen("pexports", path.replace('/cygdrive/c', 'c:'))
    try:
        return set(map(lambda s: s.strip(), stream.readlines()))
    finally:
        stream.close()
Esempio n. 6
0
def GetPexportsLines(path):
    stream = popen("pexports", path.replace('/cygdrive/c', 'c:'))
    try:
        return set(map(lambda s: s.strip(), stream.readlines()))
    finally:
        stream.close()