Monday, 19 December 2011

Getting NLM file version and release date (shell oneliner)

version (x.x.x)
release date (dd.mm.yyyy)
$ od xnfs.nlm -w2 -t x2 -v | awk '{sub(/^[^ ]*/,"",$0); gsub(/[ ]*/," ",$0); printf $3 $4" "$1 $2" "}' | awk '{sub(/^.*56 65 52 73 49 6f 4e 23/,"",$0);sub(/43 6f 50 79 52 69 47 68 54 3d.*$/,"",$0); $0=toupper($0);print "16i "$4 $2 $3 $1" p "$8 $7 $6 $5" p "$12 $11 $10 $9" p "$16 $15 $14 $13" p "$20 $19 $18 $17" p "$24 $23 $22 $21" p"}' | dc | awk '{printf $0" "}' | awk '{print $1"."$2"."$3;print $6"."$5"."$4}'
1.6.0
6.12.2010

Novell Netware loadable module (NLM) file format

A NetWare Loadable Module (NLM) is a binary code module that can be loaded into Novell's NetWare operating system. NLMs can implement hardware drivers, server functions (e.g. clustering), applications (e.g. GroupWise), system libraries or utilities.

Structure of NLM file:
 00   - char[0x18] : 'NetWare Loadable Module' 1a
 18   - long       : 00000004        ; load version
          04  = NW 3.11
          84  = NW 3.12 & above (NLM compression)