포럼 회원으로 등록하신분만 다운로드가 가능합니다. 최대 업로드 가능한 용량은 1GB 입니다.

// normal linux
static void hexdump(uint8_t *_data, size_t size) {
    uint8_t *data = (uint8_t *)_data;
    size_t offset = 0;
    size_t i = 0;
    while (offset < size) {
        printf("0x%04x  ", offset);

        size_t n = size - offset;
        if (n > 16) {
            n = 16;
        }

        for (i = 0; i < 16; ++i) {
            if (i == 8) {
                printf(" ");
            }

            if (offset + i < size) {
                printf("%02x ", data[offset + i]);
            } else {
                printf("   ");
            }
        }

        printf(" ");

        for (i = 0; i < n; ++i) {
            if (isprint(data[offset + i])) {
                printf("%c", data[offset + i]);
            } else {
                printf(".");
            }
        }

        printf("\n");

        offset += 16;
    }
}


Android의 경우는 printf대신 ALOGI 혹은 ALOGV, ALOGE등을 사용하시면 됩니다.

"사람은 자기가 보고 싶은 현실만 볼 뿐이다." - Gaius Julius Caesar
엮인글 :
http://www.aesop.or.kr/index.php?mid=Board_Resources_General&document_srl=140363&act=trackback&key=75c
List of Articles
번호 제목 글쓴이 날짜sort 조회 수
» hexdump 함수 - binary를 16진수로 표시 고도리 2017-07-10 183
107 [HowTo] RTEMS toolchain for v4.11 file 고도리 2014-05-20 1451
106 yuv viewer & test yuv file file 고도리 2013-02-20 3152
105 ffmpeg 사용법 example 고도리 2013-02-20 45202
104 android platform tools for windows file 고도리 2013-01-28 3263
103 linaro toolchain gcc-linaro-arm-linux-gnueabihf-2012.07-20120720 file 고도리 2012-12-28 4299
102 uBuntu12.04 ARNDALE build 확인 된 가상 머신 이미지 [3] chlrbgh0 2012-12-14 4028
101 Exynos5250 public user manual [4] 관리자 2012-10-27 4827
100 Exynos4412 Public Manual [1] 고도리 2012-10-26 4206
99 lksctp(libsctp) android ICS 4.0.4 just compile on origen-4412 ... file [1] 고도리 2012-08-25 3658
98 Embedded Linux용 Root Filesystem(rootfs) with crosstoolchain file [5] 고도리 2012-08-23 3832
97 Nexus-S gingerbread kernel sound(alsa) driver 간단 구조 file [1] 고도리 2012-07-23 3989
96 Audio in embedded linux - ALSA file [1] 고도리 2012-07-23 4011
95 u-boot의 이해 file 고도리 2012-07-22 4324
94 [임베디드리눅스] 아델리눅스(adelinux) Embedded Linux Programmin... file [3] 고도리 2012-04-12 4973
93 ramdisk/initrd howto file 고도리 2012-03-26 4916
92 Origen board resource file 관리자 2012-02-29 5205
91 [X-windows] Root filesystem with GPE for Cortex-A8/A9 file [1] 고도리 2012-01-17 5289
90 Origen LCD board schematic file 관리자 2012-01-13 5168
89 Origen cameraboard schematic file 관리자 2012-01-13 5153

사용자 로그인