From 9b91ac00367bf25679448763cbc02c132bcaf090 Mon Sep 17 00:00:00 2001 From: pfaure Date: Thu, 24 Jun 2021 15:20:33 +0200 Subject: [PATCH] Correctif merge --- Tables/tables.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Tables/tables.c b/Tables/tables.c index 3de4918..af30499 100644 --- a/Tables/tables.c +++ b/Tables/tables.c @@ -193,12 +193,19 @@ void execute() { printf("%d@%d\n", mem[check_adresse(ebp + programme[eip].param1)], ebp + programme[eip].param1); } else if (programme[eip].instruction == CALL) { - pile[check_adresse_pile(esp)] = ebp; - esp++; - pile[check_adresse_pile(esp)] = eip + 1; - esp++; - ebp = ebp + programme[eip].param2; - eip = programme[eip].param1 - 1; + if (SECURISED) { + pile[check_adresse_pile(esp)] = ebp; + esp++; + pile[check_adresse_pile(esp)] = eip + 1; + esp++; + ebp = ebp + programme[eip].param2; + eip = programme[eip].param1 - 1; + } else { + mem[check_adresse(ebp + programme[eip].param2)] = ebp; + mem[check_adresse(ebp + programme[eip].param2 + 1)] = eip + 1; + ebp = ebp + programme[eip].param2 + 2; + eip = programme[eip].param1 - 1; + } } else if (programme[eip].instruction == RET) { if (SECURISED) {