What you are wanting to do has come up a few times over the years.
It is deceptively difficult.
If you look at the thread referenced by groundFungus, there is lots of ignorance as to how the hd44780 interface works.
This includes all the way at the end in post #55 that talks about a pulse on E or looking at rising edge of E.
That isn't how E works.
Data sent to the LCD is latched on the falling of E and both the data and control signals are only guaranteed to be valid at that point in time and 10 nanoseconds beyond that point in time.
In order to do what you want, you have to look at all the LCD signals and interpret them in real time just like the LCD does.
This means you have to interpret the signals to process all commands and data writes just like the LCD does to create a shadow of the LCD display memory.
Then you can read that shadow memory to see what was written to the display.
This is what makes doing what you want to do complicated.
The hd44780 interface and its timing requirements is very well defined but how the host uses it prior to E falling can vary substantially.
i.e. how the host sets up the signals prior to dropping the E signal and the timing of how those signals and data lines are setup can vary substantially between hosts that control the LCD.
Look at figure 26 of the hitachi hd44780 datasheet.
The variation is ok and allowed.
These are the critical things (timing assumes 4.5v to 5v operation)
- the LCD control signals be setup and stable before raising E for tAS (40ns)
- the LCD data signals are setup and stable before dropping E for tDSW (80ns)
- the LCD data and control signals must remain stable after dropping E for tH (10ns)
- minimum time E can be high PWEH (230ns)
- minimum cycle E from E high to E high again tcycE (500ns)
Note that these times are minimums not maximums.
The actual timing can vary substantially from host implementations.
One big issue when trying to sniff and process these signals in realtime is that the minimum times are way shorter than an arduino could monitor. So depending on the host implementation,
the signals may not be stable long enough or change so quickly that an arduino may not be able to process them fast enough.
It all depends on the host and how it controls the LCD signals.
Before venturing down this path, I'd recommend hooking up a logic analyzer and having a look at the signals.
This will provide lots of information. You will then know how the signals are set up and the timing and will be able to determine if an arduino could monitor the signals.
Once you can monitor the signals, you can then implement the software to interpret the commands and data write operations necessary to be able to create a shadow memory of the LCD display.