-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Hello World" in Golang #223
Comments
What are you expecting to see? From the emulation trace, I see that speakeasy emulated until a call to |
Thanks for your fast answer! As I was stuck on my problem, I failed to describe the issue: For any Go binary that I am generating, I get the same output from speakeasy (initially, I was working on a malware obfuscated with garble). And to answer your question: There is no "Hello World" output in the report. To make the problem more observable, I changed the hello.go to the following:
And I launch it with the following code: import speakeasy
se = speakeasy.Speakeasy()
module = se.load_module("/tmp/hello.exe")
se.run_module(module)
open("/tmp/report.json", "w").write(se.get_json_report()) And in the resulting report, there is no call to I am lost :) Disclaimer: I have never used speakeasy before, this may be the source of the problem. |
ah, alright, thanks for clarifying :-) In these sitautions, I usually try to trace the API log alongside the disassembly in IDA and see if I can figure out where the logic went wrong. Sometimes I may add further logging statements to log the instruction pointer and then again walk through the trace in IDA. Given that Go has a non-trivial runtime, I wouldn't be surprised if its detecting something "weird" about speakeasy and not initializing correctly. Of course, this is a bug that we'd want to fix. I might be able to look into this, but I can't guarantee right away (cramming for the Google Summer of Code deadline right now ;-) ). I'd be happy to continue to discuss here and lend a hand. |
#53 would help here but isn't done yet |
if you add Line 39 in 4ca5936
|
hacky script to render the instruction trace into an IDA script that colors the addresses emulated by speakeasy:
here's the script: and example showing some code paths emulated and others not: |
Thanks for the live debugging session, I learned many new things and will apply this knowledge later on. Based on golang/go#56745, winmm.dll is mandatory on Windows, so I added it to the configuration and implemented dummy API calls. This led me to:
Which leads to this exact same problem on qiling: qilingframework/qiling#1202 Nonetheless, I tried to chase the rabbit... And I eventually got to a point where the process ends properly... but the file is not created. Maybe some of the implemented functions shouldn't be that dummy after all 🤔 Here is the current draft of the patch (pure WIP):
To be continued... |
Hello!
I am a total newbie but am I alone failing to emulate even a HelloWorld program written in Golang?
When I run this program using latest speakeasy's version (4ca5936) inside a Docker container, I observe the following result:
Any hint where to investigate please?
hello.exe.zip is attached just in case.
The text was updated successfully, but these errors were encountered: