def _generate_list_adv_example(self, x0):
     x_init = create_int_list_from_x_adv(
         x0, self.classifier.get_embedding_value(),
         self.classifier.get_is_shifting_values())
     x_init, index_to_perturb_pe = shift_pe_header_by(
         x_init, preferable_extension_amount=self.pe_header_extension)
     return x_init, index_to_perturb_pe
Beispiel #2
0
	def _craft_perturbed_c_array(self, x0):
		x_init = create_int_list_from_x_adv(x0, self.invalid_value, False)
		x_init, index_to_perturb_sections = shift_section_by(x_init,
															 preferable_extension_amount=self.preferable_extension_amount)
		x_init, index_to_perturb_pe = shift_pe_header_by(x_init, preferable_extension_amount=self.pe_header_extension)
		indexes_to_perturb = index_to_perturb_pe + [i + len(index_to_perturb_pe) for i in
													index_to_perturb_sections]
		return x_init, indexes_to_perturb