parameters: (self)
docstring: Enumerate all RPC interfaces and add additional properties to the RPC functions. This routine will pass through
          the entire IDA database. This was entirely ripped from my RPC enumeration IDC script::
  
              http://www.openrce.org/downloads/details/3/RPC%20Enumerator
  
          The approach appears to be stable enough.
docstring_summary: Enumerate all RPC interfaces and add additional properties to the RPC functions. This routine will pass through
          the entire IDA database. This was entirely ripped from my RPC enumeration IDC script::
docstring_tokens: Enumerate all RPC interfaces and add additional properties to the RPC functions . This routine will pass through the entire IDA database . This was entirely ripped from my RPC enumeration IDC script ::
function: def __init_enumerate_rpc__ (self):
          '''
          Enumerate all RPC interfaces and add additional properties to the RPC functions. This routine will pass through
          the entire IDA database. This was entirely ripped from my RPC enumeration IDC script::
  
              http://www.openrce.org/downloads/details/3/RPC%20Enumerator
  
          The approach appears to be stable enough.
          '''
  
          # walk through the entire database.
          # we don't just look at .text as .rdata also been spotted to house RPC structs.
          for loop_ea in Heads(MinEA(), MaxEA()):
              ea     = loop_ea;
              length = Byte(ea);
              magic  = Dword(ea + 0x18);
  
              # RPC_SERVER_INTERFACE found.
              if length == 0x44 and magic == 0x8A885D04:
                  # grab the rpc interface uuid.
                  uuid = ""
                  for x in xrange(ea+4, ea+4+16):
                      uuid += chr(Byte(x))
  
                  # jump to MIDL_SERVER_INFO.
                  ea = Dword(ea + 0x3C);
  
                  # jump to DispatchTable.
                  ea = Dword(ea + 0x4);
  
                  # enumerate the dispatch routines.
                  opcode = 0
                  while 1:
                      addr = Dword(ea)
  
                      if addr == BADADDR:
                          break
  
                      # sometimes ida doesn't correctly get the function start thanks to the whole 'mov reg, reg' noop
                      # nonsense. so try the next instruction.
                      if not len(GetFunctionName(addr)):
                          addr = NextNotTail(addr)
  
                      if not len(GetFunctionName(addr)):
                          break
  
                      if self.nodes.has_key(addr):
                          self.nodes[addr].rpc_uuid   = self.uuid_bin_to_string(uuid)
                          self.nodes[addr].rpc_opcode = opcode
                      else:
                          print "PIDA.MODULE> No function node for RPC routine @%08X" % addr
  
                      ea     += 4
                      opcode += 1
function_tokens: def __init_enumerate_rpc__ ( self ) : # walk through the entire database. # we don't just look at .text as .rdata also been spotted to house RPC structs. for loop_ea in Heads ( MinEA ( ) , MaxEA ( ) ) : ea = loop_ea length = Byte ( ea ) magic = Dword ( ea + 0x18 ) # RPC_SERVER_INTERFACE found. if length == 0x44 and magic == 0x8A885D04 : # grab the rpc interface uuid. uuid = "" for x in xrange ( ea + 4 , ea + 4 + 16 ) : uuid += chr ( Byte ( x ) ) # jump to MIDL_SERVER_INFO. ea = Dword ( ea + 0x3C ) # jump to DispatchTable. ea = Dword ( ea + 0x4 ) # enumerate the dispatch routines. opcode = 0 while 1 : addr = Dword ( ea ) if addr == BADADDR : break # sometimes ida doesn't correctly get the function start thanks to the whole 'mov reg, reg' noop # nonsense. so try the next instruction. if not len ( GetFunctionName ( addr ) ) : addr = NextNotTail ( addr ) if not len ( GetFunctionName ( addr ) ) : break if self . nodes . has_key ( addr ) : self . nodes [ addr ] . rpc_uuid = self . uuid_bin_to_string ( uuid ) self . nodes [ addr ] . rpc_opcode = opcode else : print "PIDA.MODULE> No function node for RPC routine @%08X" % addr ea += 4 opcode += 1