Commit 267a4ea5 authored by Him188's avatar Him188

Move main to be easier to access

parent d63e3678
...@@ -30,24 +30,6 @@ import kotlin.concurrent.thread ...@@ -30,24 +30,6 @@ import kotlin.concurrent.thread
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
import kotlin.io.use import kotlin.io.use
fun main() {
/*
check(System.getProperty("os.arch") == "x86") { "Jpcap can only work with x86 JDK" }
JpcapCaptor.getDeviceList().forEach {
println(it)
}
JpcapCaptor.openDevice(JpcapCaptor.getDeviceList()[0], 65535, true, 1000).loopPacket(Int.MAX_VALUE) {
println(it)
}*/
val localIp = Pcaps.findAllDevs()[0].addresses[0].address.hostAddress
println("localIp = $localIp")
Pcaps.findAllDevs().forEach {
listenDevice(localIp, it)
}
println("Ready perfectly")
}
/** /**
* 避免 print 重叠. 单线程处理足够调试 * 避免 print 重叠. 单线程处理足够调试
*/ */
...@@ -95,6 +77,24 @@ private fun listenDevice(localIp: String, device: PcapNetworkInterface) { ...@@ -95,6 +77,24 @@ private fun listenDevice(localIp: String, device: PcapNetworkInterface) {
} }
} }
fun main() {
/*
check(System.getProperty("os.arch") == "x86") { "Jpcap can only work with x86 JDK" }
JpcapCaptor.getDeviceList().forEach {
println(it)
}
JpcapCaptor.openDevice(JpcapCaptor.getDeviceList()[0], 65535, true, 1000).loopPacket(Int.MAX_VALUE) {
println(it)
}*/
val localIp = Pcaps.findAllDevs()[0].addresses[0].address.hostAddress
println("localIp = $localIp")
Pcaps.findAllDevs().forEach {
listenDevice(localIp, it)
}
println("Ready perfectly")
}
/** /**
* 抓包分析器. * 抓包分析器.
* 设置好 [sessionKey], 和 [qq] 后运行即可开始抓包和自动解密 * 设置好 [sessionKey], 和 [qq] 后运行即可开始抓包和自动解密
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment