这是我通过反汇编看到的声明function(1,2,3);
:
movl $0x3,0x8(%esp)
movl $0x2,0x4(%esp)
movl $0x1,(%esp)
call 0x4012d0 <_Z8functioniii>
Run Code Online (Sandbox Code Playgroud)
似乎ret地址根本没有被推入堆栈,那怎么ret
工作呢?
void function(int a, int b, int c) {
char buffer1[5];
char buffer2[10];
int *ret;
ret = buffer1 + 12;
(*ret) += 8;//why is it 8??
}
void main() {
int x;
x = 0;
function(1,2,3);
x = 1;
printf("%d\n",x);
}
Run Code Online (Sandbox Code Playgroud)
上面的演示来自这里:
http://insecure.org/stf/smashstack.html
但它在这里不起作用:
D:\test>gcc -Wall -Wextra hw.cpp && a.exe
hw.cpp: In function `void function(int, int, int)':
hw.cpp:6: warning: unused variable 'buffer2'
hw.cpp: At global scope:
hw.cpp:4: warning: unused parameter 'a'
hw.cpp:4: warning: unused parameter 'b'
hw.cpp:4: warning: unused parameter 'c' …
Run Code Online (Sandbox Code Playgroud) 0x004012d0 <main+0>: push %ebp
0x004012d1 <main+1>: mov %esp,%ebp
0x004012d3 <main+3>: sub $0x28,%esp
Run Code Online (Sandbox Code Playgroud)
如果地址不可用,我们可以自己计算吗?
我的意思是我们只有这个:
push %ebp
mov %esp,%ebp
sub $0x28,%esp
Run Code Online (Sandbox Code Playgroud) 我没有访问权限.
如何使用和不使用更新/插入/删除/选择语句$rs = new com("ADODB.RecordSet");
?
这是代码index.php
,只有<?php
,但不?>
,这是我第一次看到像这样的代码,有什么原因吗?
<?php
// $Id: index.php,v 1.94 2007/12/26 08:46:48 dries Exp $
/**
* @file
* The PHP page that serves all page requests on a Drupal installation.
*
* The routines here dispatch control to the appropriate handler, which then
* prints the appropriate page.
*
* All Drupal code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$return = menu_execute_active_handler();
// Menu status constants …
Run Code Online (Sandbox Code Playgroud) var arr = ['test0','test2','test0'];
Run Code Online (Sandbox Code Playgroud)
与上面一样,有两个相同的条目,其值为"test0",如何最有效地检查它?