-
-
[旧帖] [分享]bswap.h 0.00雪花
-
发表于: 2013-1-25 15:37 1242
-
#define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8)
#define bswap_32(x) \
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#define be2me_16(x) bswap_16(x)
#define be2me_32(x) bswap_32(x)
#define le2me_16(x) (x)
#define le2me_32(x) (x)
#define BE_32C(x,y) do { *(u4byte *)(x) = be2me_32((y)); } while(0)
#define BE_16C(x,y) do { *(u2byte *)(x) = be2me_16((y)); } while(0)
#define BE_32(x) be2me_32(*(u4byte *)(x))
#define BE_16(x) be2me_16(*(u2byte *)(x))
#define LE_32C(x,y) do { *(u4byte *)(x)=le2me_32((y)); } while(0)
#define LE_16C(x,y) do { *(u2byte *)(x)=le2me_16((y)); } while(0)
#define LE_32(x) le2me_32(*(u4byte*)(x))
#define LE_16(x) le2me_16(*(u2byte*)(x))
#define bswap_32(x) \
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#define be2me_16(x) bswap_16(x)
#define be2me_32(x) bswap_32(x)
#define le2me_16(x) (x)
#define le2me_32(x) (x)
#define BE_32C(x,y) do { *(u4byte *)(x) = be2me_32((y)); } while(0)
#define BE_16C(x,y) do { *(u2byte *)(x) = be2me_16((y)); } while(0)
#define BE_32(x) be2me_32(*(u4byte *)(x))
#define BE_16(x) be2me_16(*(u2byte *)(x))
#define LE_32C(x,y) do { *(u4byte *)(x)=le2me_32((y)); } while(0)
#define LE_16C(x,y) do { *(u2byte *)(x)=le2me_16((y)); } while(0)
#define LE_32(x) le2me_32(*(u4byte*)(x))
#define LE_16(x) le2me_16(*(u2byte*)(x))
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
赞赏
看原图
赞赏
雪币:
留言: