Skip to content

Instantly share code, notes, and snippets.

@frnkst
Created June 19, 2018 11:30
Show Gist options
  • Save frnkst/80ef8aac8b74a4ebdcfabf30abb1b640 to your computer and use it in GitHub Desktop.
Save frnkst/80ef8aac8b74a4ebdcfabf30abb1b640 to your computer and use it in GitHub Desktop.
M3
icmpSocket.on('message', async function (buffer, ip) {
let p = buffer.toString('hex').substr(100, 4);
let portNumber = parseInt(p, 16);
if (port === portNumber) {
try {
let symbolicAddress;
if (!NO_REVERSE_LOOKUP) {
symbolicAddress = await getSymbolicAddress(ip);
}
handleReply(ip, symbolicAddress)[0];
} catch (e) {
handleReply(ip);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment