본문 바로가기

취약점 분석

64bit Big Endian <-> Little Endian 변환

반응형

#include "stdafx.h"

#include <Winsock2.h>

#include <stdlib.h>


long long value = 0x0123456789abcdef


printf("%016llX", htonll(value));  //long long 자료형이라 LL이 붙습니다. (64bit)

//==> ef cd ab 89 67 45 23 01


printf("%016llX", ntohll(value));

//==> ef cd ab 89 67 45 23 01

반응형