Module jvm :: Class JVMFormat
[hide private]
[frames] | no frames]

Class JVMFormat

source code

        object --+    
                 |    
bytecode._Bytecode --+
                     |
                    JVMFormat

An object which is the main class to handle properly a class file. Exported fields : magic, minor_version, major_version, constant_pool_count, access_flags, this_class, super_class, interfaces_count, fields_count, methods_count, attributes_count

Instance Methods [hide private]
 
__init__(self, buff)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_load_class(self) source code
 
get_field(self, name)
Return into a list all fields which corresponds to the regexp
source code
 
get_method(self, name)
Return into a list all methods which corresponds to the regexp
source code
 
get_fields(self)
Return all objects fields
source code
 
get_methods(self)
Return all objects methods
source code
 
get_constant_pool(self)
Return the constant pool list
source code
 
get_strings(self)
Return all strings into the class
source code
 
get_class_manager(self)
Return directly the class manager
source code
 
show(self)
Show the .class format into a human readable format
source code
 
insert_string(self, value)
Insert a string into the constant pool list (Constant_Utf8)
source code
 
insert_craft_method(self, name, proto, codes)
Insert a craft method into the class
source code
 
insert_direct_method(self, name, ref_method)
Insert a direct method (MethodInfo Object) into the class
source code
 
_fix_attributes_external(self, ref_method) source code
 
_fix_attributes_internal(self, ref_method) source code
 
_insert_basic_method(self, ref_method) source code
 
_get_raw(self) source code
string
save(self)
Return the class (with the modifications) into raw format
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from bytecode._Bytecode
 
add_idx(self, idx) source code
 
get_buff(self) source code
 
get_idx(self) source code
 
length_buff(self) source code
 
read(self, size) source code
 
read_b(self, size) source code
 
readat(self, off) source code
 
register(self, type_register, fct) source code
 
set_idx(self, idx) source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, buff)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • buff - the buffer which represents the open file
Overrides: object.__init__
(inherited documentation)

get_field(self, name)

source code 

Return into a list all fields which corresponds to the regexp

Parameters:
  • name - the name of the field (a regexp)

get_method(self, name)

source code 

Return into a list all methods which corresponds to the regexp

Parameters:
  • name - the name of the method (a regexp)

show(self)

source code 

Show the .class format into a human readable format

Overrides: bytecode._Bytecode.show

insert_string(self, value)

source code 

Insert a string into the constant pool list (Constant_Utf8)

Parameters:
  • value - the new string

insert_craft_method(self, name, proto, codes)

source code 

Insert a craft method into the class

Parameters:
  • name - the name of the new method
  • proto - a list which describe the method ( [ ACCESS_FLAGS, RETURN_TYPE, ARGUMENTS ], ie : [ "ACC_PUBLIC", "[B", "[B" ] )
  • codes - a list which represents the code into a human readable format ( [ "aconst_null" ], [ "areturn" ] ] )

insert_direct_method(self, name, ref_method)

source code 

Insert a direct method (MethodInfo Object) into the class

Parameters:
  • name - the name of the new method
  • ref_method - the MethodInfo Object

save(self)

source code 

Return the class (with the modifications) into raw format

Returns: string
Overrides: bytecode._Bytecode.save