New XYplorer user here. First of all, thanks for this great tool! <3
I'm trying to create a custom column script that shows some information about PE files. Here's my code:
Code: Select all
$mz = readfile(<cc_item>, , 2);
if $mz != "MZ" {
return "Not MZ";
}
//readfile(filename, [mode], [numbytes], [codepage], [start=1])
$lfanew = readfile(<cc_item>, , 4, , 0x3c + 1);
$pesig_ofs = "";
// Loop through the data previously read
for ($i=0; $i < 4; $i++) {
$byte = substr($lfanew, $i, 1);
$val = asc($byte);
$pesig_ofs = hex($val, 2) . $pesig_ofs;
}
return $pesig_ofs;
I believe this has something to do with the fact hex() operates on signed integers only (according to the documentation). I tried to implement my own (unsigned) hex2dec() function, but I found no way to perform bitwise operations either. Is there a workaround to this problem? I'm probably missing something obvious...
Thanks in advance!