From 3c31cfe8f5200245e4f440ebae43534a4915860b Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Mon, 9 Jul 2007 22:36:59 +0000 Subject: [PATCH] Fixed amb583 - Heap courruption when calling functions non-virtually with SDKCall --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401092 --- extensions/sdktools/vcallbuilder.cpp | 57 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/extensions/sdktools/vcallbuilder.cpp b/extensions/sdktools/vcallbuilder.cpp index e91f596c..736ec9bb 100644 --- a/extensions/sdktools/vcallbuilder.cpp +++ b/extensions/sdktools/vcallbuilder.cpp @@ -103,6 +103,34 @@ ValveCall *CreateValveCall(void *addr, } } + /* Get parameter info */ + PassInfo paramBuf[32]; + size_t sizes[32]; + size_t normSize = 0; + size_t extraSize = 0; + for (unsigned int i=0; iencflags = 0; thisinfo->offset = 0; - vc->stackSize += sizeof(void *); + normSize += sizeof(void *); cv = CallConv_ThisCall; } - /* Get parameter info */ - PassInfo paramBuf[32]; - size_t sizes[32]; - size_t normSize = 0; - size_t extraSize = 0; - for (unsigned int i=0; icall = g_pBinTools->CreateCall(addr, cv,