-2
我在調試二進制文件(vortex8)。該程序使用pthread_create()函數運行兩個線程。彙編代碼如下。我不知道爲什麼代碼在gdb中以這種方式流動
(gdb) 0xbffffa01 in ??()
(gdb) x/i 0xbffff9fd
0xbffff9fd: nop
0xbffff9fe: jmp 0xbffffa0d
0xbffffa00: pop ebx
0xbffffa01: add ebx,0xb
0xbffffa04: mov eax,0x804a010 // address of [email protected]
0xbffffa09: mov DWORD PTR [eax],ebx // [email protected] change
0xbffffa0b: jmp 0xbffffa12
0xbffffa0d: call 0xbffffa00
...
0xbffffa1b: xor eax,eax
0xbffffa1d: push eax
0xbffffa1e: push 0x68732f2f
0xbffffa23: push 0x6e69622f
0xbffffa28: mov ebx,esp
0xbffffa2a: push eax
0xbffffa2b: push ebx
0xbffffa2c: mov ecx,esp
0xbffffa2e: mov al,0xb
0xbffffa30: xor edx,edx
0xbffffa32: int 0x80
(gdb) b * safecode + 40
(gdb) ni
[Switching to Thread 0xb7df8b40 (LWP 17523)]
Breakpoint 5, 0x08048685 in safecode()
=> 0x8048685 <safecode+40>: call 0x80484d0 <[email protected]>
0x804868a <safecode+45>: mov DWORD PTR [esp],0x1
0x8048691 <safecode+52>: call 0x80484e0 <[email protected]>
0x8048696 <safecode+57>: jmp 0x804866a <safecode+13>
0x8048698 <unsafecode> : push ebp
(gdb) si
0x80484d0 <[email protected]>: jmp DWORD PTR ds:0x804a010
(gdb) ni
0xbffffa1b : xor eax, eax
0xbffffa1d: push eax
0xbffffa1e: push 0x68732f2f
0xbffffa23: push 0x6e69622f
0xbffffa28: loopne 0xbffff9ae
我不知道爲什麼線程在第一個'ni'中改變。 在第一個'ni'中,fflush @ got沒有改變,因爲在執行'0xbffffa09'之前發生了線程改變。但是,更改線程後,fflush @ got已更改,因此fflush @ got的值爲0xbffffa1b,我想更改它。此外,0xbffffa1b之後的代碼被更改。爲什麼?
我發現在'[切換到線程0xb7df8b40(LWP 17523)]'之前,EFLAGS將0x202更改爲0x286。這是什麼意思?和爲什麼EFLAGS改變。我只是保持'你'。 –