Fixed XCode build and cleaned up warnings
This commit is contained in:
Родитель
a1686df528
Коммит
1a9962128d
|
@ -95,7 +95,7 @@ AbstractFile* createAbstractFileFromDummy() {
|
|||
|
||||
size_t memRead(AbstractFile* file, void* data, size_t len) {
|
||||
MemWrapperInfo* info = (MemWrapperInfo*) (file->data);
|
||||
memcpy(data, (void*)((uint64_t)info->buffer + (uint64_t)info->offset), len);
|
||||
memcpy(data, (void*)((uint8_t*)info->buffer + (uint32_t)info->offset), len);
|
||||
info->offset += (size_t)len;
|
||||
return len;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ size_t memWrite(AbstractFile* file, const void* data, size_t len) {
|
|||
info->buffer = realloc(info->buffer, info->bufferSize);
|
||||
}
|
||||
|
||||
memcpy((void*)((uint64_t)info->buffer + (uint64_t)info->offset), data, len);
|
||||
memcpy((void*)((uint8_t*)info->buffer + (uint32_t)info->offset), data, len);
|
||||
info->offset += (size_t)len;
|
||||
return len;
|
||||
}
|
||||
|
|
|
@ -527,7 +527,6 @@ int main(int argc, char* argv[]) {
|
|||
int partNum;
|
||||
AbstractFile* in;
|
||||
AbstractFile* out;
|
||||
int index;
|
||||
int hasKey;
|
||||
|
||||
TestByteOrder();
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <openssl/hmac.h>
|
||||
#include <openssl/aes.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#define CHUNKNO(oft) ((uint32_t)((oft)/FILEVAULT_CHUNK_SIZE))
|
||||
#define CHUNKOFFSET(oft) ((size_t)((oft) - ((off_t)(CHUNKNO(oft)) * (off_t)FILEVAULT_CHUNK_SIZE)))
|
||||
|
@ -69,9 +70,7 @@ static void writeChunk(FileVaultInfo* info) {
|
|||
|
||||
static void cacheChunk(FileVaultInfo* info, uint32_t chunk) {
|
||||
unsigned char buffer[FILEVAULT_CHUNK_SIZE];
|
||||
unsigned char buffer2[FILEVAULT_CHUNK_SIZE];
|
||||
unsigned char msgDigest[FILEVAULT_MSGDGST_LENGTH];
|
||||
unsigned char msgDigest2[FILEVAULT_MSGDGST_LENGTH];
|
||||
uint32_t msgDigestLen;
|
||||
|
||||
if(chunk == info->curChunk) {
|
||||
|
@ -96,7 +95,6 @@ static void cacheChunk(FileVaultInfo* info, uint32_t chunk) {
|
|||
}
|
||||
|
||||
size_t fvRead(AbstractFile* file, void* data, size_t len) {
|
||||
size_t lengthInCurrentChunk;
|
||||
FileVaultInfo* info;
|
||||
size_t toRead;
|
||||
|
||||
|
@ -104,13 +102,13 @@ size_t fvRead(AbstractFile* file, void* data, size_t len) {
|
|||
|
||||
if((CHUNKOFFSET(info->offset) + len) > FILEVAULT_CHUNK_SIZE) {
|
||||
toRead = FILEVAULT_CHUNK_SIZE - CHUNKOFFSET(info->offset);
|
||||
memcpy(data, (void *)((uint64_t)(&(info->chunk)) + (uint64_t)CHUNKOFFSET(info->offset)), toRead);
|
||||
memcpy(data, (void *)((uint8_t*)(&(info->chunk)) + CHUNKOFFSET(info->offset)), toRead);
|
||||
info->offset += toRead;
|
||||
cacheChunk(info, CHUNKNO(info->offset));
|
||||
return toRead + fvRead(file, (void *)((uint64_t)data + (uint64_t)toRead), len - toRead);
|
||||
return toRead + fvRead(file, (void *)((uint8_t*)data + toRead), len - toRead);
|
||||
} else {
|
||||
toRead = len;
|
||||
memcpy(data, (void *)((uint64_t)(&(info->chunk)) + (uint64_t)CHUNKOFFSET(info->offset)), toRead);
|
||||
memcpy(data, (void *)((uint8_t*)(&(info->chunk)) + CHUNKOFFSET(info->offset)), toRead);
|
||||
info->offset += toRead;
|
||||
cacheChunk(info, CHUNKNO(info->offset));
|
||||
return toRead;
|
||||
|
@ -118,7 +116,6 @@ size_t fvRead(AbstractFile* file, void* data, size_t len) {
|
|||
}
|
||||
|
||||
size_t fvWrite(AbstractFile* file, const void* data, size_t len) {
|
||||
size_t lengthInCurrentChunk;
|
||||
FileVaultInfo* info;
|
||||
size_t toRead;
|
||||
int i;
|
||||
|
@ -135,19 +132,19 @@ size_t fvWrite(AbstractFile* file, const void* data, size_t len) {
|
|||
if((CHUNKOFFSET(info->offset) + len) > FILEVAULT_CHUNK_SIZE) {
|
||||
toRead = FILEVAULT_CHUNK_SIZE - CHUNKOFFSET(info->offset);
|
||||
for(i = 0; i < toRead; i++) {
|
||||
ASSERT(*((char*)((uint64_t)(&(info->chunk)) + (uint64_t)CHUNKOFFSET(info->offset) + i)) == ((char*)data)[i], "blah");
|
||||
ASSERT(*((char*)((uint8_t*)(&(info->chunk)) + (uint32_t)CHUNKOFFSET(info->offset) + i)) == ((char*)data)[i], "blah");
|
||||
}
|
||||
memcpy((void *)((uint64_t)(&(info->chunk)) + (uint64_t)CHUNKOFFSET(info->offset)), data, toRead);
|
||||
memcpy((void *)((uint8_t*)(&(info->chunk)) + (uint32_t)CHUNKOFFSET(info->offset)), data, toRead);
|
||||
info->dirty = TRUE;
|
||||
info->offset += toRead;
|
||||
cacheChunk(info, CHUNKNO(info->offset));
|
||||
return toRead + fvWrite(file, (void *)((uint64_t)data + (uint64_t)toRead), len - toRead);
|
||||
return toRead + fvWrite(file, (void *)((uint8_t*)data + toRead), len - toRead);
|
||||
} else {
|
||||
toRead = len;
|
||||
for(i = 0; i < toRead; i++) {
|
||||
ASSERT(*((char*)((uint64_t)(&(info->chunk)) + (uint64_t)CHUNKOFFSET(info->offset) + i)) == ((char*)data)[i], "blah");
|
||||
ASSERT(*((char*)((uint8_t*)(&(info->chunk)) + CHUNKOFFSET(info->offset) + i)) == ((char*)data)[i], "blah");
|
||||
}
|
||||
memcpy((void *)((uint64_t)(&(info->chunk)) + (uint64_t)CHUNKOFFSET(info->offset)), data, toRead);
|
||||
memcpy((void *)((uint8_t*)(&(info->chunk)) + CHUNKOFFSET(info->offset)), data, toRead);
|
||||
info->dirty = TRUE;
|
||||
info->offset += toRead;
|
||||
cacheChunk(info, CHUNKNO(info->offset));
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* Jacob Appelbaum <jacob@appelbaum.net>, and Christian Fromme <kaner@strace.org>
|
||||
*/
|
||||
|
||||
#define FILEVAULT_V2_SIGNATURE 0x656e637263647361
|
||||
#define FILEVAULT_V2_SIGNATURE 0x656e637263647361ULL
|
||||
|
||||
typedef struct FileVaultV1Header {
|
||||
uint8_t padding1[48];
|
||||
|
|
|
@ -216,10 +216,10 @@
|
|||
<key>_historyCapacity</key>
|
||||
<integer>0</integer>
|
||||
<key>bookmark</key>
|
||||
<string>637FAC760DC495B900D1D35F</string>
|
||||
<string>63EFCCEB0DC49BA00031F8B4</string>
|
||||
<key>history</key>
|
||||
<array>
|
||||
<string>63F9228F0DC4952F0056EA77</string>
|
||||
<string>637FAC760DC495B900D1D35F</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>SplitCount</key>
|
||||
|
@ -314,19 +314,20 @@
|
|||
<string>C6A0FF2B0290797F04C91782</string>
|
||||
<string>1AB674ADFE9D54B511CA2CBB</string>
|
||||
<string>1C37FBAC04509CD000000102</string>
|
||||
<string>63EFCCE40DC49B410031F8B4</string>
|
||||
<string>63EFCCE50DC49B410031F8B4</string>
|
||||
<string>63EFCCE60DC49B410031F8B4</string>
|
||||
<string>1C37FABC05509CD000000102</string>
|
||||
</array>
|
||||
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
|
||||
<array>
|
||||
<array>
|
||||
<integer>27</integer>
|
||||
<integer>14</integer>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
<integer>38</integer>
|
||||
<integer>35</integer>
|
||||
</array>
|
||||
</array>
|
||||
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
|
||||
<string>{{0, 305}, {265, 494}}</string>
|
||||
<string>{{0, 0}, {265, 494}}</string>
|
||||
</dict>
|
||||
<key>PBXTopSmartGroupGIDs</key>
|
||||
<array/>
|
||||
|
@ -428,9 +429,9 @@
|
|||
</array>
|
||||
<key>TableOfContents</key>
|
||||
<array>
|
||||
<string>637FAC630DC4957500D1D35F</string>
|
||||
<string>63EFCCBE0DC4974F0031F8B4</string>
|
||||
<string>1CE0B1FE06471DED0097A5F4</string>
|
||||
<string>637FAC640DC4957500D1D35F</string>
|
||||
<string>63EFCCBF0DC4974F0031F8B4</string>
|
||||
<string>1CE0B20306471E060097A5F4</string>
|
||||
<string>1CE0B20506471E060097A5F4</string>
|
||||
</array>
|
||||
|
@ -564,8 +565,8 @@
|
|||
<integer>5</integer>
|
||||
<key>WindowOrderList</key>
|
||||
<array>
|
||||
<string>63F922260DC492000056EA77</string>
|
||||
<string>63F9228D0DC4952F0056EA77</string>
|
||||
<string>63F922260DC492000056EA77</string>
|
||||
<string>/Users/david/libdmg-hfsplus/ide/xcode/libdmg-hfsplus.xcodeproj</string>
|
||||
</array>
|
||||
<key>WindowString</key>
|
||||
|
@ -590,7 +591,7 @@
|
|||
<key>PBXProjectModuleGUID</key>
|
||||
<string>1CD0528F0623707200166675</string>
|
||||
<key>PBXProjectModuleLabel</key>
|
||||
<string><No Editor></string>
|
||||
<string>filevault.c</string>
|
||||
<key>StatusBarVisibility</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
@ -607,6 +608,8 @@
|
|||
<string>215pt</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BecomeActive</key>
|
||||
<true/>
|
||||
<key>ContentConfiguration</key>
|
||||
<dict>
|
||||
<key>PBXProjectModuleGUID</key>
|
||||
|
@ -646,7 +649,7 @@
|
|||
<key>TableOfContents</key>
|
||||
<array>
|
||||
<string>63F922260DC492000056EA77</string>
|
||||
<string>637FAC5F0DC4955C00D1D35F</string>
|
||||
<string>63EFCCC10DC4974F0031F8B4</string>
|
||||
<string>1CD0528F0623707200166675</string>
|
||||
<string>XCMainBuildResultsModuleGUID</string>
|
||||
</array>
|
||||
|
@ -657,7 +660,7 @@
|
|||
<key>WindowToolGUID</key>
|
||||
<string>63F922260DC492000056EA77</string>
|
||||
<key>WindowToolIsVisible</key>
|
||||
<false/>
|
||||
<true/>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Identifier</key>
|
||||
|
|
|
@ -71,12 +71,12 @@
|
|||
PBXFileDataSource_Warnings_ColumnID,
|
||||
);
|
||||
};
|
||||
PBXPerProjectTemplateStateSaveDate = 230987083;
|
||||
PBXWorkspaceStateSaveDate = 230987083;
|
||||
PBXPerProjectTemplateStateSaveDate = 230987379;
|
||||
PBXWorkspaceStateSaveDate = 230987379;
|
||||
};
|
||||
perUserProjectItems = {
|
||||
637FAC760DC495B900D1D35F /* PBXTextBookmark */ = 637FAC760DC495B900D1D35F /* PBXTextBookmark */;
|
||||
63F9228F0DC4952F0056EA77 /* PBXTextBookmark */ = 63F9228F0DC4952F0056EA77 /* PBXTextBookmark */;
|
||||
63EFCCEB0DC49BA00031F8B4 /* PBXTextBookmark */ = 63EFCCEB0DC49BA00031F8B4 /* PBXTextBookmark */;
|
||||
};
|
||||
sourceControlManager = 63F91F960DC48F810056EA77 /* Source Control */;
|
||||
userBuildSettings = {
|
||||
|
@ -95,6 +95,16 @@
|
|||
vrLen = 1270;
|
||||
vrLoc = 7655;
|
||||
};
|
||||
63EFCCEB0DC49BA00031F8B4 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 63F920D20DC48FFC0056EA77 /* zconf.h */;
|
||||
name = "zconf.h: 293";
|
||||
rLen = 0;
|
||||
rLoc = 8494;
|
||||
rType = 0;
|
||||
vrLen = 1277;
|
||||
vrLoc = 7655;
|
||||
};
|
||||
63F91F960DC48F810056EA77 /* Source Control */ = {
|
||||
isa = PBXSourceControlManager;
|
||||
fallbackIsa = XCSourceControlManager;
|
||||
|
@ -108,23 +118,39 @@
|
|||
};
|
||||
63F920C60DC48FFC0056EA77 /* abstractfile.c */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {987, 2966}}";
|
||||
sepNavSelRange = "{2222, 79}";
|
||||
sepNavVisRange = "{2051, 295}";
|
||||
sepNavIntBoundsRect = "{{0, 0}, {987, 2814}}";
|
||||
sepNavSelRange = "{3865, 0}";
|
||||
sepNavVisRange = "{3746, 310}";
|
||||
};
|
||||
};
|
||||
63F920C90DC48FFC0056EA77 /* dmg.c */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {987, 8414}}";
|
||||
sepNavSelRange = "{15995, 12}";
|
||||
sepNavVisRange = "{15821, 201}";
|
||||
sepNavIntBoundsRect = "{{0, 0}, {987, 8400}}";
|
||||
sepNavSelRange = "{15975, 0}";
|
||||
sepNavVisRange = "{15886, 160}";
|
||||
};
|
||||
};
|
||||
63F920CB0DC48FFC0056EA77 /* filevault.c */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {987, 3626}}";
|
||||
sepNavSelRange = "{195, 0}";
|
||||
sepNavVisRange = "{938, 475}";
|
||||
sepNavWindowFrame = "{{15, 164}, {1150, 833}}";
|
||||
};
|
||||
};
|
||||
63F920CC0DC48FFC0056EA77 /* filevault.h */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1091, 1316}}";
|
||||
sepNavSelRange = "{617, 0}";
|
||||
sepNavVisRange = "{0, 1267}";
|
||||
sepNavWindowFrame = "{{38, 143}, {1150, 833}}";
|
||||
};
|
||||
};
|
||||
63F920D20DC48FFC0056EA77 /* zconf.h */ = {
|
||||
uiCtxt = {
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1091, 4648}}";
|
||||
sepNavIntBoundsRect = "{{0, 0}, {1091, 4872}}";
|
||||
sepNavSelRange = "{8494, 0}";
|
||||
sepNavVisRange = "{7655, 1270}";
|
||||
sepNavVisRange = "{7655, 1277}";
|
||||
sepNavWindowFrame = "{{15, 164}, {1150, 833}}";
|
||||
};
|
||||
};
|
||||
|
@ -189,14 +215,4 @@
|
|||
sourceDirectories = (
|
||||
);
|
||||
};
|
||||
63F9228F0DC4952F0056EA77 /* PBXTextBookmark */ = {
|
||||
isa = PBXTextBookmark;
|
||||
fRef = 63F920D20DC48FFC0056EA77 /* zconf.h */;
|
||||
name = "zconf.h: 293";
|
||||
rLen = 0;
|
||||
rLoc = 8494;
|
||||
rType = 0;
|
||||
vrLen = 1270;
|
||||
vrLoc = 7655;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -68,14 +68,14 @@
|
|||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 63F9226D0DC493710056EA77 /* hfsplus */;
|
||||
remoteGlobalIDString = 63F9226D0DC493710056EA77;
|
||||
remoteInfo = hfsplus;
|
||||
};
|
||||
637FAC6E0DC4959700D1D35F /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 63F921E20DC4909A0056EA77 /* dmg */;
|
||||
remoteGlobalIDString = 63F921E20DC4909A0056EA77;
|
||||
remoteInfo = dmg;
|
||||
};
|
||||
63F9222F0DC4923A0056EA77 /* PBXContainerItemProxy */ = {
|
||||
|
@ -503,6 +503,8 @@
|
|||
"$(inherited)",
|
||||
"\"$(SRCROOT)/build/Release\"",
|
||||
);
|
||||
OTHER_CFLAGS = "-DHAVE_CRYPT";
|
||||
OTHER_LDFLAGS = "-lcrypto";
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = dmg;
|
||||
ZERO_LINK = YES;
|
||||
|
@ -521,6 +523,8 @@
|
|||
"$(inherited)",
|
||||
"\"$(SRCROOT)/build/Release\"",
|
||||
);
|
||||
OTHER_CFLAGS = "-DHAVE_CRYPT";
|
||||
OTHER_LDFLAGS = "-lcrypto";
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = dmg;
|
||||
ZERO_LINK = NO;
|
||||
|
|
Загрузка…
Ссылка в новой задаче