KUNAI Static Analyzer
Kunai is a library for doing static binary analysis of Dalvik.
Loading...
Searching...
No Matches
external_method.hpp
1//--------------------------------------------------------------------*- C++ -*-
2// Kunai-static-analyzer: library for doing analysis of dalvik files
3// @author Farenain <kunai.static.analysis@gmail.com>
4// @author Ernesto Java <javaernesto@gmail.com>
5//
6// @file external_method.hpp
7// @brief This external method will be created for the analysis in those cases
8// the method is in another dex or is not in the apk.
9
10#ifndef KUNAI_DEX_ANALYSIS_EXTERNAL_METHOD_HPP
11#define KUNAI_DEX_ANALYSIS_EXTERNAL_METHOD_HPP
12
13#include "Kunai/DEX/DVM/dvm_types.hpp"
14
15#include <iostream>
16
17
18namespace KUNAI
19{
20namespace DEX
21{
23 {
25 std::string& class_idx;
26
28 std::string& name_idx;
29
31 std::string& proto_idx;
32
34 mutable std::string pretty_name;
35
37 TYPES::access_flags access_flags = TYPES::access_flags::NONE;
38
39 public:
40 ExternalMethod(std::string& class_idx, std::string& name_idx, std::string& proto_idx)
41 : class_idx(class_idx), name_idx(name_idx), proto_idx(proto_idx)
42 {}
43
46 std::string& get_class_idx() const
47 {
48 return class_idx;
49 }
50
53 std::string& get_name_idx() const
54 {
55 return name_idx;
56 }
57
60 std::string& get_proto_idx() const
61 {
62 return proto_idx;
63 }
64
69 std::string& pretty_method_name() const
70 {
71 if (pretty_name.empty())
72 pretty_name = class_idx+"->"+name_idx+proto_idx;
73 return pretty_name;
74 }
75
78 TYPES::access_flags get_access_flags() const
79 {
80 return access_flags;
81 }
82 };
83} // namespace DEX
84} // namespace KUNAI
85
86
87#endif
Definition external_method.hpp:23
std::string & get_proto_idx() const
Get the prototype of the external method.
Definition external_method.hpp:60
std::string & get_class_idx() const
Return the name of the class where the method is.
Definition external_method.hpp:46
TYPES::access_flags get_access_flags() const
Get the access flags from the method.
Definition external_method.hpp:78
std::string & pretty_method_name() const
Get a pretty printed version of the name that includes class name, name of the method and the prototy...
Definition external_method.hpp:69
std::string & get_name_idx() const
Get the name of the external method.
Definition external_method.hpp:53
utilities
Definition analysis.hpp:23