To try out Netwire, I'm implementing Pong using the library. In the code I have a ball wire and a computer paddle wire, and since they depend on each other for some values I've been running into issues with infinite loops. Some pseudo-code to explain:
ball :: Wire () IO GameInput Ball
ball = (... define ball ...) . pcPaddle
pcPaddle :: Wire () IO GameInput Paddle
pcPaddle = (... define pcPaddle ...) . ball
The thing to notice is they take each other for inputs. I've tried to alleviate this by doing the following:
ball :: Wire () IO GameInput Ball
ball = ( ... ) . delay ( ... base paddle init ...) . pcPaddle
and other variations of using the delay
function in these two wires, but I'm getting the <<loop>>
runtime error regardless.
How do I initialize one of the wires so that this system can work?
In addition, Netwire can be purchased on the surface internet for a price of 180 USD. Notably, in 2016 Netwire received an update that added the functionality to steal data from devices connected to the infected machine, such as USB credit card readers, allowing Netwire to perform POS attacks.
What is Netwire RAT? Netwire is a remote access trojan-type malware. A RAT is malware used to control an infected machine remotely. This particular RAT can perform over 100 malicious actions on infected machines and can attack multiple systems, including Windows, Apple’s MacOS, and Linux.
As a persistence technique, NetWire creates a home key (HKCU\SOFTWARE\Netwire) as well as adding it into the auto-run group in the victim’s registry. With this approach, it executes every time the infected system starts.
In some malicious campaigns, the Netwire trojan was used to target healthcare and banking businesses. The malware was also documented as being used by a group of scammers from Africa who utilized Netwire to take remote control of infected machines.
Of course 5 minutes later I find the magic combination that seems to work. What I did was I altered the inputs the wires took in to be
ball :: Wire () IO Paddle Ball
ball = ...
paddle :: Wire () IO Ball Paddle
paddle = ...
then when it came to creating my network of wires I did this:
{-# LANGUAGE DoRec #-}
{-# LANGUAGE Arrows #-}
system = proc g -> do
rec b <- delay (... ball initial value ...) . ball -< p
p <- paddle -< b
returnA -< (b,p)
This acknowlegdes their dependency, and gives the paddle the dummy initial value for the ball on it's first pass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With