/* Chrysalide - Outil d'analyse de fichiers binaires * context.c - mise en place d'un contexte de décompilation * * Copyright (C) 2012-2013 Cyrille Bagard * * This file is part of Chrysalide. * * OpenIDA 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 3 of the License, or * (at your option) any later version. * * OpenIDA 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 Foobar. If not, see . */ #ifndef _DECOMP_CONTEXT_INT_H #define _DECOMP_CONTEXT_INT_H #include "context.h" #include "../analysis/routine.h" #include "../glibext/gnhash.h" /* Duplique un contexte de compilation. */ typedef GDecContext * (* dup_dec_context_fc) (GDecContext *); /* Propage un registre alloué et attendu par la suite. */ typedef void (* spread_reg_fc) (GDecContext *, GArchRegister *, GDecInstruction *); /* Convertit un registre machine en un pseudo-registre. */ typedef GDecInstruction * (* convert_register_fc) (GDecContext *, gpointer, bool, vmpa_t); /* Définition d'une context décompilée (instance) */ struct _GDecContext { GObject parent; /* A laisser en premier */ dup_dec_context_fc dup; /* Duplication de contexte */ spread_reg_fc spread; /* Propagation des allocations */ convert_register_fc convert_reg; /* Traduction des registres */ GExeFormat *format; /* Format binaire concerné */ GBinRoutine *routine; /* Routine visée par l'opérat° */ GRAccessList *awaited; /* Allocations attendues */ GHashTable *shared; /* Allocations à propager */ GDecInstruction *list; /* Chaîne décompilée */ }; /* Définition d'une context décompilée (classe) */ struct _GDecContextClass { GObjectClass parent; /* A laisser en premier */ }; /* Duplique partiellement un contexte de compilation. */ void _g_dec_context_dup(GDecContext *, GDecContext *); /* Sauvegarde une conversion de registre si elle est attendue. */ void g_dec_context_notify_reg_alloc(GDecContext *, GArchRegister *, GDecInstruction *, vmpa_t); /* Fournit une conversiond de registre déjà faite et attendue. */ GDecInstruction *g_dec_context_get_awaited_alloc(GDecContext *, GArchRegister *, vmpa_t); #endif /* _DECOMP_CONTEXT_INT_H */