Rizin
unix-like reverse engineering framework and cli tools
class_attribute.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef RZ_BIN_JAVA_CLASS_ATTRIBUTE_H
5 #define RZ_BIN_JAVA_CLASS_ATTRIBUTE_H
6 #include <rz_types.h>
7 #include <rz_util.h>
8 #include <rz_bin.h>
9 #include "class_exceptions.h"
10 #include "class_line_number.h"
11 #include "class_local_variable.h"
12 #include "class_module.h"
13 #include "class_const_pool.h"
14 
15 typedef enum {
17  ATTRIBUTE_TYPE_UNKNOWN, // will be used only when parsing an unknown attribute
18 
19  ATTRIBUTE_TYPE_CONSTANTVALUE, /* Java SE 1.0.2 */
20  ATTRIBUTE_TYPE_CODE, /* Java SE 1.0.2 */
22  ATTRIBUTE_TYPE_EXCEPTIONS, /* Java SE 1.0.2 */
23  ATTRIBUTE_TYPE_INNERCLASSES, /* Java SE 1.1 */
24  ATTRIBUTE_TYPE_ENCLOSINGMETHOD, /* Java SE 5.0 */
25  ATTRIBUTE_TYPE_SYNTHETIC, /* Java SE 1.1 */
26  ATTRIBUTE_TYPE_SIGNATURE, /* Java SE 5.0 */
27  ATTRIBUTE_TYPE_SOURCEFILE, /* Java SE 1.0.2 */
29  ATTRIBUTE_TYPE_LINENUMBERTABLE, /* Java SE 1.0.2 */
30  ATTRIBUTE_TYPE_LOCALVARIABLETABLE, /* Java SE 1.0.2 */
32  ATTRIBUTE_TYPE_DEPRECATED, /* Java SE 1.1 */
42  ATTRIBUTE_TYPE_MODULE, /* Java SE 9 */
45  ATTRIBUTE_TYPE_NESTHOST, /* Java SE 11 */
46  ATTRIBUTE_TYPE_NESTMEMBERS /* Java SE 11 */
48 
49 typedef struct java_attribute_t {
54  void *info;
56 
58  /*
59  * Must be pointing to one of these types:
60  * CONSTANT_POOL_INTEGER: int, short, char, byte, boolean
61  * CONSTANT_POOL_FLOAT: float
62  * CONSTANT_POOL_LONG: long
63  * CONSTANT_POOL_DOUBLE: double
64  * CONSTANT_POOL_STRING: String
65  */
68 
69 typedef struct java_attribute_code_t {
79 
83 
88 
93 
98 
99 typedef struct java_attribute_module_t {
103 
106 
109 
112 
115 
119 
124 
128 
130 void java_attribute_free(Attribute *attr);
131 bool java_attribute_resolve(ConstPool **pool, ut32 poolsize, Attribute *attr, RzBuffer *buf, bool is_oak);
132 
133 #endif /* RZ_BIN_JAVA_CLASS_ATTRIBUTE_H */
struct java_attribute_t Attribute
struct java_attribute_module_main_class_t AttributeModuleMainClass
bool java_attribute_resolve(ConstPool **pool, ut32 poolsize, Attribute *attr, RzBuffer *buf, bool is_oak)
AttributeType
@ ATTRIBUTE_TYPE_BOOTSTRAPMETHODS
@ ATTRIBUTE_TYPE_MODULEMAINCLASS
@ ATTRIBUTE_TYPE_SYNTHETIC
@ ATTRIBUTE_TYPE_EXCEPTIONS
@ ATTRIBUTE_TYPE_RUNTIMEINVISIBLETYPEANNOTATIONS
@ ATTRIBUTE_TYPE_CODE
@ ATTRIBUTE_TYPE_ENCLOSINGMETHOD
@ ATTRIBUTE_TYPE_SOURCEFILE
@ ATTRIBUTE_TYPE_MODULEPACKAGES
@ ATTRIBUTE_TYPE_ANNOTATIONDEFAULT
@ ATTRIBUTE_TYPE_INNERCLASSES
@ ATTRIBUTE_TYPE_INVALID
@ ATTRIBUTE_TYPE_SIGNATURE
@ ATTRIBUTE_TYPE_LOCALVARIABLETYPETABLE
@ ATTRIBUTE_TYPE_MODULE
@ ATTRIBUTE_TYPE_RUNTIMEINVISIBLEANNOTATIONS
@ ATTRIBUTE_TYPE_RUNTIMEINVISIBLEPARAMETERANNOTATIONS
@ ATTRIBUTE_TYPE_LOCALVARIABLETABLE
@ ATTRIBUTE_TYPE_DEPRECATED
@ ATTRIBUTE_TYPE_CONSTANTVALUE
@ ATTRIBUTE_TYPE_UNKNOWN
@ ATTRIBUTE_TYPE_LINENUMBERTABLE
@ ATTRIBUTE_TYPE_SOURCEDEBUGEXTENSION
@ ATTRIBUTE_TYPE_RUNTIMEVISIBLETYPEANNOTATIONS
@ ATTRIBUTE_TYPE_NESTHOST
@ ATTRIBUTE_TYPE_NESTMEMBERS
@ ATTRIBUTE_TYPE_RUNTIMEVISIBLEPARAMETERANNOTATIONS
@ ATTRIBUTE_TYPE_METHODPARAMETERS
@ ATTRIBUTE_TYPE_RUNTIMEVISIBLEANNOTATIONS
@ ATTRIBUTE_TYPE_STACKMAPTABLE
struct java_attribute_code_t AttributeCode
struct java_attribute_constant_value_t AttributeConstantValue
struct java_attribute_local_variable_type_table_t AttributeLocalVariableTypeTable
struct java_attribute_line_number_table_t AttributeLineNumberTable
struct java_attribute_local_variable_table_t AttributeLocalVariableTable
struct java_attribute_source_file_t AttributeSourceFile
Attribute * java_attribute_new(RzBuffer *buf, ut64 offset)
void java_attribute_free(Attribute *attr)
struct java_attribute_module_t AttributeModule
struct java_attribute_module_packages_t AttributeModulePackages
uint16_t ut16
uint32_t ut32
voidpf uLong offset
Definition: ioapi.h:144
voidpf void * buf
Definition: ioapi.h:138
ExceptionTable * exceptions
ModuleProvide * provides
ModuleRequire * requires
AttributeType type
ut64(WINAPI *w32_GetEnabledXStateFeatures)()