color xml arm相关
#--------------------------------------------------------------------------
# C O L O R S
#-------------------------------------------------------------------------- def GetColor(ea, what):
"""
Get item color @param ea: address of the item
@param what: type of the item (one of CIC_* constants) @return: color code in RGB (hex 0xBBGGRR)
"""
if what not in [ CIC_ITEM, CIC_FUNC, CIC_SEGM ]:
raise ValueError, "'what' must be one of CIC_ITEM, CIC_FUNC and CIC_SEGM" if what == CIC_ITEM:
return idaapi.get_item_color(ea) if what == CIC_FUNC:
func = idaapi.get_func(ea)
if func:
return func.color
else:
return DEFCOLOR if what == CIC_SEGM:
seg = idaapi.getseg(ea)
if seg:
return seg.color
else:
return DEFCOLOR # color item codes:
CIC_ITEM = 1 # one instruction or data
CIC_FUNC = 2 # function
CIC_SEGM = 3 # segment DEFCOLOR = 0xFFFFFFFF # Default color def SetColor(ea, what, color):
"""
Set item color @param ea: address of the item
@param what: type of the item (one of CIC_* constants)
@param color: new color code in RGB (hex 0xBBGGRR) @return: success (True or False)
"""
if what not in [ CIC_ITEM, CIC_FUNC, CIC_SEGM ]:
raise ValueError, "'what' must be one of CIC_ITEM, CIC_FUNC and CIC_SEGM" if what == CIC_ITEM:
return idaapi.set_item_color(ea, color) if what == CIC_FUNC:
func = idaapi.get_func(ea)
if func:
func.color = color
return bool(idaapi.update_func(func))
else:
return False if what == CIC_SEGM:
seg = idaapi.getseg(ea)
if seg:
seg.color = color
return bool(seg.update())
else:
return False #--------------------------------------------------------------------------
# X M L
#-------------------------------------------------------------------------- def SetXML(path, name, value):
"""
Set or update one or more XML values. @param path: XPath expression of elements where to create value(s)
@param name: name of the element/attribute
(use @XXX for an attribute) to create.
If 'name' is empty, the elements or
attributes returned by XPath are directly
updated to contain the new 'value'.
@param value: value of the element/attribute @return: success (True or False)
"""
return idaapi.set_xml(path, name, value) def GetXML(path):
"""
Get one XML value. @param path: XPath expression to an element
or attribute whose value is requested @return: the value, None if failed
"""
v = idaapi.value_t()
if idaapi.get_xml(path):
return v.str
else:
return None #----------------------------------------------------------------------------
# A R M S P E C I F I C
#----------------------------------------------------------------------------
def ArmForceBLJump(ea):
"""
Some ARM compilers in Thumb mode use BL (branch-and-link)
instead of B (branch) for long jumps, since BL has more range.
By default, IDA tries to determine if BL is a jump or a call.
You can override IDA's decision using commands in Edit/Other menu
(Force BL call/Force BL jump) or the following two functions. Force BL instruction to be a jump @param ea: address of the BL instruction @return: 1-ok, 0-failed
"""
return Eval("ArmForceBLJump(0x%x)"%ea) def ArmForceBLCall(ea):
"""
Force BL instruction to be a call @param ea: address of the BL instruction @return: 1-ok, 0-failed
"""
return Eval("ArmForceBLCall(0x%x)"%ea) #--------------------------------------------------------------------------
# Compatibility macros:
def Compile(file): return CompileEx(file, 1)
def OpOffset(ea,base): return OpOff(ea,-1,base)
def OpNum(ea): return OpNumber(ea,-1)
def OpChar(ea): return OpChr(ea,-1)
def OpSegment(ea): return OpSeg(ea,-1)
def OpDec(ea): return OpDecimal(ea,-1)
def OpAlt1(ea, opstr): return OpAlt(ea, 0, opstr)
def OpAlt2(ea, opstr): return OpAlt(ea, 1, opstr)
def StringStp(x): return SetCharPrm(INF_ASCII_BREAK,x)
def LowVoids(x): return SetLongPrm(INF_LOW_OFF,x)
def HighVoids(x): return SetLongPrm(INF_HIGH_OFF,x)
def TailDepth(x): return SetLongPrm(INF_MAXREF,x)
def Analysis(x): return SetCharPrm(INF_AUTO,x)
def Tabs(x): return SetCharPrm(INF_ENTAB,x)
#def Comments(x): SetCharPrm(INF_CMTFLAG,((x) ? (SW_ALLCMT|GetCharPrm(INF_CMTFLAG)) : (~SW_ALLCMT&GetCharPrm(INF_CMTFLAG))))
def Voids(x): return SetCharPrm(INF_VOIDS,x)
def XrefShow(x): return SetCharPrm(INF_XREFNUM,x)
def Indent(x): return SetCharPrm(INF_INDENT,x)
def CmtIndent(x): return SetCharPrm(INF_COMMENT,x)
def AutoShow(x): return SetCharPrm(INF_SHOWAUTO,x)
def MinEA(): return GetLongPrm(INF_MIN_EA)
def MaxEA(): return GetLongPrm(INF_MAX_EA)
def BeginEA(): return GetLongPrm(INF_BEGIN_EA)
def set_start_cs(x): return SetLongPrm(INF_START_CS,x)
def set_start_ip(x): return SetLongPrm(INF_START_IP,x) def WriteMap(filepath):
return GenerateFile(OFILE_MAP, filepath, 0, BADADDR, GENFLG_MAPSEG|GENFLG_MAPNAME) def WriteTxt(filepath, ea1, ea2):
return GenerateFile(OFILE_ASM, filepath, ea1, ea2, 0) def WriteExe(filepath):
return GenerateFile(OFILE_EXE, filepath, 0, BADADDR, 0) UTP_STRUCT = idaapi.UTP_STRUCT
UTP_ENUM = idaapi.UTP_ENUM def BeginTypeUpdating(utp):
"""
Begin type updating. Use this function if you
plan to call AddEnumConst or similar type modification functions
many times or from inside a loop @param utp: one of UTP_xxxx consts
@return: None
"""
return idaapi.begin_type_updating(utp) def EndTypeUpdating(utp):
"""
End type updating. Refreshes the type system
at the end of type modification operations @param utp: one of idaapi.UTP_xxxx consts
@return: None
"""
return idaapi.end_type_updating(utp) def AddConst(enum_id, name,value): return AddConstEx(enum_id, name, value, idaapi.BADADDR)
def AddStruc(index, name): return AddStrucEx(index,name, 0)
def AddUnion(index, name): return AddStrucEx(index,name, 1)
def OpStroff(ea, n, strid): return OpStroffEx(ea,n,strid, 0)
def OpEnum(ea, n, enumid): return OpEnumEx(ea,n,enumid, 0)
def DelConst(constid, v, mask): return DelConstEx(constid, v, 0, mask)
def GetConst(constid, v, mask): return GetConstEx(constid, v, 0, mask)
def AnalyseArea(sEA, eEA): return AnalyzeArea(sEA,eEA) def MakeStruct(ea, name): return MakeStructEx(ea, -1, name)
def MakeCustomData(ea, size, dtid, fid): return MakeCustomDataEx(ea, size, dtid, fid)
def Name(ea): return NameEx(BADADDR, ea)
def GetTrueName(ea): return GetTrueNameEx(BADADDR, ea)
def MakeName(ea, name): return MakeNameEx(ea,name,SN_CHECK) #def GetFrame(ea): return GetFunctionAttr(ea, FUNCATTR_FRAME)
#def GetFrameLvarSize(ea): return GetFunctionAttr(ea, FUNCATTR_FRSIZE)
#def GetFrameRegsSize(ea): return GetFunctionAttr(ea, FUNCATTR_FRREGS)
#def GetFrameArgsSize(ea): return GetFunctionAttr(ea, FUNCATTR_ARGSIZE)
#def GetFunctionFlags(ea): return GetFunctionAttr(ea, FUNCATTR_FLAGS)
#def SetFunctionFlags(ea, flags): return SetFunctionAttr(ea, FUNCATTR_FLAGS, flags) #def SegStart(ea): return GetSegmentAttr(ea, SEGATTR_START)
#def SegEnd(ea): return GetSegmentAttr(ea, SEGATTR_END)
#def SetSegmentType(ea, type): return SetSegmentAttr(ea, SEGATTR_TYPE, type) def SegCreate(a1, a2, base, use32, align, comb): return AddSeg(a1, a2, base, use32, align, comb)
def SegDelete(ea, flags): return DelSeg(ea, flags)
def SegBounds(ea, startea, endea, flags): return SetSegBounds(ea, startea, endea, flags)
def SegRename(ea, name): return RenameSeg(ea, name)
def SegClass(ea, segclass): return SetSegClass(ea, segclass)
def SegAddrng(ea, bitness): return SetSegAddressing(ea, bitness)
def SegDefReg(ea, reg, value): return SetSegDefReg(ea, reg, value) def Comment(ea): return GetCommentEx(ea, 0)
"""Returns the regular comment or None""" def RptCmt(ea): return GetCommentEx(ea, 1)
"""Returns the repeatable comment or None""" def SetReg(ea, reg, value): return SetRegEx(ea, reg, value, SR_user) # Convenience functions:
def here(): return ScreenEA()
def isEnabled(ea): return (PrevAddr(ea+1)==ea) # Obsolete segdel macros:
SEGDEL_PERM = 0x0001 # permanently, i.e. disable addresses
SEGDEL_KEEP = 0x0002 # keep information (code & data, etc)
SEGDEL_SILENT = 0x0004 # be silent ARGV = []
"""The command line arguments passed to IDA via the -S switch.""" # END OF IDC COMPATIBILY CODE
color xml arm相关的更多相关文章
- XML的相关基础知识分享
XML和Json是两种最常用的在网络中数据传输的数据序列化格式,随着时代的变迁,XML序列化用于网络传输也逐渐被Json取代,前几天,单位系统集成开发对接接口时,发现大部分都用的WebService技 ...
- color.xml
写控件的时候经常会遇到颜色选择问题,下面贴出常用颜色表示,方便选择. <?xml version="1.0" encoding="utf-8"?>& ...
- Android常用的颜色列表 color.xml
转自:http://blog.csdn.net/libaineu2004/article/details/41548313 <?xml version="1.0" encod ...
- android颜色color.xml设置
XML Code 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...
- [转帖]ARM 相关内容
ARM内核全解析,从ARM7,ARM9到Cortex-A7,A8,A9,A12,A15到Cortex-A53,A57 http://www.myir-tech.com/resource/448.asp ...
- XML的相关基础知识分享(二)
前面我们讲了一下XML相关的基础知识(一),下面我们在加深一下,看一下XML高级方面. 一.命名空间 1.命名冲突 XML命名空间提供避免元素冲突的方法. 命名冲突:在XML中,元素名称是由开发者定义 ...
- maven的pom.xml配置文件相关依赖jar包
<!--声明变量--> <properties> <project.build.sourceEncoding>UTF-8</project.build.sou ...
- 如何把android中布局文件(.xml)与相关的类(.java)进行关联?
eg:把一个布局文件名为page1.xml与MainActivity.java(工程自动生成)进行 1.在存放使用资源的res文件夹下的layout文件夹内新建一个XML布局文件,如命名为:page1 ...
- iOS中XML的相关知识
1.什么是XML “当 XML(扩展标记语言)于 1998 年 2 月被引入软件工业界时,它给整个行业带来了一场风暴.有史以来第一次,这个世界拥有了一种用来结构化文档和数据的通用且适应性强的格式,它不 ...
随机推荐
- 基于VS2017的Docker Support体检ASP.NET Core站点的Docker部署
最近在学习如何用 Docker 部署生产环境中的 ASP.NET Core 站点,作为一个 Docer 新手,从何处下手更容易入门呢?一开始就手写 Docker 配置文件(Docfile, docke ...
- Direct Visual-Inertial Odometry with Stereo Cameras
这对于直接方法是特别有益的:众所周知直接图像对准是非凸的,并且只有在足够准确的初始估计可用时才能预期收敛.虽然在实践中像粗到精跟踪这样的技术会增加收敛半径,但是紧密的惯性积分可以更有效地解决这个问题, ...
- [No0000F6]C# 继承
继承是面向对象程序设计中最重要的概念之一.继承允许我们根据一个类来定义另一个类,这使得创建和维护应用程序变得更容易.同时也有利于重用代码和节省开发时间. 当创建一个类时,程序员不需要完全重新编写新的数 ...
- tfidf_CountVectorizer 与 TfidfTransformer 保存和测试
做nlp的时候,如果用到tf-idf,sklearn中用CountVectorizer与TfidfTransformer两个类,下面对和两个类进行讲解 一.训练以及测试 CountVectorizer ...
- 【RMAN】RMAN-05001: auxiliary filename conflicts with the target database
oracle 11.2.0.4 运行以下脚本,使用活动数据库复制技术创建dataguard备库报错rman-005001: run{ duplicate target database for sta ...
- MAC apache服务器搭建
一.启动原本服务器 首先打开“终端(terminal)”,输入 sudo apachectl -v,(可能需要输入机器秘密).如下显示Apache的版本: 可以输入启动命令进行启动: sudo apa ...
- vue 静态资源 压缩提交自动化
需要安装co和child_process模块,co可以执行多个promise,child_process可以执行命令行的库(cmd命令) 配置winrar(压缩包)坏境变量,参考资料https://j ...
- Chap2:二进数值与记数系统[Computer Science Illuminated]
1 基数(base):记数系统的基本数值,规定了这个系统中使用的数字量和数位位置的值 2 数字采用位置计数法进行编写 位置计数法(positional notation):一种表达数字的系统,数位按顺 ...
- 转:Java 异常结构体系
原文地址:Java 异常结构体系 保存一份资料 前几天在参加网易和360公司的在线考试的时候,都出了一道关于java中异常类的多项选择题.这几天翻看了相关书籍和网上一些资料,结合自己的理解与思考,将自 ...
- inet超级服务器和守护进程
inetd是监视一些网络请求的守护进程,其根据网络请求来调用相应的服务进程来处理连接请求.它可以为多种服务管理连接,当 inetd接到连接时,它能够确定连接所需的程序,启动相应的进程,并把 socke ...