diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-05-11 23:42:48 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-05-11 23:42:48 (GMT) |
commit | 96cb6971ee3ca529958b8cb1e8e55a6eb4e60eae (patch) | |
tree | 68e49f325de3e93ef186d3e078da8ddc473aedf7 /src/format/java/method.c | |
parent | 80dc0ac97987ad9246bee7c47458a015339453bf (diff) |
Reorganized the way the program is built again and added partial support for the JVM.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@63 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/java/method.c')
-rw-r--r-- | src/format/java/method.c | 32 |
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); + +} |