I recently heard about the esp trick: some packers push all registers on the stack, and when unpacking is done, they are restored. Placing a hardware breakpoint on esp we can stop there and get the original entry point.
Why is it necessary to use a hardware breakpoint? This site argues that because software breakpoints modify the code. But why is that a problem here?
Every example I met uses Ollydbg. How can I set such a breakpoint in gdb?