diff --git a/20140921.html b/20140921.html new file mode 100644 index 0000000..b1bb286 --- /dev/null +++ b/20140921.html @@ -0,0 +1,26 @@ +
+

20140921 - Using GDB Without Source and With Runtime Changing of Code

+
+ +Getting disassembly of code generated at runtime to verify dynamic code generation can be a slow process. +On Linux, I just use gdb. +Using gdb requires setting the breakpoint for run-time generated code +after that code is generated by the application +(if there is an easier way, I don't know it). +Here is a quick example,
+
+ +Find the entry point of the ELF: readelf -a filename
+Look for "Entry point address:" and write down address
+Start gdb: gdb filename
+Insert breakpoint, this example using 0x2c3 as entry point: break *0x2c3
+Start program which will break at above entry point: run
+Show disassembly with raw bytes example: disassemble /r 0x2c3,0x300
+The "=>" shows the instruction pointer
+Set another breakpoint to something after run-time generated code
+Use the "continue" command to continue to that breakpoint
+Show disassembly of the run-time generated code

+ +
+ + diff --git a/index.html b/index.html index bd2d269..24a094a 100644 --- a/index.html +++ b/index.html @@ -146,6 +146,7 @@ O OOO ||..||OO||||||||||OOo || ||||||||||||| ||||OO|| |o| ||||||||OO||OOO 20141010 - The Source of the Strange "Win7" Color Distortion?

20140926 - Post Depth Coverage
+20140921 - Using GDB Without Source and With Runtime Changing of Code

20140826 - Scifi Reading Suggestion List From Twitters
20140823 - MinWM