I'm trying to compile this code which call func from "libcfmapi.so" to decrypt "cfg" file
int restorebackup(const char *tmp_cfg_name,const char *xml_cfg_name);
int ATP_CFM_ExtCustomImportEncryptedUserCfgFile(const char *tmp_cfg_name);
int main(int argc, char **argv)
if(argc < 3)
printf("specify temp config file name.\n");
int restorebackup(const char *tmp_cfg_name,const char *xml_cfg_name)
//ret = ATP_CFM_ExtDigVerifyFile(tmp_cfg_name,tmp_cfg_name);
if(ret != 0)
printf("Verify File failed.\n");
ret = ATP_CFM_ExtCustomImportEncryptedUserCfgFile(tmp_cfg_name);
root@kali:~/debian-qemu# gcc h.c -o demo
/tmp/ccVbt5NT.o: In function `restorebackup':
h.c:(.text+0x8c): undefined reference to `ATP_CFM_ExtCustomImportEncryptedUserCfgFile'
collect2: error: ld returned 1 exit status
The reason you're getting this error is because you're not linking against the required library,
This is not a library you would expect to find in your Debian system as it is unique to the BT device you're trying to hack.
In short - get the lib from your device, cross compile to the device architecture against the lib you extracted from the device and you should be fine.