Ok all i want to know how to do is get data from my network card no matter what it may be, i want it. HOW?
In C there are certain commands that you can use to send data to COM1, LPT1 ect how to i accept data from eth1 and eth2?
Ok all i want to know how to do is get data from my network card no matter what it may be, i want it. HOW?
In C there are certain commands that you can use to send data to COM1, LPT1 ect how to i accept data from eth1 and eth2?
-- Will you show me how to c++?
You need some form of socket library (e.g. Winsock if you're on Win32). There's no standard way to do this, sadly.
Generally, you'll need to create a socket and bind it to the port you want to listen on.
You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.
Is it possible to do through asm? Like, how are the socket libraries implemented in the first place?
You'll have to link to any existing socket libraries; most compilers come with built-in libraries for sockets on the host operating system. If you're on Windows you can just use winsock.h and link to the win32 library, for example.
Frost Drake, I think there should be no need at all to use non-portable super-obfuscated ASM code.
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
My question here: why do you want to do that?Originally Posted by Frost Drake
There isn't going to be a truly platform-independent solution -- the best you can do is some socket library that is implemented on all the major operating systems.
Even if you bypass Winsock, you'd still be tied to Windows because you'd be communicating with the device drivers, and those are platform dependent. In fact the lower down you get the MORE platform dependent your code will become, not less.
You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.
I want to extract and see raw packet info, but to do that im sure i have to find out how to
get information from the source or in this case the network card
-- Will you show me how to c++?
Or just use this perhaps?
http://www.winpcap.org/default.htm
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Here’s why you have to use Winsock or something like it:I want to extract and see raw packet info, but to do that im sure i have to find out how to get information from the source or in this case the network card
- Windows prevents user mode programs from directly reading or writing bytes to hardware. In order to do that, you have to write a kernel mode driver.
- Hardware manufacturers do not publish the details of how to communicate directly with their hardware/firmware. They supply a driver that communicates with their particular hardware and with Windows. So, even if you know how to write drivers, you don’t usually have the inside information that you need.
The driver is like a translator/interpreter. It can translate between the standard Windows/Winsock data and the format/data needed by the proprietary hardware.
The advantage to all of this “extra” complication is that your program will work with any network card in any (Windows) computer. In the old DOS days, each application had it’s own driver… You had to get a printer driver for your spreadsheet and another printer driver for your word processor, etc. It was a real mess. If your application didn’t have a driver for your new printer, you were out of luck. (Well, not totally out of luck because most printers had an Epson emulation mode.)