Class: Idb::AppBinaryGroupBox

Inherits:
Qt::GroupBox
  • Object
show all
Defined in:
lib/gui/app_details_group_box.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ AppBinaryGroupBox

Returns a new instance of AppBinaryGroupBox.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/gui/app_details_group_box.rb', line 115

def initialize args
  super *args

  # details on selected app
  @layout = Qt::GridLayout.new
  setLayout(@layout)
  setTitle "App Binary"


  # analyze binary
  @analyze_binary_button = Qt::PushButton.new "Analyze Binary..."
  @analyze_binary_button.setEnabled(false)
  @analyze_binary_button.connect(SIGNAL(:released)) { |x|
    #TODO progress bar
    $selected_app.analyze
    @vals['encryption_enabled'].setText($selected_app.binary.is_encrypted?.to_s)
    @vals['cryptid'].setText($selected_app.binary.get_cryptid.to_s)
    @vals['pie'].setText($selected_app.binary.is_pie?.to_s)
    @vals['canaries'].setText($selected_app.binary.is_stack_protected?.to_s)
    @vals['arc'].setText($selected_app.binary.uses_arc?.to_s)
    emit binary_analyzed()
  }
  @layout.addWidget @analyze_binary_button, 0, 0, 1, 2

  @labels = Hash.new
  @vals = Hash.new
  @cur_row = 1

  addDetail 'encryption_enabled', 'Encryption?'
  addDetail 'cryptid', 'Cryptid'
  addDetail 'pie', 'PIE'
  addDetail 'canaries', 'Stack Canaries'
  addDetail 'arc', 'ARC'

  clear

end

Instance Method Details

#addDetail(id, label) ⇒ Object



154
155
156
157
158
159
160
# File 'lib/gui/app_details_group_box.rb', line 154

def addDetail id, label
  @labels[id] = Qt::Label.new  "<b>#{label}</b>", self, 0
  @vals[id] = Qt::Label.new  "", self, 0
  @layout.addWidget @labels[id], @cur_row, 0
  @layout.addWidget @vals[id], @cur_row, 1
  @cur_row += 1
end

#app_changedObject



162
163
164
165
# File 'lib/gui/app_details_group_box.rb', line 162

def app_changed
  clear
  @analyze_binary_button.setEnabled(true)
end

#clearObject



167
168
169
170
171
172
173
# File 'lib/gui/app_details_group_box.rb', line 167

def clear
  @vals['encryption_enabled'].setText("[Binary not yet analyzed]")
  @vals['cryptid'].setText("[Binary not yet analyzed]")
  @vals['pie'].setText("[Binary not yet analyzed]")
  @vals['canaries'].setText("[Binary not yet analyzed]")
  @vals['arc'].setText("[Binary not yet analyzed]")
end

#disable_analyze_binaryObject



175
176
177
# File 'lib/gui/app_details_group_box.rb', line 175

def disable_analyze_binary
  @analyze_binary_button.setEnabled(false)
end