Move main to be easier to access

This commit is contained in:
Him188 2019-11-27 19:58:23 +08:00
parent d63e3678f5
commit 267a4ea556

View File

@ -30,24 +30,6 @@ import kotlin.concurrent.thread
import kotlin.coroutines.CoroutineContext
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 重叠. 单线程处理足够调试
*/
@ -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] 后运行即可开始抓包和自动解密