LTCD_070816.ISO
This commit is contained in:
1 parent
d14bbc24f9
commit
0e9364ff4c
506 files changed
+157705
-41812
No files matched your search
@@ -0,0 +1,196 @@
|
||||
#include "stdafx.h"
|
||||
#include "LTZ.h"
|
||||
|
||||
int bit_test(int bit_num, BYTE *bit_field)
|
||||
{
|
||||
__asm {
|
||||
xor eax,eax
|
||||
mov esi,bit_field
|
||||
mov ebx,bit_num
|
||||
bt [esi],ebx
|
||||
adc eax,0
|
||||
}
|
||||
}
|
||||
|
||||
int bit_test_and_set(int bit_num, BYTE *bit_field)
|
||||
{
|
||||
__asm {
|
||||
xor eax,eax
|
||||
mov esi,bit_field
|
||||
mov ebx,bit_num
|
||||
bts [esi],ebx
|
||||
adc eax,0
|
||||
}
|
||||
}
|
||||
|
||||
DWORD ExtractWordBitField(BYTE *src,DWORD pos,DWORD bits)
|
||||
{
|
||||
DWORD i,result=0;
|
||||
for (i=0;i<bits;i++)
|
||||
if (bit_test(pos+i,src))
|
||||
bit_test_and_set(i,(BYTE *)&result);
|
||||
return result;
|
||||
}
|
||||
|
||||
void ArcGetTableEntry(ArcCs *c)
|
||||
{
|
||||
DWORD i;
|
||||
ArcTableEntry *temp,*temp1;
|
||||
|
||||
if (c->entry_used) {
|
||||
i=c->free_index;
|
||||
|
||||
c->entry_used=FALSE;
|
||||
c->cur_entry=c->next_entry;
|
||||
c->cur_bits_in_use=c->next_bits_in_use;
|
||||
if (c->next_bits_in_use<ARC_MAX_BITS) {
|
||||
c->next_entry = &c->compress[i++];
|
||||
if (i==c->free_limit) {
|
||||
c->next_bits_in_use++;
|
||||
c->free_limit=1<<c->next_bits_in_use;
|
||||
}
|
||||
} else {
|
||||
do if (++i==c->free_limit) i=c->min_table_entry;
|
||||
while (c->hash[i]);
|
||||
temp=&c->compress[i];
|
||||
c->next_entry=temp;
|
||||
temp1=(ArcTableEntry *)&c->hash[temp->basecode];
|
||||
while (temp1 && temp1->next!=temp)
|
||||
temp1=temp1->next;
|
||||
if (temp1)
|
||||
temp1->next=temp->next;
|
||||
}
|
||||
c->free_index=i;
|
||||
}
|
||||
}
|
||||
|
||||
void ArcExpandBuf(ArcCs *c)
|
||||
{
|
||||
BYTE *dst_ptr,*dst_limit;
|
||||
DWORD basecode,lastcode,code;
|
||||
ArcTableEntry *temp,*temp1;
|
||||
|
||||
dst_ptr=c->dst_buf+c->dst_pos;
|
||||
dst_limit=c->dst_buf+c->dst_size;
|
||||
|
||||
while (dst_ptr<dst_limit &&
|
||||
c->stack_ptr!=c->stack_base)
|
||||
*dst_ptr++ = * -- c->stack_ptr;
|
||||
|
||||
if (c->stack_ptr==c->stack_base && dst_ptr<dst_limit) {
|
||||
if (c->saved_basecode==0xFFFFFFFF) {
|
||||
lastcode=ExtractWordBitField(c->src_buf,c->src_pos,
|
||||
c->next_bits_in_use);
|
||||
c->src_pos=c->src_pos+c->next_bits_in_use;
|
||||
*dst_ptr++=lastcode;
|
||||
ArcGetTableEntry(c);
|
||||
c->last_ch=lastcode;
|
||||
} else
|
||||
lastcode=c->saved_basecode;
|
||||
while (dst_ptr<dst_limit &&
|
||||
c->src_pos+c->next_bits_in_use<=c->src_size) {
|
||||
basecode=ExtractWordBitField(c->src_buf,c->src_pos,
|
||||
c->next_bits_in_use);
|
||||
c->src_pos=c->src_pos+c->next_bits_in_use;
|
||||
if (c->cur_entry==&c->compress[basecode]) {
|
||||
*c->stack_ptr++=c->last_ch;
|
||||
code=lastcode;
|
||||
} else
|
||||
code=basecode;
|
||||
while (code>=c->min_table_entry) {
|
||||
*c->stack_ptr++=c->compress[code].ch;
|
||||
code=c->compress[code].basecode;
|
||||
}
|
||||
*c->stack_ptr++=code;
|
||||
c->last_ch=code;
|
||||
|
||||
c->entry_used=TRUE;
|
||||
temp=c->cur_entry;
|
||||
temp->basecode=lastcode;
|
||||
temp->ch=c->last_ch;
|
||||
temp1=(ArcTableEntry *)&c->hash[lastcode];
|
||||
temp->next=temp1->next;
|
||||
temp1->next=temp;
|
||||
|
||||
ArcGetTableEntry(c);
|
||||
while (dst_ptr<dst_limit && c->stack_ptr!=c->stack_base)
|
||||
*dst_ptr++ = * -- c->stack_ptr;
|
||||
lastcode=basecode;
|
||||
}
|
||||
c->saved_basecode=lastcode;
|
||||
}
|
||||
c->dst_pos=dst_ptr-c->dst_buf;
|
||||
}
|
||||
|
||||
ArcCs *NewArcCs(DWORD expand,DWORD text_only)
|
||||
{
|
||||
ArcCs *c;
|
||||
c=(ArcCs *)malloc(sizeof(ArcCs));
|
||||
memset(c,0,sizeof(ArcCs));
|
||||
if (expand) {
|
||||
c->stack_base=(BYTE *)malloc(ARC_MAX_TABLE_ENTRY+1);
|
||||
c->stack_ptr=c->stack_base;
|
||||
}
|
||||
if (text_only)
|
||||
c->min_bits=7;
|
||||
else
|
||||
c->min_bits=8;
|
||||
c->min_table_entry=1<<c->min_bits;
|
||||
c->free_index=c->min_table_entry;
|
||||
c->next_bits_in_use=c->min_bits+1;
|
||||
c->free_limit=1<<c->next_bits_in_use;
|
||||
c->saved_basecode=0xFFFFFFFF;
|
||||
c->entry_used=TRUE;
|
||||
ArcGetTableEntry(c);
|
||||
c->entry_used=TRUE;
|
||||
return c;
|
||||
}
|
||||
|
||||
void DelArcCs(ArcCs *c)
|
||||
{
|
||||
free(c->stack_base);
|
||||
free(c);
|
||||
}
|
||||
|
||||
int ArcDetermineCompressionType(BYTE *src,DWORD size)
|
||||
{
|
||||
DWORD i,j=0;
|
||||
for (i=0;i<size;i++)
|
||||
j=j|src[i];
|
||||
if (j & 0x80)
|
||||
return CT_8_BIT;
|
||||
else
|
||||
return CT_7_BIT;
|
||||
}
|
||||
|
||||
|
||||
BYTE *ExpandBuf(ArcCompressStruct *r)
|
||||
{
|
||||
ArcCs *c;
|
||||
ArcCompressStruct *r2=r;
|
||||
BYTE *result;
|
||||
DWORD text_only;
|
||||
result=(BYTE *)malloc(r2->expanded_size+1);
|
||||
result[r2->expanded_size]=0; //terminate
|
||||
|
||||
text_only=(r2->compression_type==CT_7_BIT);
|
||||
if (r2->compression_type==CT_NONE) {
|
||||
memcpy(result,r2->body,r2->expanded_size);
|
||||
goto expand_end;
|
||||
}
|
||||
c=NewArcCs(TRUE,text_only);
|
||||
c->src_size=r2->compressed_size*8;
|
||||
c->src_pos=(sizeof(ArcCompressStruct)-1)*8;
|
||||
c->src_buf=(BYTE *)r2;
|
||||
c->dst_size=r2->expanded_size;
|
||||
c->dst_buf=result;
|
||||
c->dst_pos=0;
|
||||
ArcExpandBuf(c);
|
||||
DelArcCs(c);
|
||||
|
||||
expand_end:
|
||||
if (r2!=r)
|
||||
free(r2);
|
||||
return result;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
||||
; CLW file contains information for the MFC ClassWizard
|
||||
|
||||
[General Info]
|
||||
Version=1
|
||||
LastClass=
|
||||
LastTemplate=CDialog
|
||||
NewFileInclude1=#include "stdafx.h"
|
||||
NewFileInclude2=#include "LTZ.h"
|
||||
LastPage=0
|
||||
|
||||
ClassCount=0
|
||||
|
||||
ResourceCount=0
|
||||
|
||||
@@ -0,0 +1,335 @@
|
||||
// LTZ.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "LTZ.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only application object
|
||||
|
||||
CWinApp theApp;
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define F_ASCII 1
|
||||
#define F_MAKE 2
|
||||
#define F_EXTRACT 4
|
||||
#define F_COMPRESS 8
|
||||
#define F_EXPAND 16
|
||||
|
||||
DWORD ltz_flags,pfile_blks,cur_signature=0x78123456;
|
||||
char cur_dir[MAX_PATH],cur_pfile[MAX_PATH];
|
||||
|
||||
class tree_node
|
||||
{
|
||||
public:
|
||||
tree_node *next_sibling,*first_child,*parent;
|
||||
TCHAR name[MAX_PATH];
|
||||
|
||||
tree_node(tree_node *_parent);
|
||||
~tree_node();
|
||||
CString path();
|
||||
CString full_name();
|
||||
};
|
||||
typedef tree_node *tree_node_ptr;
|
||||
|
||||
tree_node::tree_node(tree_node *_parent)
|
||||
{
|
||||
parent=_parent;
|
||||
next_sibling=NULL;
|
||||
first_child=NULL;
|
||||
*name=0; //So path() works for root
|
||||
}
|
||||
|
||||
tree_node::~tree_node()
|
||||
{
|
||||
delete first_child;
|
||||
delete next_sibling;
|
||||
}
|
||||
|
||||
CString tree_node::path()
|
||||
{
|
||||
CString result;
|
||||
if (parent) {
|
||||
result=parent->path();
|
||||
if (result.Right(1)==CString(_T("\\")))
|
||||
result+=parent->name;
|
||||
else
|
||||
result+=CString(_T("\\"))+parent->name;
|
||||
}
|
||||
else
|
||||
result=cur_dir;
|
||||
return result;
|
||||
}
|
||||
|
||||
CString tree_node::full_name()
|
||||
{
|
||||
CString result=path();
|
||||
if (result.Right(1)!=CString(_T("\\")))
|
||||
result+=_T("\\");
|
||||
result+=name;
|
||||
return result;
|
||||
}
|
||||
|
||||
void convert(CString nname,double in_size)
|
||||
{
|
||||
DWORD out_size,i;
|
||||
ArcCompressStruct *in_buf;
|
||||
BYTE *out_buf;
|
||||
FILE *io_file;
|
||||
char name[512];
|
||||
strcpy(name,nname.GetBuffer(512));
|
||||
nname.ReleaseBuffer();
|
||||
in_buf=(ArcCompressStruct *)malloc(in_size);
|
||||
io_file=fopen(name,"rb");
|
||||
fread(in_buf,1,in_size,io_file);
|
||||
out_size=in_buf->expanded_size;
|
||||
printf("%-45s %d-->%d\r\n",name,(DWORD) in_size,out_size);
|
||||
fclose(io_file);
|
||||
out_buf=ExpandBuf(in_buf);
|
||||
if (out_buf) {
|
||||
if (ltz_flags & F_ASCII) {
|
||||
for (i=0;i<out_size;i++)
|
||||
if (out_buf[i]==5 ||out_buf[i]==31) out_buf[i]=32;
|
||||
}
|
||||
name[strlen(name)-1]='z';
|
||||
io_file=fopen(name,"wb");
|
||||
fwrite(out_buf,1,out_size,io_file);
|
||||
fclose(io_file);
|
||||
free(out_buf);
|
||||
}
|
||||
free(in_buf);
|
||||
}
|
||||
|
||||
double AddFolder(LPCTSTR path,tree_node *parent)
|
||||
{
|
||||
CString str,str2;
|
||||
HANDLE file_search;
|
||||
WIN32_FIND_DATA find_data;
|
||||
tree_node *tempt,**back_link;
|
||||
double total=0.0;
|
||||
|
||||
back_link=&(parent->first_child);
|
||||
|
||||
str=path;
|
||||
if (str.Right(1)==CString(_T("\\")))
|
||||
str+=_T("*.*");
|
||||
else
|
||||
str+=_T("\\*.*");
|
||||
|
||||
if ((file_search=FindFirstFile(str,&find_data))
|
||||
!=INVALID_HANDLE_VALUE)
|
||||
{
|
||||
do {
|
||||
if (strcmp(find_data.cFileName,_T(".")) &&
|
||||
strcmp(find_data.cFileName,_T("..")) ) {
|
||||
tempt=new tree_node(parent);
|
||||
strcpy(tempt->name,find_data.cFileName);
|
||||
*back_link=tempt;
|
||||
back_link=&(tempt->next_sibling);
|
||||
if (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
str=path;
|
||||
if (str.Right(1)!=CString(_T("\\")))
|
||||
str+=_T("\\");
|
||||
str+=find_data.cFileName;
|
||||
total+=AddFolder(str,tempt);
|
||||
} else {
|
||||
total+=find_data.nFileSizeLow+
|
||||
((double)0xFFFFFFFF+1)*find_data.nFileSizeHigh;
|
||||
if (find_data.cFileName[strlen(find_data.cFileName)-1]=='Z') {
|
||||
str2=path;
|
||||
if (str2.Right(1)!=CString(_T("\\")))
|
||||
str2+=_T("\\");
|
||||
str2+=find_data.cFileName;
|
||||
convert(str2,find_data.nFileSizeLow+
|
||||
((double)0xFFFFFFFF+1)*find_data.nFileSizeHigh);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (FindNextFile(file_search,&find_data));
|
||||
FindClose(file_search);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
void SetBlk(FILE *f,DWORD blk)
|
||||
{
|
||||
fseek(f,blk*512,SEEK_SET);
|
||||
}
|
||||
|
||||
void SetCluster(FILE *f,DWORD cluster_lo,LTBootStruct *b)
|
||||
{
|
||||
SetBlk(f,(cluster_lo-1)*b->sectors_per_cluster+1+b->bitmap_sectors);
|
||||
}
|
||||
|
||||
|
||||
void ExtractFile(CString str,FILE *in_file,LTDirEntry *d,LTBootStruct *b)
|
||||
{
|
||||
FILE *out_file;
|
||||
BYTE *buf=(BYTE *)malloc(d->size_lo);
|
||||
SetCluster(in_file,d->cluster_lo,b);
|
||||
fread(buf,d->size_lo,1,in_file);
|
||||
out_file=fopen((const char *)str,"wb");
|
||||
fwrite(buf,d->size_lo,1,out_file);
|
||||
fclose(out_file);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
void ExtractDir(CString str,FILE *in_file,DWORD lo,DWORD size,LTBootStruct *b)
|
||||
{
|
||||
LTDirEntry *d=(LTDirEntry *)malloc(size);
|
||||
DWORD i;
|
||||
CString str2;
|
||||
char sysbuf[MAX_PATH];
|
||||
|
||||
sprintf(sysbuf,"MD %s",(const char *)str);
|
||||
system(sysbuf);
|
||||
if (str.Right(1)!=CString(_T("\\")))
|
||||
str+=_T("\\");
|
||||
SetCluster(in_file,lo,b);
|
||||
fread(d,size,1,in_file);
|
||||
for (i=2;i<size/sizeof(LTDirEntry);i++) {
|
||||
if (*d[i].name) {
|
||||
if (!(d[i].attr & LT_ATTR_DELETED)) {
|
||||
str2=str;
|
||||
str2+=d[i].name;
|
||||
printf("%s\r\n",(const char *)str2);
|
||||
if (d[i].attr & LT_ATTR_DIR)
|
||||
ExtractDir(str2,in_file,d[i].cluster_lo,d[i].size_lo,b);
|
||||
else
|
||||
ExtractFile(str2,in_file,&d[i],b);
|
||||
}
|
||||
} else
|
||||
break;
|
||||
}
|
||||
free(d);
|
||||
}
|
||||
|
||||
void ExtractFiles()
|
||||
{
|
||||
LTBootStruct b;
|
||||
LTDirEntry d[8];
|
||||
FILE *in_file=fopen(cur_pfile,"rb");
|
||||
if (!in_file) return;
|
||||
fread(&b,512,1,in_file);
|
||||
SetCluster(in_file,b.root_cluster_lo,&b);
|
||||
fread(&d,512,1,in_file);
|
||||
ExtractDir(cur_dir,in_file,b.root_cluster_lo,d[0].size_lo,&b);
|
||||
fclose(in_file);
|
||||
}
|
||||
|
||||
void MakePFile()
|
||||
{
|
||||
BYTE buf[512];
|
||||
DWORD i,*d;
|
||||
FILE *out_file=fopen(cur_pfile,"wb");
|
||||
if (!out_file) return;
|
||||
for (i=0;i<512;i++)
|
||||
buf[i]=i;
|
||||
for (i=0;i<pfile_blks;i++) {
|
||||
d=(DWORD *)&buf;
|
||||
*d=i;
|
||||
d=(DWORD *)&buf[4];
|
||||
*d=0;
|
||||
d=(DWORD *)&buf[8];
|
||||
*d=pfile_blks;
|
||||
d=(DWORD *)&buf[12];
|
||||
*d=0;
|
||||
d=(DWORD *)&buf[512-4];
|
||||
*d=cur_signature;
|
||||
fwrite(buf,512,1,out_file);
|
||||
}
|
||||
fclose(out_file);
|
||||
}
|
||||
|
||||
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
|
||||
{
|
||||
char *st;
|
||||
DWORD i;
|
||||
BOOL valid;
|
||||
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)) {
|
||||
cerr << _T("Fatal Error: MFC initialization failed") << endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ltz_flags=0;
|
||||
valid=TRUE;
|
||||
cur_dir[0]=0;
|
||||
cur_pfile[0]=0;
|
||||
for (i=1;i<argc;i++) {
|
||||
st=argv[i];
|
||||
if (!strcmp(st,"-ascii"))
|
||||
ltz_flags|=F_ASCII;
|
||||
else if (!strcmp(st,"-make"))
|
||||
ltz_flags|=F_MAKE;
|
||||
else if (!strcmp(st,"-extract"))
|
||||
ltz_flags|=F_EXTRACT;
|
||||
else if (!strcmp(st,"-compress"))
|
||||
ltz_flags|=F_COMPRESS;
|
||||
else if (!strcmp(st,"-expand"))
|
||||
ltz_flags|=F_EXPAND;
|
||||
else if (*st=='-') {
|
||||
valid=FALSE;
|
||||
break;
|
||||
} else if (!cur_dir[0])
|
||||
strcpy(cur_dir,st);
|
||||
else if (!cur_pfile[0])
|
||||
strcpy(cur_pfile,st);
|
||||
else
|
||||
cur_signature=atoi(st);
|
||||
}
|
||||
if (ltz_flags & F_MAKE) {
|
||||
if (!cur_pfile[0])
|
||||
valid=FALSE;
|
||||
if (ltz_flags & ~F_MAKE)
|
||||
valid=FALSE;
|
||||
} else if (ltz_flags & F_EXTRACT) {
|
||||
if (!cur_pfile[0])
|
||||
valid=FALSE;
|
||||
if (ltz_flags & ~F_EXTRACT)
|
||||
valid=FALSE;
|
||||
} else if (ltz_flags & F_COMPRESS) {
|
||||
valid=FALSE; //todo
|
||||
if (!cur_pfile[0])
|
||||
valid=FALSE;
|
||||
if (ltz_flags & ~F_COMPRESS)
|
||||
valid=FALSE;
|
||||
} else if (ltz_flags & F_EXPAND) {
|
||||
if (!cur_dir[0] || cur_pfile[0])
|
||||
valid=FALSE;
|
||||
if (ltz_flags & ~(F_EXPAND|F_ASCII))
|
||||
valid=FALSE;
|
||||
} else
|
||||
valid=FALSE;
|
||||
|
||||
if (!valid) {
|
||||
printf("LTZ -make blkcnt partitionfile signature\r\n");
|
||||
printf("LTZ -extract dirname partitionfile\r\n");
|
||||
//todo printf("LTZ -compress dirname partitionfile");
|
||||
printf("LTZ -expand [-ascii] dirname\r\n");
|
||||
printf("\r\n\r\n dirname\tWindows directory.\r\n");
|
||||
printf(" partitionfile\tfile used to go between Windows and LoseThos.\r\n");
|
||||
printf(" signature\tenter a unique numeric value which LoseThos can find.\r\n");
|
||||
printf(" -ascii\twill convert cursor position and shifted spaces to spaces.\r\n");
|
||||
} else {
|
||||
if (ltz_flags & F_MAKE) {
|
||||
pfile_blks=atoi(cur_dir);
|
||||
if (pfile_blks<0x100000/512)
|
||||
printf("Minimum of 1 Meg\r\n");
|
||||
else
|
||||
MakePFile();
|
||||
} else if (ltz_flags & F_EXTRACT)
|
||||
ExtractFiles();
|
||||
else if (ltz_flags & F_EXPAND) {
|
||||
tree_node tree_root(NULL);
|
||||
AddFolder(cur_dir,&tree_root);
|
||||
}
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
# Microsoft Developer Studio Project File - Name="LTZ" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=LTZ - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "LTZ.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "LTZ.mak" CFG="LTZ - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "LTZ - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "LTZ - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "LTZ - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 2
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 2
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "LTZ - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 2
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 2
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "\bin"
|
||||
# PROP Intermediate_Dir "\temp\obj\ltz"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "LTZ - Win32 Release"
|
||||
# Name "LTZ - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\COMPRESS.CPP
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LTZ.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LTZ.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"stdafx.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LTZ.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ReadMe.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "LTZ"=.\LTZ.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
|
||||
#if !defined(AFX_LTZ_H__39F34DAB_4E37_49BB_BC15_8A70703A405C__INCLUDED_)
|
||||
#define AFX_LTZ_H__39F34DAB_4E37_49BB_BC15_8A70703A405C__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
#define LT_XSUM 0xA5CF3796
|
||||
|
||||
#define ARC_MAX_BITS 12
|
||||
#define ARC_MAX_TABLE_ENTRY ((1<<ARC_MAX_BITS)-1)
|
||||
|
||||
#define CT_NONE 0
|
||||
#define CT_7_BIT 1
|
||||
#define CT_8_BIT 2
|
||||
|
||||
class ArcTableEntry
|
||||
{ public:
|
||||
ArcTableEntry *next;
|
||||
WORD basecode;
|
||||
BYTE ch,pad;
|
||||
};
|
||||
|
||||
class ArcCs //control structure
|
||||
{ public:
|
||||
DWORD src_size;
|
||||
DWORD src_pos;
|
||||
BYTE *src_buf;
|
||||
DWORD dst_size;
|
||||
DWORD dst_pos;
|
||||
BYTE *dst_buf;
|
||||
DWORD min_bits;
|
||||
DWORD min_table_entry;
|
||||
ArcTableEntry *cur_entry;
|
||||
DWORD cur_bits_in_use;
|
||||
ArcTableEntry *next_entry;
|
||||
DWORD next_bits_in_use;
|
||||
BYTE *stack_ptr;
|
||||
BYTE *stack_base;
|
||||
DWORD free_index;
|
||||
DWORD free_limit;
|
||||
DWORD saved_basecode;
|
||||
DWORD entry_used;
|
||||
BYTE last_ch,pad1,pad2,pad3;
|
||||
ArcTableEntry compress[ARC_MAX_TABLE_ENTRY+1];
|
||||
ArcTableEntry *hash[ARC_MAX_TABLE_ENTRY+1];
|
||||
};
|
||||
|
||||
class ArcCompressStruct
|
||||
{ public:
|
||||
DWORD compressed_size,compressed_size_hi,
|
||||
expanded_size,expanded_size_hi;
|
||||
WORD compression_type,flags;
|
||||
BYTE body[1];
|
||||
};
|
||||
|
||||
extern BYTE *ExpandBuf(ArcCompressStruct *r);
|
||||
|
||||
class LTBootStruct
|
||||
{ public:
|
||||
BYTE jump_and_nop[3];
|
||||
BYTE signature; //PT_LT=0x88
|
||||
WORD U1s_per_sector;
|
||||
WORD sectors_per_cluster;
|
||||
DWORD sectors_lo,sectors_hi;
|
||||
DWORD root_cluster_lo,root_cluster_hi;
|
||||
DWORD bitmap_sectors;
|
||||
DWORD unique_id;
|
||||
BYTE code[478];
|
||||
WORD signature2; //0xAA55
|
||||
};
|
||||
|
||||
#define LT_ATTR_DIR 0x10
|
||||
#define LT_ATTR_ARCHIVE 0x20
|
||||
#define LT_ATTR_DELETED 0x100
|
||||
#define LT_ATTR_ENCRYPTED 0x200 // not implemented
|
||||
#define LT_ATTR_RESIDENT 0x400
|
||||
#define LT_ATTR_COMPRESSED 0x800
|
||||
#define LT_ATTR_CONTIGUOUS 0x1000
|
||||
#define LT_ATTR_FIXED 0x2000
|
||||
|
||||
#define LT_MAX_FILENAME_LEN 25
|
||||
class LTDirEntry
|
||||
{ public:
|
||||
WORD attr;
|
||||
char name[LT_MAX_FILENAME_LEN+1];
|
||||
DWORD xsum;
|
||||
DWORD cluster_lo,cluster_hi;
|
||||
DWORD size_lo,size_hi;
|
||||
DWORD expanded_size_lo,expanded_size_hi;
|
||||
DWORD time,date;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // !defined(AFX_LTZ_H__39F34DAB_4E37_49BB_BC15_8A70703A405C__INCLUDED_)
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: LTZ - Win32 Debug--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP24.tmp" with contents
|
||||
[
|
||||
/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_AFXDLL" /Fp"\temp\obj\ltz/LTZ.pch" /Yu"stdafx.h" /Fo"\temp\obj\ltz/" /Fd"\temp\obj\ltz/" /FD /GZ /c
|
||||
"C:\LTZ\LTZ.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP24.tmp"
|
||||
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP25.tmp" with contents
|
||||
[
|
||||
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"\bin/LTZ.pdb" /debug /machine:I386 /out:"\bin/LTZ.exe" /pdbtype:sept
|
||||
\temp\obj\ltz\COMPRESS.OBJ
|
||||
\temp\obj\ltz\LTZ.obj
|
||||
\temp\obj\ltz\StdAfx.obj
|
||||
\temp\obj\ltz\LTZ.res
|
||||
]
|
||||
Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP25.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
LTZ.cpp
|
||||
Linking...
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
LTZ.exe - 0 error(s), 0 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,70 @@
|
||||
//Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_HELLO "Hello from MFC!"
|
||||
END
|
||||
|
||||
#endif
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
@@ -0,0 +1,16 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by LTZ.rc
|
||||
//
|
||||
#define IDS_HELLO 1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// LTZ.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
||||
@@ -0,0 +1,30 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__AA426D36_E3D9_4CBF_9EE3_7DB9F2945CE6__INCLUDED_)
|
||||
#define AFX_STDAFX_H__AA426D36_E3D9_4CBF_9EE3_7DB9F2945CE6__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afx.h>
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__AA426D36_E3D9_4CBF_9EE3_7DB9F2945CE6__INCLUDED_)
|
||||
Reference in new issue
Block a user