-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclassdump.c
43 lines (30 loc) · 879 Bytes
/
classdump.c
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*******************************************************************************
* Java Class File Dump
* Reference: The class File Format at docs.oracle.com
*
*******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "class.h"
static void jclass_dump(ClassFile *class)
{
printf("Dump!\n");
}
int main(int argc, char *argv[])
{
ClassFile *class = NULL;
int result;
if (argc != 2) {
printf("Error: invalid number of arguments.\n");
printf("Usage: %s filename\n", argv[0]);
return EXIT_FAILURE;
}
result = jclass_read(argv[1], &class);
if (result != CLASS_OK) {
printf("An error has occurred.\n");
}
/* Dump */
jclass_dump(class);
jclass_free(class);
return EXIT_SUCCESS;
}