diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-03-25 17:53:14 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-03-25 17:53:14 +0100 |
commit | f2902217b38cf2e16e851ae84d61247f8e828180 (patch) | |
tree | 0156a6db6aa8b4d87bf041ece5cf5229c59fe9de /other-licenses/7zstub/src/C/BraIA64.c | |
parent | 917a2c450f08ab4c934c9938319f10a1114272b4 (diff) | |
download | UXP-f2902217b38cf2e16e851ae84d61247f8e828180.tar UXP-f2902217b38cf2e16e851ae84d61247f8e828180.tar.gz UXP-f2902217b38cf2e16e851ae84d61247f8e828180.tar.lz UXP-f2902217b38cf2e16e851ae84d61247f8e828180.tar.xz UXP-f2902217b38cf2e16e851ae84d61247f8e828180.zip |
Update the 7z installer stub source to 18.05.
Tag #1022
Diffstat (limited to 'other-licenses/7zstub/src/C/BraIA64.c')
-rw-r--r-- | other-licenses/7zstub/src/C/BraIA64.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/other-licenses/7zstub/src/C/BraIA64.c b/other-licenses/7zstub/src/C/BraIA64.c new file mode 100644 index 000000000..2656907a0 --- /dev/null +++ b/other-licenses/7zstub/src/C/BraIA64.c @@ -0,0 +1,53 @@ +/* BraIA64.c -- Converter for IA-64 code
+2017-01-26 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "CpuArch.h"
+#include "Bra.h"
+
+SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
+{
+ SizeT i;
+ if (size < 16)
+ return 0;
+ size -= 16;
+ i = 0;
+ do
+ {
+ unsigned m = ((UInt32)0x334B0000 >> (data[i] & 0x1E)) & 3;
+ if (m)
+ {
+ m++;
+ do
+ {
+ Byte *p = data + (i + (size_t)m * 5 - 8);
+ if (((p[3] >> m) & 15) == 5
+ && (((p[-1] | ((UInt32)p[0] << 8)) >> m) & 0x70) == 0)
+ {
+ unsigned raw = GetUi32(p);
+ unsigned v = raw >> m;
+ v = (v & 0xFFFFF) | ((v & (1 << 23)) >> 3);
+
+ v <<= 4;
+ if (encoding)
+ v += ip + (UInt32)i;
+ else
+ v -= ip + (UInt32)i;
+ v >>= 4;
+
+ v &= 0x1FFFFF;
+ v += 0x700000;
+ v &= 0x8FFFFF;
+ raw &= ~((UInt32)0x8FFFFF << m);
+ raw |= (v << m);
+ SetUi32(p, raw);
+ }
+ }
+ while (++m <= 4);
+ }
+ i += 16;
+ }
+ while (i <= size);
+ return i;
+}
|