mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Tidied up local and global variables for Mach-o
This commit is contained in:
parent
7c25e29515
commit
acf5c733c2
1 changed files with 8 additions and 6 deletions
|
@ -2737,6 +2737,11 @@ export function extractZIP(bytes, offset) {
|
||||||
*/
|
*/
|
||||||
export function extractMACHO(bytes, offset) {
|
export function extractMACHO(bytes, offset) {
|
||||||
|
|
||||||
|
// Magic bytes.
|
||||||
|
const MHCIGAM64 = "207250237254";
|
||||||
|
const MHMAGIC64 = "254237250207";
|
||||||
|
const MHCIGAM = "206250237254";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks to see if the file is 64-bit.
|
* Checks to see if the file is 64-bit.
|
||||||
|
@ -2771,6 +2776,9 @@ export function extractMACHO(bytes, offset) {
|
||||||
*/
|
*/
|
||||||
function dumpSegmentCommands(stream, offset, isSwap, ncmds) {
|
function dumpSegmentCommands(stream, offset, isSwap, ncmds) {
|
||||||
let total = 0;
|
let total = 0;
|
||||||
|
const LCSEGEMENT64 = 0x19;
|
||||||
|
const LCSEGEMENT = 0x1;
|
||||||
|
|
||||||
for (let i = 0; i < ncmds; i++) {
|
for (let i = 0; i < ncmds; i++) {
|
||||||
|
|
||||||
// Move to start of segment.
|
// Move to start of segment.
|
||||||
|
@ -2820,12 +2828,6 @@ export function extractMACHO(bytes, offset) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const MHCIGAM64 = "207250237254";
|
|
||||||
const MHMAGIC64 = "254237250207";
|
|
||||||
const MHCIGAM = "206250237254";
|
|
||||||
const LCSEGEMENT64 = 0x19;
|
|
||||||
const LCSEGEMENT = 0x1;
|
|
||||||
|
|
||||||
const stream = new Stream(bytes.slice(offset));
|
const stream = new Stream(bytes.slice(offset));
|
||||||
const magic = stream.getBytes(4).join("");
|
const magic = stream.getBytes(4).join("");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue