Closed 10110111 closed 9 years ago
Here's a test case:
commit b542a0ddf4ce8c2628d32a4e9d7d83cec5980924
Author: Ruslan Kabatsayev <b7.10110111@gmail.com>
Date: Sat Aug 8 14:56:24 2015 +0300
Test
diff --git a/src/xml/functions.xml b/src/xml/functions.xml
index 6645cf2..d1e32cb 100644
--- a/src/xml/functions.xml
+++ b/src/xml/functions.xml
@@ -462,4 +462,14 @@ P4FILE = "FILE *"
<argument type="PFvvE" name="rtld_fini" />
<argument type="Pv" name="stack_end" />
</function>
+ <function type="i" name="myTestFunction">
+ <argument type="i" name="arg0" />
+ <argument type="i" name="arg1" />
+ <argument type="i" name="arg2" />
+ <argument type="i" name="arg3" />
+ <argument type="i" name="arg4" />
+ <argument type="i" name="arg5" />
+ <argument type="i" name="arg6" />
+ <argument type="i" name="arg7" />
+ </function>
</functions>
diff --git a/test.c b/test.c
new file mode 100644
index 0000000..2a306ba
--- /dev/null
+++ b/test.c
@@ -0,0 +1,9 @@
+int myTestFunction(int x1,int x2, int x3, int x4, int x5, int x6, int x7, int x8)
+{
+ return 0;
+}
+
+int main()
+{
+ myTestFunction(1,2,3,4,5,6,7,8);
+}
With this test program and function description EDB correctly prints on x86:
myTestFunction(1,2,3,4,5,6,7,8)
but incorrectly on x86_64:
myTestFunction(1,2,3,4,5,6,8,0)
which misses the argument 7
, which is the first of stack arguments.
Fixed in the latest master
In x86_64/ArchProcessor.cpp:resolve_function_parameters() there's a hard coded expression
(i - 5) * sizeof(edb::reg_t)
. This is off by one, it should instead read(i - 6) * sizeof(edb::reg_t)
.