It's bruteforce, it's messy, and it's absolutely retarded. I tried to swallow the C++ information and recreate it in C#.
"LOL OMG MY EYES" - yeah, I know.
Keep in mind: All the following snippets are in no way perfect, but they seem to do their job.
Any ideas / suggestions for improvement? Let me know.
Just wanna flame me for how ugly it is? Please don't hurt my feelings.
If you really want to use these as a basis, then feel free to do so.
Patch&Restore the invalid-pointer-check function: NoMorePasting.com
Register an own lua function (similar to registring an own console function): NoMorePasting.com
A possible way of grabbing the strings: NoMorePasting.com
The 'core': The own lua function: NoMorePasting.com
A possible main-method to try it: NoMorePasting.com
Note that I did include the GetTop(L) but didn't feel like doing another loop (ASM 4tw), so it only copies the object with the index 1.
I really want to learn more than pointer arithmetics in C++ now...
Possible result: http://img178.imageshack.us/img178/1549/dostringopt.jpg
Credits as usual Cypher, jjaa, Shynd
Greetings