I am trying to make a program that will take an extracted .nif ( 3d image file ) from a .mpk/.npk file and recompress it back into .npk/.mpk format

I tried making an MPK lib , it fully extracts it with ease but It does not recompress it correctly

I know this is a rather awkward use as its only use is for some clientside editing of games but I was wondering if anyone may already have one, could make one, or knows how i could go about getting one.