Find cdh in zip

This commit is contained in:
atxr 2024-02-06 15:16:41 +01:00
parent 0b199784ec
commit 4692b1e643
2 changed files with 35 additions and 2 deletions

View file

@ -0,0 +1,20 @@
#include "libmineziper_zip.h"
#include <string.h>
void find_cdh(raw* raw, zip* out)
{
if (raw->size < START_CDH_SEARCH)
return;
char* se = raw->buf + raw->size - START_CDH_SEARCH;
while (se > raw->buf)
{
if (strcmp(se, CDH_MB) == 0)
{
zip->cdh = se;
break;
}
se--;
}
}