Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netwire mutually dependant wires

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?

like image 857
chanko08 Avatar asked Aug 30 '13 02:08

chanko08


People also ask

How much does netwire cost?

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 and how does it work?

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.

What is the persistence technique of netwire?

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.

What is the netwire Trojan?

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.


1 Answers

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.

like image 145
chanko08 Avatar answered Nov 15 '22 04:11

chanko08