how does changing a byte with
eb eip “VALUE”
work
does it write to memory only ? so that the next time i restart the old
values still exist
or does it change it permanently in file ? (i hope not)
especially when using it in kd on a user mode process ??
i noticed the hard coded int3 being erased earlier but didnt give it a
second though few days ago
today i was again poking with windbg and winmine with kd and i notice if
i do
eb eip 0x55 in kd
it seems to permenantly write back to file
but doing a fc /b on guest shows the file is same
is it a problem of some cache memory ?? or am i seeing ghosts (due to lack
of sleep)
anyway here is the information
C:\Documents and Settings\Administrator\Desktop>dir /b
winmine.bak
winmine.exe
Copy of winmine.exe
C:\Documents and Settings\Administrator\Desktop>fc /b winmine.exe “copy of
winmi
ne.exe”
Comparing files winmine.exe and COPY OF WINMINE.EXE
FC: no differences encountered <-------------------
C:\Documents and Settings\Administrator\Desktop>
C:\PROGRA~1\DEBUGG~1>tlist
676 cmd.exe C:\WINNT\system32\cmd.exe - tlist
720 Copy of winmine Minesweeper
92 winmine.exe Minesweeper
812 tlist.exe
C:\PROGRA~1\DEBUGG~1>
kd> !process 0 0
**** NT ACTIVE PROCESS DUMP ****
<----------------- snip-------------------->
PROCESS ffaf8360 SessionId: 0 Cid: 02a4 Peb: 7ffdf000 ParentCid: 00c8
DirBase: 01b8c000 ObjectTable: ffb29ce8 TableSize: 21.
Image: cmd.exe
PROCESS ffb6d020 SessionId: 0 *Cid: 02d0 === 720* Peb: 7ffdf000
ParentCid: 00c8
DirBase: 024f5000 ObjectTable: ffaea548 TableSize: 22.
Image: Copy of winmine
PROCESS ffadf400 SessionId: 0 *Cid: 005c == 92* Peb: 7ffdf000
ParentCid: 00c8
DirBase: 00b52000 ObjectTable: ffade208 TableSize: 22.
Image: winmine.exe
kd> .process /p /r ffadf400
Implicit process is now ffadf400
.cache forcedecodeuser done
Loading User Symbols
…
kd> u 1003dd0
winmine!WinMainCRTStartup:
01003dd0 55 push ebp <---------------- this should be int3
and it should break every time i double click this file
but that doesnt seem to be the case ( i had earlier use eb eip 0x55 on this
image three four sessions back
and it seems this 0x55 is etched/blocked somewhere in memory or im doing
something thats extermely wrong
the other copy breaks everytime i double click it in guest
i had quit windbg with q making the guest freeze and restarted windbg so
that it starts up new
but it still has the edited byte see below this i have the disassembly of
the copy and it has the hardcoded int3
intact
either fc is bluffing or or my eyes are bluffing or windbg is bluffing hope
some one could help me find the
lier
01003dd1 8bec mov ebp,esp
01003dd3 6aff push 0FFFFFFFFh
01003dd5 68c0130001 push offset winmine!`string’+0x8 (010013c0)
01003dda 68d03f0001 push offset winmine!_except_handler3 (01003fd0)
01003ddf 64a100000000 mov eax,dword ptr fs:[00000000h]
01003de5 50 push eax
01003de6 64892500000000 mov dword ptr fs:[0],esp
kd> .process /p /r ffb6d020
Implicit process is now ffb6d020
.cache forcedecodeuser done
Loading User Symbols
…
kd> u 1003dd0
*** ERROR: Module load completed but symbols could not be loaded for Copy of
winmine.exe
Copy_of_winmine+0x3dd0:
01003dd0 cc int 3 <----------------------
01003dd1 8bec mov ebp,esp
01003dd3 6aff push 0FFFFFFFFh
01003dd5 68c0130001 push offset Copy_of_winmine+0x13c0 (010013c0)
01003dda 68d03f0001 push offset Copy_of_winmine+0x3fd0 (01003fd0)
01003ddf 64a100000000 mov eax,dword ptr fs:[00000000h]
01003de5 50 push eax
01003de6 64892500000000 mov dword ptr fs:[0],esp
regards
raj_r