summaryrefslogtreecommitdiffstats
path: root/heimdall
diff options
context:
space:
mode:
Diffstat (limited to 'heimdall')
-rw-r--r--heimdall/source/BridgeManager.cpp6
-rw-r--r--heimdall/source/BridgeManager.h2
-rw-r--r--heimdall/source/EndFileTransferPacket.h14
-rw-r--r--heimdall/source/EndModemFileTransferPacket.h4
-rw-r--r--heimdall/source/EndPhoneFileTransferPacket.h4
-rw-r--r--heimdall/source/Interface.cpp9
-rw-r--r--heimdall/source/main.cpp22
7 files changed, 28 insertions, 33 deletions
diff --git a/heimdall/source/BridgeManager.cpp b/heimdall/source/BridgeManager.cpp
index b58ffe9..439e41a 100644
--- a/heimdall/source/BridgeManager.cpp
+++ b/heimdall/source/BridgeManager.cpp
@@ -921,7 +921,7 @@ int BridgeManager::ReceivePitFile(unsigned char **pitBuffer) const
return (fileSize);
}
-bool BridgeManager::SendFile(FILE *file, unsigned int destination, unsigned int partitionType, unsigned int fileIdentifier) const
+bool BridgeManager::SendFile(FILE *file, unsigned int destination, unsigned int chipIdentifier, unsigned int fileIdentifier) const
{
if (destination != EndFileTransferPacket::kDestinationModem && destination != EndFileTransferPacket::kDestinationPhone)
{
@@ -1123,7 +1123,7 @@ bool BridgeManager::SendFile(FILE *file, unsigned int destination, unsigned int
if (destination == EndFileTransferPacket::kDestinationPhone)
{
- EndPhoneFileTransferPacket *endPhoneFileTransferPacket = new EndPhoneFileTransferPacket(sequenceByteCount, 0, partitionType,
+ EndPhoneFileTransferPacket *endPhoneFileTransferPacket = new EndPhoneFileTransferPacket(sequenceByteCount, 0, chipIdentifier,
fileIdentifier, isLastSequence);
success = SendPacket(endPhoneFileTransferPacket, 3000);
@@ -1138,7 +1138,7 @@ bool BridgeManager::SendFile(FILE *file, unsigned int destination, unsigned int
}
else // destination == EndFileTransferPacket::kDestinationModem
{
- EndModemFileTransferPacket *endModemFileTransferPacket = new EndModemFileTransferPacket(sequenceByteCount, 0, partitionType, isLastSequence);
+ EndModemFileTransferPacket *endModemFileTransferPacket = new EndModemFileTransferPacket(sequenceByteCount, 0, chipIdentifier, isLastSequence);
success = SendPacket(endModemFileTransferPacket, 3000);
delete endModemFileTransferPacket;
diff --git a/heimdall/source/BridgeManager.h b/heimdall/source/BridgeManager.h
index a1586c8..5dc7496 100644
--- a/heimdall/source/BridgeManager.h
+++ b/heimdall/source/BridgeManager.h
@@ -121,7 +121,7 @@ namespace Heimdall
bool SendPitFile(FILE *file) const;
int ReceivePitFile(unsigned char **pitBuffer) const;
- bool SendFile(FILE *file, unsigned int destination, unsigned int partitionType, unsigned int fileIdentifier = 0xFFFFFFFF) const;
+ bool SendFile(FILE *file, unsigned int destination, unsigned int chipIdentifier, unsigned int fileIdentifier = 0xFFFFFFFF) const;
bool ReceiveDump(unsigned int chipType, unsigned int chipId, FILE *file) const;
bool IsVerbose(void) const
diff --git a/heimdall/source/EndFileTransferPacket.h b/heimdall/source/EndFileTransferPacket.h
index 32eee60..23c2591 100644
--- a/heimdall/source/EndFileTransferPacket.h
+++ b/heimdall/source/EndFileTransferPacket.h
@@ -45,20 +45,20 @@ namespace Heimdall
private:
- unsigned int destination; // Chip identifier perhaps
+ unsigned int destination; // PDA / Modem
unsigned int sequenceByteCount;
unsigned int unknown1;
- unsigned int partitionType;
+ unsigned int chipIdentifier;
protected:
- EndFileTransferPacket(unsigned int destination, unsigned int sequenceByteCount, unsigned int unknown1, unsigned int partitionType)
+ EndFileTransferPacket(unsigned int destination, unsigned int sequenceByteCount, unsigned int unknown1, unsigned int chipIdentifier)
: FileTransferPacket(FileTransferPacket::kRequestEnd)
{
this->destination = destination;
this->sequenceByteCount = sequenceByteCount;
this->unknown1 = unknown1;
- this->partitionType = partitionType;
+ this->chipIdentifier = chipIdentifier;
}
public:
@@ -78,9 +78,9 @@ namespace Heimdall
return (unknown1);
}
- unsigned int GetPartitionType(void) const
+ unsigned int GetChipIdentifier(void) const
{
- return (partitionType);
+ return (chipIdentifier);
}
virtual void Pack(void)
@@ -90,7 +90,7 @@ namespace Heimdall
PackInteger(FileTransferPacket::kDataSize, destination);
PackInteger(FileTransferPacket::kDataSize + 4, sequenceByteCount);
PackInteger(FileTransferPacket::kDataSize + 8, unknown1);
- PackInteger(FileTransferPacket::kDataSize + 12, partitionType);
+ PackInteger(FileTransferPacket::kDataSize + 12, chipIdentifier);
}
};
}
diff --git a/heimdall/source/EndModemFileTransferPacket.h b/heimdall/source/EndModemFileTransferPacket.h
index e21ad20..39a2c25 100644
--- a/heimdall/source/EndModemFileTransferPacket.h
+++ b/heimdall/source/EndModemFileTransferPacket.h
@@ -34,8 +34,8 @@ namespace Heimdall
public:
- EndModemFileTransferPacket(unsigned int sequenceByteCount, unsigned int unknown1, unsigned int partitionType, bool endOfFile)
- : EndFileTransferPacket(EndFileTransferPacket::kDestinationModem, sequenceByteCount, unknown1, partitionType)
+ EndModemFileTransferPacket(unsigned int sequenceByteCount, unsigned int unknown1, unsigned int chipIdentifier, bool endOfFile)
+ : EndFileTransferPacket(EndFileTransferPacket::kDestinationModem, sequenceByteCount, unknown1, chipIdentifier)
{
this->endOfFile = (endOfFile) ? 1 : 0;
}
diff --git a/heimdall/source/EndPhoneFileTransferPacket.h b/heimdall/source/EndPhoneFileTransferPacket.h
index 606bcd0..711892d 100644
--- a/heimdall/source/EndPhoneFileTransferPacket.h
+++ b/heimdall/source/EndPhoneFileTransferPacket.h
@@ -57,9 +57,9 @@ namespace Heimdall
public:
- EndPhoneFileTransferPacket(unsigned int sequenceByteCount, unsigned int unknown1, unsigned int partitionType,
+ EndPhoneFileTransferPacket(unsigned int sequenceByteCount, unsigned int unknown1, unsigned int chipIdentifier,
unsigned int fileIdentifier, bool endOfFile)
- : EndFileTransferPacket(EndFileTransferPacket::kDestinationPhone, sequenceByteCount, unknown1, partitionType)
+ : EndFileTransferPacket(EndFileTransferPacket::kDestinationPhone, sequenceByteCount, unknown1, chipIdentifier)
{
this->fileIdentifier = fileIdentifier;
this->endOfFile = (endOfFile) ? 1 : 0;
diff --git a/heimdall/source/Interface.cpp b/heimdall/source/Interface.cpp
index 55aa392..28db003 100644
--- a/heimdall/source/Interface.cpp
+++ b/heimdall/source/Interface.cpp
@@ -444,14 +444,9 @@ void Interface::PrintPit(const PitData *pitData)
Interface::Print("\n\n--- Entry #%d ---\n", i);
Interface::Print("Unused: %s\n", (entry->GetUnused()) ? "Yes" : "No");
- const char *partitionTypeText = "Unknown";
+ const char *chipIdentifierText = "Unknown";
- if (entry->GetPartitionType() == PitEntry::kPartitionTypeRfs)
- partitionTypeText = "RFS";
- else if (entry->GetPartitionType() == PitEntry::kPartitionTypeExt4)
- partitionTypeText = "EXT4";
-
- Interface::Print("Partition Type: %d (%s)\n", entry->GetPartitionType(), partitionTypeText);
+ Interface::Print("Chip Identifier: %d (%s)\n", entry->GetChipIdentifier());
Interface::Print("Partition Identifier: %d\n", entry->GetPartitionIdentifier());
diff --git a/heimdall/source/main.cpp b/heimdall/source/main.cpp
index bd4403b..b698e77 100644
--- a/heimdall/source/main.cpp
+++ b/heimdall/source/main.cpp
@@ -71,13 +71,13 @@ vector<const char *> knownPartitionNames[kKnownPartitionCount];
struct PartitionInfo
{
- unsigned int partitionType;
+ unsigned int chipIdentifier;
string partitionName;
FILE *file;
- PartitionInfo(unsigned int partitionType, const char *partitionName, FILE *file)
+ PartitionInfo(unsigned int chipIdentifier, const char *partitionName, FILE *file)
{
- this->partitionType = partitionType;
+ this->chipIdentifier = chipIdentifier;
this->partitionName = partitionName;
this->file = file;
}
@@ -218,7 +218,7 @@ bool mapFilesToPartitions(const map<string, FILE *>& argumentFileMap, const PitD
if (!pitEntry && knownPartition == kKnownPartitionPit)
{
- // NOTE: We're assuming a PIT file always has partitionType zero.
+ // NOTE: We're assuming a PIT file always has chipIdentifier zero.
PartitionInfo partitionInfo(0, knownPartitionNames[kKnownPartitionPit][0], it->second);
partitionInfoMap.insert(pair<unsigned int, PartitionInfo>(0xFFFFFFFF, partitionInfo));
@@ -232,7 +232,7 @@ bool mapFilesToPartitions(const map<string, FILE *>& argumentFileMap, const PitD
return (false);
}
- PartitionInfo partitionInfo(pitEntry->GetPartitionType(), pitEntry->GetPartitionName(), it->second);
+ PartitionInfo partitionInfo(pitEntry->GetChipIdentifier(), pitEntry->GetPartitionName(), it->second);
partitionInfoMap.insert(pair<unsigned int, PartitionInfo>(pitEntry->GetPartitionIdentifier(), partitionInfo));
}
@@ -264,7 +264,7 @@ int downloadPitFile(BridgeManager *bridgeManager, unsigned char **pitBuffer)
return (devicePitFileSize);
}
-bool flashFile(BridgeManager *bridgeManager, unsigned int partitionType, unsigned int partitionIndex, const char *partitionName, FILE *file)
+bool flashFile(BridgeManager *bridgeManager, unsigned int chipIdentifier, unsigned int partitionIndex, const char *partitionName, FILE *file)
{
// PIT files need to be handled differently, try determine if the partition we're flashing to is a PIT partition.
bool isPit = false;
@@ -313,7 +313,7 @@ bool flashFile(BridgeManager *bridgeManager, unsigned int partitionType, unsigne
//if (bridgeManager->SendFile(file, EndPhoneFileTransferPacket::kDestinationPhone, // <-- Kies method. WARNING: Doesn't work on Galaxy Tab!
// EndPhoneFileTransferPacket::kFileModem))
- if (bridgeManager->SendFile(file, EndModemFileTransferPacket::kDestinationModem, partitionType)) // <-- Odin method
+ if (bridgeManager->SendFile(file, EndModemFileTransferPacket::kDestinationModem, chipIdentifier)) // <-- Odin method
{
Interface::Print("%s upload successful\n", partitionName);
return (true);
@@ -329,7 +329,7 @@ bool flashFile(BridgeManager *bridgeManager, unsigned int partitionType, unsigne
// We're uploading to a phone partition
Interface::Print("Uploading %s\n", partitionName);
- if (bridgeManager->SendFile(file, EndPhoneFileTransferPacket::kDestinationPhone, partitionType, partitionIndex))
+ if (bridgeManager->SendFile(file, EndPhoneFileTransferPacket::kDestinationPhone, chipIdentifier, partitionIndex))
{
Interface::Print("%s upload successful\n", partitionName);
return (true);
@@ -474,7 +474,7 @@ bool attemptFlash(BridgeManager *bridgeManager, map<string, FILE *> argumentFile
{
PartitionInfo *partitionInfo = &(it->second);
- if (!flashFile(bridgeManager, partitionInfo->partitionType, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
+ if (!flashFile(bridgeManager, partitionInfo->chipIdentifier, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
return (false);
break;
@@ -489,7 +489,7 @@ bool attemptFlash(BridgeManager *bridgeManager, map<string, FILE *> argumentFile
{
PartitionInfo *partitionInfo = &(it->second);
- if (!flashFile(bridgeManager, partitionInfo->partitionType, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
+ if (!flashFile(bridgeManager, partitionInfo->chipIdentifier, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
return (false);
}
}
@@ -501,7 +501,7 @@ bool attemptFlash(BridgeManager *bridgeManager, map<string, FILE *> argumentFile
{
PartitionInfo *partitionInfo = &(it->second);
- if (!flashFile(bridgeManager, partitionInfo->partitionType, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
+ if (!flashFile(bridgeManager, partitionInfo->chipIdentifier, it->first, partitionInfo->partitionName.c_str(), partitionInfo->file))
return (false);
}
}