Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Functions | |
RZ_API RzAnnotatedCode * | rz_annotated_code_new (char *code) |
Create and initialize a RzAnnotatedCode structure and returns its pointer. More... | |
RZ_API void | rz_annotation_free (void *e, void *user) |
Deallocates dynamically allocated memory for the specified annotation. More... | |
RZ_API bool | rz_annotation_is_reference (RzCodeAnnotation *annotation) |
Checks if the specified annotation is a reference. More... | |
RZ_API bool | rz_annotation_is_variable (RzCodeAnnotation *annotation) |
Checks if the specified annotation is a function variable. More... | |
RZ_API void | rz_annotated_code_free (RzAnnotatedCode *code) |
Deallocates the dynamically allocated memory for the specified RzAnnotatedCode. More... | |
RZ_API void | rz_annotated_code_add_annotation (RzAnnotatedCode *code, RzCodeAnnotation *annotation) |
Inserts the specified annotation into the list of annotations in the specified RzAnnotatedCode. More... | |
RZ_API RzPVector * | rz_annotated_code_annotations_in (RzAnnotatedCode *code, size_t offset) |
Returns all annotations with range that contains the given offset. More... | |
RZ_API RzPVector * | rz_annotated_code_annotations_range (RzAnnotatedCode *code, size_t start, size_t end) |
Returns all annotations with range that overlap with the specified range. More... | |
RZ_API RzVector * | rz_annotated_code_line_offsets (RzAnnotatedCode *code) |
Returns the offset for every line of decompiled code in the specified RzAnnotatedCode. More... | |
RZ_API void rz_annotated_code_add_annotation | ( | RzAnnotatedCode * | code, |
RzCodeAnnotation * | annotation | ||
) |
Inserts the specified annotation into the list of annotations in the specified RzAnnotatedCode.
code | Pointer to a RzAnnotatedCode. |
annotation | Pointer to an annotation. |
Definition at line 45 of file annotated_code.c.
References rz_vector_push().
RZ_API RzPVector* rz_annotated_code_annotations_in | ( | RzAnnotatedCode * | code, |
size_t | offset | ||
) |
Returns all annotations with range that contains the given offset.
Creates a RzPVector <RzCodeAnnotation> and inserts the pointers to all annotations in which annotation->start <= offset < annotation->end.
code | Pointer to a RzAnnotatedCode. |
offset | Offset. |
Definition at line 49 of file annotated_code.c.
References test_evm::end, NULL, r, rz_pvector_new(), rz_pvector_push(), rz_vector_foreach, and rz_code_annotation_t::start.
RZ_API RzPVector* rz_annotated_code_annotations_range | ( | RzAnnotatedCode * | code, |
size_t | start, | ||
size_t | end | ||
) |
Returns all annotations with range that overlap with the specified range.
Creates an RzPVector <RzCodeAnnotation> and inserts the pointers to all annotations whose range overlap with range specified.
code | Pointer to a RzAnnotatedCode. |
start | Start of the range(inclusive). |
end | End of the range(exclusive). |
Definition at line 63 of file annotated_code.c.
References rz_code_annotation_t::end, NULL, r, rz_pvector_new(), rz_pvector_push(), rz_vector_foreach, and start.
Referenced by rz_annotated_code_line_offsets().
RZ_API void rz_annotated_code_free | ( | RzAnnotatedCode * | code | ) |
Deallocates the dynamically allocated memory for the specified RzAnnotatedCode.
code | Pointer to a RzAnnotatedCode. |
Definition at line 36 of file annotated_code.c.
References rz_free, and rz_vector_clear().
RZ_API RzVector* rz_annotated_code_line_offsets | ( | RzAnnotatedCode * | code | ) |
Returns the offset for every line of decompiled code in the specified RzAnnotatedCode.
Creates an RzVector <ut64> and inserts the offsets for every seperate line of decompiled code in the specified RzAnnotatedCode. If a line of decompiled code doesn't have a unique offset, UT64_MAX is inserted as its offset.
code | Pointer to a RzAnnotatedCode. |
Definition at line 78 of file annotated_code.c.
References len, NULL, rz_code_annotation_t::offset, r, rz_annotated_code_annotations_range(), RZ_CODE_ANNOTATION_TYPE_OFFSET, rz_pvector_foreach, rz_pvector_free(), rz_vector_new(), rz_vector_push(), rz_code_annotation_t::type, ut64(), and UT64_MAX.
RZ_API RzAnnotatedCode* rz_annotated_code_new | ( | char * | code | ) |
Create and initialize a RzAnnotatedCode structure and returns its pointer.
This function creates and initializes a new RzAnnotatedCode structure with the specified decompiled code that's passed as an argument. Here, the argument code must be a string that can be deallocated. This will initialize RzVector <RzCodeAnnotation> annotations as well.
code | A deallocatable character array. |
Definition at line 8 of file annotated_code.c.
References code, NULL, r, rz_annotation_free(), RZ_NEW0, and rz_vector_init().
RZ_API void rz_annotation_free | ( | void * | e, |
void * | user | ||
) |
Deallocates dynamically allocated memory for the specified annotation.
This function recognizes the type of the specified annotation and frees memory that is dynamically allocated for it.
e | Pointer to the annotation. |
user | Always NULL for this function. Present here for this function to be of the type RzVectorFree. |
Definition at line 18 of file annotated_code.c.
References e, free(), rz_code_annotation_t::reference, RZ_CODE_ANNOTATION_TYPE_FUNCTION_NAME, RZ_CODE_ANNOTATION_TYPE_FUNCTION_PARAMETER, RZ_CODE_ANNOTATION_TYPE_LOCAL_VARIABLE, rz_code_annotation_t::type, and rz_code_annotation_t::variable.
Referenced by rz_annotated_code_new().
RZ_API bool rz_annotation_is_reference | ( | RzCodeAnnotation * | annotation | ) |
Checks if the specified annotation is a reference.
This function recognizes the type of the specified annotation and returns true if its type is any of the following three: RZ_CODE_ANNOTATION_TYPE_GLOBAL_VARIABLE, RZ_CODE_ANNOTATION_TYPE_CONSTANT_VARIABLE, RZ_CODE_ANNOTATION_TYPE_FUNCTION_NAME
annotation | Pointer to an annotation. |
Definition at line 28 of file annotated_code.c.
References RZ_CODE_ANNOTATION_TYPE_CONSTANT_VARIABLE, RZ_CODE_ANNOTATION_TYPE_FUNCTION_NAME, RZ_CODE_ANNOTATION_TYPE_GLOBAL_VARIABLE, and rz_code_annotation_t::type.
RZ_API bool rz_annotation_is_variable | ( | RzCodeAnnotation * | annotation | ) |
Checks if the specified annotation is a function variable.
This function recognizes the type of the specified annotation and returns true if its type is any of the following two: RZ_CODE_ANNOTATION_TYPE_LOCAL_VARIABLE, RZ_CODE_ANNOTATION_TYPE_FUNCTION_PARAMETER
annotation | Pointer to an annotation. |
Definition at line 32 of file annotated_code.c.
References RZ_CODE_ANNOTATION_TYPE_FUNCTION_PARAMETER, RZ_CODE_ANNOTATION_TYPE_LOCAL_VARIABLE, and rz_code_annotation_t::type.