File: fuzz_decode_platform.c

package info (click to toggle)
capstone 5.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie, trixie-proposed-updates
  • size: 58,188 kB
  • sloc: ansic: 96,086; cpp: 67,489; cs: 29,510; python: 25,829; pascal: 24,412; java: 15,582; ml: 14,473; makefile: 1,275; sh: 479; ruby: 386
file content (27 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// this tool decodes first input byte feed to OSS fuzz, that encodes arch+mode
// by Nguyen Anh Quynh, 2019

#include <stdio.h>
#include <inttypes.h>

#include <capstone/capstone.h>

#include "platform.h"

int main(int argc, char **argv)
{
    unsigned char data;

    if (argc != 2) {
        printf("Decoding OSS fuzz platform\n");
        printf("Syntax: %s <hex-byte>\n", argv[0]);
        return -1;
    }

    data = (unsigned int)strtol(argv[1], NULL, 16);

    printf("cstool arch+mode = %s\n", get_platform_cstoolname(data));

    return 0;
}