redcode-labs / Coldfire

Golang malware development library
MIT License
927 stars 142 forks source link

Fixing undeclared variables, typos, and other stuff related to Linux … #37

Closed zarkones closed 6 months ago

zarkones commented 6 months ago

I upgraded Coldfire dependency recently while upgrading agent in XENA C2 (https://xena.network/). When I was satisfied with merging monolith and modular agent into a single codebase I fired up my testing framework which after performing pre-compilation tests complained that Linux agent for Amd64 failed to be built.

I was under the impression that something was with MY CODE, as I went full ninja and refactored a lot of stuff. However, after two hours of messing around I realized that the code importing Coldfire in a brand new project also won't compile for Linux taget.

Quickly went off to reproduce the issue on another machine, I was right, the same exact error message declared itself in front of me. I forked the repo, and was puzzled...

No tests, no nothing. The breaking changes were caught by the Golang, however, not if you had gopls set to non-Linux OS.

Here are my changes. They should fix it.