copy & paste behavior #3312
chiffreKing
started this conversation in
General
Replies: 2 comments 5 replies
-
First, the ghidra.re website is not run by our team, we don't control the content there. I was able to duplicate what you described, and it comes down to copy / pasting from a html source, that contains 'hidden' unicode characters such as U+200B ZERO WIDTH SPACE character, to a text document. I haven't investigated deeper, but maybe we aren't specifying UTF8 as encoding of the source document when running the script, but I'm not sure that would completely eliminate the problems you would have with the text you got by pasting from there. |
Beta Was this translation helpful? Give feedback.
5 replies
-
Bolo for spies! How easy to do with this... fyi
…On Thu, Aug 5, 2021, 7:17 PM Andrew Strelsky ***@***.***> wrote:
:sigh: Twas just a jest. A meme'ish reference to a quote from westworld.
I agree it would be nice to use that. Maybe now that we're hosting the
binary releases here on github something like this could happen.
I wasn't sure, not a movie guy. Sarcasm is hard on the internet lol.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3312 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQQ3LSQ3KCAOEQXFOY4KX53T3MSZVANCNFSM5BT6N7SQ>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi guys
I'm not quite sure if this belongs here but I found it kind of interesting and I'm sure that many people could get the same problem.
So what I did was creating a python script in the basic editor. Then I wanted to work with operands. Because I'm new to working with Ghidra I searched for the methods that I wanted to use on the official Ghidra page. In this case the one about the instruction class: https://ghidra.re/ghidra_docs/api/ghidra/program/model/listing/Instruction.html#getOperandType(int)
I found the method getOperandType(int opIndex) and I wanted to try it out so I copied pasted the method in my script and tried to print out a the type of a register. The result was an error
File "", line None
SyntaxError: Non-ASCII character in file 'xx\xx\xx.py', but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
After hours of trying to understand and fix this error. I recognized that the error is not due to wrong coding. When I type in the line of code manually without copy/pasting the same line of code it works. I was able to reproduce this behavior. The problem occurs by not only copying this part: getOperandType . It occurs by copying the whole method: getOperandType(int opIndex) . So there must be some non-ascii characters in the methods from the ghidra page.
I know this is not a bug of Ghidra but I think it would be helpful if on the Ghidra page are only ascii characters. At least in the methods people want to work with. I think it is pretty common to just copy and paste the method and later modify it
Beta Was this translation helpful? Give feedback.
All reactions