-- DWARF definitions. -- Copyright (C) 2006 Tristan Gingold -- -- GHDL is free software; you can redistribute it and/or modify it under -- the terms of the GNU General Public License as published by the Free -- Software Foundation; either version 2, or (at your option) any later -- version. -- -- GHDL is distributed in the hope that it will be useful, but WITHOUT ANY -- WARRANTY; without even the implied warranty of MERCHANTABILITY or -- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- for more details. -- -- You should have received a copy of the GNU General Public License -- along with GCC; see the file COPYING. If not, write to the Free -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. with Interfaces; use Interfaces; package Dwarf is DW_TAG_Array_Type : constant := 16#01#; DW_TAG_Class_Type : constant := 16#02#; DW_TAG_Entry_Point : constant := 16#03#; DW_TAG_Enumeration_Type : constant := 16#04#; DW_TAG_Formal_Parameter : constant := 16#05#; DW_TAG_Imported_Declaration : constant := 16#08#; DW_TAG_Label : constant := 16#0a#; DW_TAG_Lexical_Block : constant := 16#0b#; DW_TAG_Member : constant := 16#0d#; DW_TAG_Pointer_Type : constant := 16#0f#; DW_TAG_Reference_Type : constant := 16#10#; DW_TAG_Compile_Unit : constant := 16#11#; DW_TAG_String_Type : constant := 16#12#; DW_TAG_Structure_Type : constant := 16#13#; DW_TAG_Subroutine_Type : constant := 16#15#; DW_TAG_Typedef : constant := 16#16#; DW_TAG_Union_Type : constant := 16#17#; DW_TAG_Unspecified_Parameters : constant := 16#18#; DW_TAG_Variant : constant := 16#19#; DW_TAG_Common_Block : constant := 16#1a#; DW_TAG_Common_Inclusion : constant := 16#1b#; DW_TAG_Inheritance : constant := 16#1c#; DW_TAG_Inlined_Subroutine : constant := 16#1d#; DW_TAG_Module : constant := 16#1e#; DW_TAG_Ptr_To_Member_Type : constant := 16#1f#; DW_TAG_Set_Type : constant := 16#20#; DW_TAG_Subrange_Type : constant := 16#21#; DW_TAG_With_Stmt : constant := 16#22#; DW_TAG_Access_Declaration : constant := 16#23#; DW_TAG_Base_Type : constant := 16#24#; DW_TAG_Catch_Block : constant := 16#25#; DW_TAG_Const_Type : constant := 16#26#; DW_TAG_Constant : constant := 16#27#; DW_TAG_Enumerator : constant := 16#28#; DW_TAG_File_Type : constant := 16#29#; DW_TAG_Friend : constant := 16#2a#; DW_TAG_Namelist : constant := 16#2b#; DW_TAG_Namelist_Item : constant := 16#2c#; DW_TAG_Packed_Type : constant := 16#2d#; DW_TAG_Subprogram : constant := 16#2e#; DW_TAG_Template_Type_Parameter : constant := 16#2f#; DW_TAG_Template_Value_Parameter : constant := 16#30#; DW_TAG_Thrown_Type : constant := 16#31#; DW_TAG_Try_Block : constant := 16#32#; DW_TAG_Variant_Part : constant := 16#33#; DW_TAG_Variable : constant := 16#34#; DW_TAG_Volatile_Type : constant := 16#35#; DW_TAG_Dwarf_Procedure : constant := 16#36#; DW_TAG_Restrict_Type : constant := 16#37#; DW_TAG_Interface_Type : constant := 16#38#; DW_TAG_Namespace : constant := 16#39#; DW_TAG_Imported_Module : constant := 16#3a#; DW_TAG_Unspecified_Type
# Usage: mitmdump -s "modify_response_body.py mitmproxy bananas"
# (this script works best with --anticache)
from libmproxy.models import decoded
def start(context, argv):
if len(argv) != 3:
raise ValueError('Usage: -s "modify-response-body.py old new"')
# You may want to use Python's argparse for more sophisticated argument
# parsing.
context.old, context.new = argv[1], argv[2]
def response(context, flow):
with decoded(flow.response): # automatically decode gzipped responses.
flow.response.content = flow.response.content.replace(
context.old,
context.new)