2

after reading:

How send raw ethernet packet with C#?

I still have questions:

Is it possible to do broadcasts or send your own ethernet frames on layer 2 with C# or C without having winpcap installed or/and without manipulating the installed drivers?

As for Broadcast, I could run a process with the arp -a command and parse its output, maybe it will work.

But still the issue with the ethernet packets.

Community
  • 1
  • 1
Gobliins
  • 3,848
  • 16
  • 67
  • 122

1 Answers1

3

You can't... at least not directly as you are asking.

Windows provides no API to access layer 2 directly. To do this, you would need to write an NDIS protocol driver. If you are interested in taking on this task, start here: http://msdn.microsoft.com/en-us/library/windows/hardware/ff557050(v=vs.85).aspx

For utility-like software, the best thing to do is to bundle one of the drivers listed in that question you linked to.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • hi, thx i read about the NDIS drivers. The problem with them would be they also have to be installed? (or not?) I need a installationless routine – Gobliins Oct 12 '12 at 07:17
  • 1
    @Gobliins, I don't believe that is possible. However, if you have the right permissions, you should be able to install and uninstall the drivers on the fly. There would be a UAC prompt, but that's it. I'm not positive, but I don't believe a reboot would be necessary. – Brad Oct 12 '12 at 14:34
  • hey are you still here? Do you know if it would be possible just to receive and read Ethernet Packets from Windows without the special drivers? – Gobliins Oct 18 '12 at 13:09
  • Well we talked about manipulating (which makes sense because of security issoes), not just read. But from your answer i guess it´s also not possible. – Gobliins Oct 19 '12 at 07:23
  • @Gobliins, My apologies, I misread your follow-up question. Yes, to my knowledge, there is no direct way to receive layer-2 broadcasts without a driver. – Brad Oct 19 '12 at 14:13