Get dll info like file version, product version using golang which should work in both linux and windows


(Selvin Thangadurai) #1
package main

import (
"fmt"
"io/ioutil"
"log"
"bytes"
"os"
)

func main() {
	content, err := ioutil.ReadFile("F:/tesdll/Microsoft.AspNetCore.Authentication.Abstractions.dll")
	if err != nil {
		log.Fatal(err)
	}
}

By reading the dll information i should be to get the dll file version and product version.
which should work seamlessly in windows and linux.

Thanks in advance
Selvin


(Yamil Bracho) #2

You can inspect inside the content where that information is located.
Each DLL have a special information inside called StringFileInfo and then search for tags like ProductVersion and FileVersion


(Selvin Thangadurai) #3

Thanks a lot Yamil_Bracho


(George Calianu) #4

Linux doesn’t use DLLs…


(Yamil Bracho) #5

In this case I meant A library loaded dynamically (as a .so file)


(Selvin Thangadurai) #6

my code will run in linux Machine but reading the dll file…