当前位置: 首页>>代码示例>>Python>>正文


Python idc.get_wide_byte方法代码示例

本文整理汇总了Python中idc.get_wide_byte方法的典型用法代码示例。如果您正苦于以下问题:Python idc.get_wide_byte方法的具体用法?Python idc.get_wide_byte怎么用?Python idc.get_wide_byte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在idc的用法示例。


在下文中一共展示了idc.get_wide_byte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: nextGlobalString

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def nextGlobalString(self, ea):
        """Find the next possible address for a global string, given the beginning of the current global string.

        Args:
            ea (int): effective start address of the current global string.

        Return Value:
            Possible start address for the next global string
        """
        str_content = self.getAsciiString(ea)
        if str_content is None:
            return ea + self._global_alignment
        elif idc.get_wide_byte(ea + len(str_content)) != ord('\0'):
            return ea + max(self._global_alignment, pad(len(str_content), self._global_alignment))
        else:
            for offset in range(len(str_content) - 1, -1, -1):
                if chr(str_content[offset]) not in string.printable:
                    return ea + max(self._global_alignment, pad(offset, self._global_alignment))
        return ea + self._global_alignment 
开发者ID:CheckPointSW,项目名称:Karta,代码行数:21,代码来源:strings.py

示例2: read_leb128

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def read_leb128(ea, signed):
  """ Read LEB128 encoded data
  """
  val = 0
  shift = 0
  while True:
    byte = idc.get_wide_byte(ea)
    val |= (byte & 0x7F) << shift
    shift += 7
    ea += 1
    if (byte & 0x80) == 0:
      break

    if shift > 64:
      DEBUG("Bad leb128 encoding at {0:x}".format(ea - shift/7))
      return idc.BADADDR

  if signed and (byte & 0x40):
    val -= (1<<shift)
  return val, ea 
开发者ID:lifting-bits,项目名称:mcsema,代码行数:22,代码来源:util.py

示例3: get_native_function

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def get_native_function(self):

		ecx = idc.get_reg_value("ECX")
		esp = idc.get_reg_value("ESP")

		method_name = self.get_method_name(esp)
		
		if (idc.get_wide_byte(idc.get_wide_dword(ecx + 8) + 0x38) != 0):
			function = idc.get_wide_dword(idc.get_wide_dword(esp + 4) + 0x28)
		else:
			function = idc.get_wide_dword(idc.get_wide_dword(esp + 4) + 0x24)
		
		print("Resolved native function: 0x%x - %s" % (function, method_name))

		if ((method_name not in self.ignore and not self.ignore_all) or
			(method_name in self.debug_if_equals) or 
			(any(x for x in self.debug_if_contains if method_name is not None and x in method_name))):
			self.traced.append({"name": method_name, "ea": function, "type": "native", "hit": 0})
			idc.add_bpt(function) 
开发者ID:KasperskyLab,项目名称:ActionScript3,代码行数:21,代码来源:klfdb.py

示例4: revert_patch

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def revert_patch(va, nr):
    """Unpatch the opcodes at @va, reverting them to their original value.

    Args:
        va (numbers.Integral): Address of the location of the patch to revert
        nr (numbers.Integral): Number of bytes to scan and revert

    Returns:
        bool: True if patched bytes were restored
    """
    ret = False

    orig = [ida_bytes.get_original_byte(va + i) for i in range(nr)]
    current = [idc.get_wide_byte(va + i) for i in range(nr)]

    for i in range(len(orig)):
        if orig[i] != current[i]:
            ret = True
            idaapi.patch_byte(va + i, orig[i])

    return ret 
开发者ID:fireeye,项目名称:flare-ida,代码行数:23,代码来源:code_grafter.py

示例5: extractFunctionStartSample

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def extractFunctionStartSample(self, ea, code_type):
        """Extract features for a "function start" sample.

        Args:
            ea (int): effective address to be sampled
            code_type (int): code type of the wanted sample

        Return Value:
            feature set (list of byte values)
        """
        return list(map(lambda o: idc.get_wide_byte(ea + o), self._classifiers_start_offsets[code_type])) 
开发者ID:CheckPointSW,项目名称:Karta,代码行数:13,代码来源:function.py

示例6: extractFunctionEndSample

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def extractFunctionEndSample(self, ea, code_type):
        """Extract features for a "function end" sample.

        Args:
            ea (int): effective address to be sampled
            code_type (int): code type of the wanted sample

        Return Value:
            feature set (list of byte values)
        """
        return list(map(lambda o: idc.get_wide_byte(ea + o), self._classifiers_end_offsets[code_type])) 
开发者ID:CheckPointSW,项目名称:Karta,代码行数:13,代码来源:function.py

示例7: extractFunctionMixedSample

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def extractFunctionMixedSample(self, ea, code_type):
        """Extract features for a "function start/end" sample.

        Args:
            ea (int): effective address to be sampled
            code_type (int): code type of the wanted sample

        Return Value:
            feature set (list of byte values)
        """
        return list(map(lambda o: idc.get_wide_byte(ea + o), self._classifiers_mixed_offsets[code_type])) 
开发者ID:CheckPointSW,项目名称:Karta,代码行数:13,代码来源:function.py

示例8: extractFunctionTypeSample

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def extractFunctionTypeSample(self, ea):
        """Extract features for a "code type" sample.

        Args:
            ea (int): effective address to be sampled

        Return Value:
            feature set (list of byte values)
        """
        return list(map(lambda o: idc.get_wide_byte(ea + o), self._classifier_type_offsets)) 
开发者ID:CheckPointSW,项目名称:Karta,代码行数:12,代码来源:function.py

示例9: read_bytes_slowly

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def read_bytes_slowly(start, end):
  bytestr = []
  for i in xrange(start, end):
    if idc.has_value(idc.get_full_flags(i)):
      bt = idc.get_wide_byte(i)
      bytestr.append(chr(bt))
    else:
      bytestr.append("\x00")
  return "".join(bytestr) 
开发者ID:lifting-bits,项目名称:mcsema,代码行数:11,代码来源:util.py

示例10: _getbytes

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def _getbytes(self, start, l=1):
        out = []
        for ad in range(l):
            offset = ad + start + self.base_address
            if not is_mapped(offset):
                raise IOError("not enough bytes")
            out.append(int_to_byte(get_wide_byte(offset)))
        return b''.join(out) 
开发者ID:cea-sec,项目名称:miasm,代码行数:10,代码来源:bin_stream_ida.py

示例11: get_guid

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def get_guid(address):
    """get GUID located by address"""
    guid = []
    guid.append(idc.get_wide_dword(address))
    guid.append(idc.get_wide_word(address + 4))
    guid.append(idc.get_wide_word(address + 6))
    for addr in range(address + 8, address + 16, 1):
        guid.append(idc.get_wide_byte(addr))
    return guid 
开发者ID:yeggor,项目名称:UEFI_RETool,代码行数:11,代码来源:utils.py

示例12: get_header_idb

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def get_header_idb():
    """get file header from idb"""
    if idc.get_segm_name(0) == 'HEADER':
        header = bytearray(
            [idc.get_wide_byte(ea) for ea in range(0, idc.get_segm_end(0))])
        return header
    return bytearray(b'') 
开发者ID:yeggor,项目名称:UEFI_RETool,代码行数:9,代码来源:utils.py

示例13: getByte

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def getByte(self, ea):
        if idaapi.IDA_SDK_VERSION < 700:
            return idc.Byte(ea)
        else:
            return idc.get_wide_byte(ea) 
开发者ID:danielplohmann,项目名称:apiscout,代码行数:7,代码来源:IdaProxy.py

示例14: read_byte

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def read_byte(insn=None):

        if (insn):
            b = insn.get_next_byte()
        else:
            b = idc.get_wide_byte(Reader.pos)
            Reader.pos += 1
        return b 
开发者ID:KasperskyLab,项目名称:ActionScript3,代码行数:10,代码来源:as3.py

示例15: read_rect_size

# 需要导入模块: import idc [as 别名]
# 或者: from idc import get_wide_byte [as 别名]
def read_rect_size(li):

    nbits = idc.get_wide_byte(8) >> 3
    return ((5 + 4*nbits) + 7) / 8 
开发者ID:KasperskyLab,项目名称:ActionScript3,代码行数:6,代码来源:swf.py


注:本文中的idc.get_wide_byte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。