Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ue4/io/IoStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ export class FIoStoreTocResource {
for (let i = 0; i < _len1; i++) {
const id = new FIoChunkId(tocBuffer)
this.chunkIds[i] = id
this.chunkIdToIndex[id.id.toString("base64")] = i
this.chunkIdToIndex[id.id.toString("latin1")] = i
}
}

Expand Down Expand Up @@ -637,7 +637,7 @@ export class FIoStoreTocResource {
this.chunkIndicesWithoutPerfectHash[i] = tocBuffer.readInt32()
}
for (let chunkIndexWithoutPerfectHash of this.chunkIndicesWithoutPerfectHash) {
this.chunkIdToIndex[this.chunkIds[chunkIndexWithoutPerfectHash].id.toString("base64")] = chunkIndexWithoutPerfectHash
this.chunkIdToIndex[this.chunkIds[chunkIndexWithoutPerfectHash].id.toString("latin1")] = chunkIndexWithoutPerfectHash
}
}

Expand Down Expand Up @@ -720,7 +720,7 @@ export class FIoStoreTocResource {
slot = seedAsIndex
} else {
// Entry without perfect hash
return this.chunkIdToIndex[chunkId.id.toString("base64")] || -1
return this.chunkIdToIndex[chunkId.id.toString("latin1")] || -1
}
} else {
slot = Number(chunkId.hashWithSeed(seed) % BigInt(chunkCount))
Expand All @@ -729,7 +729,7 @@ export class FIoStoreTocResource {
return slot
return -1
}
return this.chunkIdToIndex[chunkId.id.toString("base64")] || -1
return this.chunkIdToIndex[chunkId.id.toString("latin1")] || -1
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/ue4/reader/FArchive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ export abstract class FArchive {
dat.push(this.readUInt16())
if (this.readUInt16() !== 0)
throw new ParserException("Serialized FString is not null-terminated", this)
return Buffer.from(dat).toString("utf16le")
return Buffer.from(dat).toString("binary")
} else {
if (length === 0) return ""
const str = this.read(length - 1).toString("utf-8")
const str = this.read(length - 1).toString("binary")
if (this.readUInt8() !== 0)
throw new ParserException("Serialized FString is not null-terminated", this)
return str
Expand Down