1818 sendARP = iphlpapi .NewProc ("SendARP" )
1919)
2020
21- // osPing faz ping no Windows
21+ // osPing performs a ping on Windows
2222// ⚡ Bolt Optimization: Use native IcmpSendEcho from iphlpapi.dll instead of spawning ping.exe.
2323// This avoids process-creation overhead on Windows for massive concurrent scans.
2424func osPing (ctx context.Context , ip string , timeoutMs int ) bool {
@@ -87,7 +87,7 @@ func osPing(ctx context.Context, ip string, timeoutMs int) bool {
8787 }
8888}
8989
90- // osGetMAC obtém o MAC usando SendARP no Windows
90+ // osGetMAC obtains the MAC using SendARP on Windows
9191func osGetMAC (ctx context.Context , ip string ) string {
9292 if ctx .Err () != nil {
9393 return ""
@@ -105,11 +105,11 @@ func osGetMAC(ctx context.Context, ip string) string {
105105 go func () {
106106 var mac [6 ]byte
107107 macLen := uint32 (len (mac ))
108- // Segurança : mac é um array de tamanho fixo [6]byte alocado na stack.
109- // macLen é inicializado com len(mac) == 6 antes da chamada .
110- // O acesso via unsafe.Pointer é seguro porque o array não escapa do
111- // escopo e seu tamanho é conhecido em tempo de compilação .
112- // A validação `macLen == 6` após o retorno garante dados não corrompidos .
108+ // Security : mac is a fixed size array [6]byte allocated on the stack.
109+ // macLen is initialized with len(mac) == 6 before the call .
110+ // Access via unsafe.Pointer is safe because the array does not escape the
111+ // scope and its size is known at compile time .
112+ // The validation `macLen == 6` after the return guarantees uncorrupted data .
113113 ret , _ , _ := sendARP .Call (
114114 uintptr (destIPUint32 ),
115115 0 ,
0 commit comments