unpack and repack deb package

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main() {
    char *debFile = "package.deb";
    char *extractDir = "extracted_contents";
    char command[100];

    // Unpack the .deb package
    sprintf(command, "dpkg -x %s %s", debFile, extractDir);
    system(command);

    // Repack the .deb package
    sprintf(command, "dpkg-deb -b %s %s_new.deb", extractDir, debFile);
    system(command);

    return 0;
}