winPcap 4.1.3 install manually with Powershell for GNS3-gui (windows)

767 views Asked by At

i try to install manually winPcap with for GNS3-gui on windows :

  1. 7zip to extract winPcap4.1.3.exe

2.try regSrv32.exe the 3x dll (e.g %systemRoot%\sysWow64\packet.dll) but error

  1. create service (npf.sys) (%systemRoot%\system32\drivers) but when i check my sc query npf\Output: win32_exit_code 1275

so my service npf stopped & error when i try to start it

  • it's normal if i have exitCode 1275 when i install winPcap with GUI, i have 0 & all work but i don't want the gui only cli

so, someone can help me please i'm new with create file *.sys so, maybe something i forgot ?

thnk

1

There are 1 answers

2
drp01558 On
<#
 solution Extract winPcap4.1.3 with 7zip installed
 after: put dll 32 bits & 64 bits + npf.sys (64bits)

 demo: https://github.com/pc-aide/Windows/blob/master/PowerShell/ARM/gns3_&_loopback/05-06-2022.ps1
#>

$pth_srcX32 = "d:\winPcap\x32\"
$pth_dllX32 = "C:\Windows\SysWOW64\"
$pth_srcX64 = "d:\winPcap\x64\"
$pth_dllX64 = "C:\Windows\System32\"
$pth_sys = "C:\Windows\System32\drivers\"

copy $pth_srcX64\packet.dll $pth_dllX64\Packet.dll
copy $pth_srcX64\npf.sys $pth_sys\npf.sys
copy $pth_srcX32\wpcap.dll $pth_dllX32\wpcap.dll
copy $pth_srcX32\pthreadVC.dll $pth_dllX32\pthreadVC.dll
copy $pth_srcX32\Packet.dll $pth_dllX32\Packet.dll
if (!(Test-Path "C:\Program Files (x86)\WinPcap")){new-item "C:\Program Files (x86)\" -Name WinPCap -ItemType Directory}
copy $pth_srcX32\rpcapd.exe "C:\Program Files (x86)\WinPCap\rpcapd.exe"

# app & 1st service
sc.exe create rpcapd type= own start= demand binPath= "C:\Program Files (x86)\WinPCap\rpcad.exe" DisplayName= "Remote Package Capture Protocol..."
# driver (*.sys - 2e service)
sc.exe create npf binPath= "system32\drivers\npf.sys" type= kernel start= auto error= normal tag= no DisplayName= "NetGroup Packet Filter Driver"
sc.exe start npf