summaryrefslogtreecommitdiff
path: root/src/format/java/method.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/java/method.c')
-rw-r--r--src/format/java/method.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/format/java/method.c b/src/format/java/method.c
index bf927a1..ec4aa85 100644
--- a/src/format/java/method.c
+++ b/src/format/java/method.c
@@ -28,7 +28,6 @@
#include "attribute.h"
-#include "java-int.h"
#include "../../common/endianness.h"
@@ -155,3 +154,34 @@ void unload_java_method(java_format *format, java_method *method)
unload_java_attributes(format, method->attributes, method->attributes_count);
}
+
+
+/******************************************************************************
+* *
+* Paramètres : method = élément à traiter. *
+* offset = position physique du code de la méthode. [OUT] *
+* size = taille du code de la méthode. [OUT] *
+* *
+* Description : Retrouve le code binaire correspondant à une méthode. *
+* *
+* Retour : Bilan de l'opération. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool find_java_method_code_part(const java_method *method, off_t *offset, off_t *size)
+{
+ uint16_t i; /* Boucle de parcours */
+
+ for (i = 0; i < method->attributes_count; i++)
+ if (method->attributes[i].type == JAT_CODE)
+ {
+ *offset = method->attributes[i].info.code.content;
+ *size = method->attributes[i].info.code.code_length;
+ break;
+ }
+
+ return (i < method->attributes_count);
+
+}