i am tring to get the contents of a html file which is present inside the tar file(i am using visual c++ to accomplish my task). my approach is to store the tar in a buffer
Finally i have made the solution for this question the code must be as follow-
char* StartPosition;
size_t skip= 0;
char HtmlFileContents [200000];
char contents [8000];
do
{
int SizeOfFile = CreateOctalToInteger(&buffer[skip+124],11);
size_t distance= ((SizeOfFile%512) ? SizeOfFile + 512 - (SizeOfFile%512) : SizeOfFile );
skip += distance + 512;
memcpy(contents,&buffer[skip],100);
if (StartPosition=strstr(contents,".html"))
{
MessageBox(m_hwndPreview,L"finally string is copied",L"BTN WND6",MB_ICONINFORMATION);
int SizeOfFile = CreateOctalToInteger(&buffer[skip+124],11);
memcpy(HtmlFileContents,&buffer[skip+512],SizeOfFile);
break;
}
}
while(strcmp(contents,".html") != NULL);
I guess its self explantory . and If not ?? Do not hesitate to ask me.