近期

近期

python中的split()函数的用法

split():拆分字符串。通过指定分隔符对字符串进行切片,并返回分割后的字符串列表(list)

语法:str.split(str="",num=string.count(str))n

参数说明:
str:表示为分隔符,默认为空格,但是不能为空('')。若字符串中没有分隔符,则把整个字符串作为列表的一个元素
num:表示分割次数。如果存在参数num,则仅分隔成 num+1 个子字符串,并且每一个子字符串可以赋给新的变量

注意:当使用空格作为分隔符时,对于中间为空的项会自动忽略

Python join()方法

join()方法语法:

str.join(sequence)

在字符串序列中连接

symbol = "-";
seq = ("a", "b", "c"); # 字符串序列
print symbol.join( seq );

《加密与解密》第11章

PE文件是windows系统中遵循PE结构的文件,比如以.exe .dll为后缀名的文件以及系统驱动文件。

PE文件大体分为两部分,头(包括下图中的DOS头,PE文件头,块表)与主体(块)。

基地址(Imagebase):磁盘中的文件加载到内存当中的时候可以加载到任意位置,而这个位置就是程序的基址。EXE默认的加载基址是400000h,DLL文件默认基址是10000000h。需要注意的是基地址不是程序的入口点。

相对虚拟地址(RVA):为了避免PE文件中有确定的内存地址,引入了相对虚拟地址的概念。RVA是在内存中相对与载入地址(基地址)的偏移量,所以你可以发现前三个概念的关系:虚拟地址(VA)= 基地址+相对虚拟地址(RVA)

是 PE 文件中 代码数据 的基本单元。原则上讲,节只分为 “代码节” 和 “数据节” 。

ida常用宏定义

typedef          char   int8;
typedef   signed char   sint8;
typedef unsigned char   uint8;
typedef          short  int16;
typedef   signed short  sint16;
typedef unsigned short  uint16;
typedef          int    int32;
typedef   signed int    sint32;
typedef unsigned int    uint32;
typedef ll              int64;
typedef ll              sint64;
typedef ull             uint64;

template<class T>  int16 __PAIR__( int8  high, T low) { return ((( int16)high) << sizeof(high)*8) | uint8(low); }
template<class T>  int32 __PAIR__( int16 high, T low) { return ((( int32)high) << sizeof(high)*8) | uint16(low); }
template<class T>  int64 __PAIR__( int32 high, T low) { return ((( int64)high) << sizeof(high)*8) | uint32(low); }
template<class T> uint16 __PAIR__(uint8  high, T low) { return (((uint16)high) << sizeof(high)*8) | uint8(low); }
template<class T> uint32 __PAIR__(uint16 high, T low) { return (((uint32)high) << sizeof(high)*8) | uint16(low); }
template<class T> uint64 __PAIR__(uint32 high, T low) { return (((uint64)high) << sizeof(high)*8) | uint32(low); }

#define _BYTE  uint8
#define _WORD  uint16
#define _DWORD uint32
#define _QWORD uint64
#define _LONGLONG __int128
posted @ 2023-01-29 19:55  kayoki  阅读(60)  评论(0)    收藏  举报