Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | # |
michael@0 | 2 | # -*- Mode: Asm -*- |
michael@0 | 3 | # |
michael@0 | 4 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 7 | |
michael@0 | 8 | # |
michael@0 | 9 | # ** Assumed vtable layout (obtained by disassembling with gdb): |
michael@0 | 10 | # ** 4 bytes per vtable entry, skip 0th and 1st entries, so the mapping |
michael@0 | 11 | # ** from index to entry is (4 * index) + 8. |
michael@0 | 12 | # |
michael@0 | 13 | |
michael@0 | 14 | .text |
michael@0 | 15 | .align 2 |
michael@0 | 16 | # |
michael@0 | 17 | # NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, |
michael@0 | 18 | # uint32_t paramCount, nsXPTCVariant* params) |
michael@0 | 19 | # |
michael@0 | 20 | |
michael@0 | 21 | .globl __NS_InvokeByIndex |
michael@0 | 22 | __NS_InvokeByIndex: |
michael@0 | 23 | mflr r0 |
michael@0 | 24 | stw r31,-4(r1) |
michael@0 | 25 | # |
michael@0 | 26 | # save off the incoming values in the callers parameter area |
michael@0 | 27 | # |
michael@0 | 28 | stw r3,24(r1) ; that |
michael@0 | 29 | stw r4,28(r1) ; methodIndex |
michael@0 | 30 | stw r5,32(r1) ; paramCount |
michael@0 | 31 | stw r6,36(r1) ; params |
michael@0 | 32 | stw r0,8(r1) |
michael@0 | 33 | stwu r1,-144(r1) ; 24 for linkage area, |
michael@0 | 34 | ; 8*13 for fprData area, |
michael@0 | 35 | ; 8 for saved registers, |
michael@0 | 36 | ; 8 to keep stack 16-byte aligned |
michael@0 | 37 | |
michael@0 | 38 | # set up for and call 'invoke_count_words' to get new stack size |
michael@0 | 39 | # |
michael@0 | 40 | mr r3,r5 |
michael@0 | 41 | mr r4,r6 |
michael@0 | 42 | |
michael@0 | 43 | stwu r1,-24(r1) |
michael@0 | 44 | bl L_invoke_count_words$stub |
michael@0 | 45 | lwz r1,0(r1) |
michael@0 | 46 | |
michael@0 | 47 | # prepare args for 'invoke_copy_to_stack' call |
michael@0 | 48 | # |
michael@0 | 49 | lwz r4,176(r1) ; paramCount |
michael@0 | 50 | lwz r5,180(r1) ; params |
michael@0 | 51 | mr r6,r1 ; fprData |
michael@0 | 52 | slwi r3,r3,2 ; number of stack bytes required |
michael@0 | 53 | addi r3,r3,28 ; linkage area |
michael@0 | 54 | mr r31,r1 ; save original stack top |
michael@0 | 55 | sub r1,r1,r3 ; bump the stack |
michael@0 | 56 | clrrwi r1,r1,4 ; keep the stack 16-byte aligned |
michael@0 | 57 | addi r3,r31,144 ; act like real alloca, so 0(sp) always |
michael@0 | 58 | stw r3,0(r1) ; points back to previous stack frame |
michael@0 | 59 | addi r3,r1,28 ; parameter pointer excludes linkage area size + 'this' |
michael@0 | 60 | |
michael@0 | 61 | # create "temporary" stack frame for _invoke_copy_to_stack to operate in. |
michael@0 | 62 | stwu r1,-40(r1) |
michael@0 | 63 | bl L_invoke_copy_to_stack$stub |
michael@0 | 64 | # remove temporary stack frame. |
michael@0 | 65 | lwz r1,0(r1) |
michael@0 | 66 | |
michael@0 | 67 | lfd f1,0(r31) |
michael@0 | 68 | lfd f2,8(r31) |
michael@0 | 69 | lfd f3,16(r31) |
michael@0 | 70 | lfd f4,24(r31) |
michael@0 | 71 | lfd f5,32(r31) |
michael@0 | 72 | lfd f6,40(r31) |
michael@0 | 73 | lfd f7,48(r31) |
michael@0 | 74 | lfd f8,56(r31) |
michael@0 | 75 | lfd f9,64(r31) |
michael@0 | 76 | lfd f10,72(r31) |
michael@0 | 77 | lfd f11,80(r31) |
michael@0 | 78 | lfd f12,88(r31) |
michael@0 | 79 | lfd f13,96(r31) |
michael@0 | 80 | |
michael@0 | 81 | lwz r3,168(r31) ; that |
michael@0 | 82 | lwz r4,0(r3) ; get vTable from 'that' |
michael@0 | 83 | lwz r5,172(r31) ; methodIndex |
michael@0 | 84 | slwi r5,r5,2 ; methodIndex * 4 |
michael@0 | 85 | lwzx r12,r5,r4 ; get function pointer |
michael@0 | 86 | |
michael@0 | 87 | lwz r4,28(r1) |
michael@0 | 88 | lwz r5,32(r1) |
michael@0 | 89 | lwz r6,36(r1) |
michael@0 | 90 | lwz r7,40(r1) |
michael@0 | 91 | lwz r8,44(r1) |
michael@0 | 92 | lwz r9,48(r1) |
michael@0 | 93 | lwz r10,52(r1) |
michael@0 | 94 | |
michael@0 | 95 | mtlr r12 |
michael@0 | 96 | blrl |
michael@0 | 97 | |
michael@0 | 98 | mr r1,r31 |
michael@0 | 99 | lwz r0,152(r1) |
michael@0 | 100 | addi r1,r1,144 |
michael@0 | 101 | mtlr r0 |
michael@0 | 102 | lwz r31,-4(r1) |
michael@0 | 103 | |
michael@0 | 104 | blr |
michael@0 | 105 | |
michael@0 | 106 | .picsymbol_stub |
michael@0 | 107 | L_invoke_count_words$stub: |
michael@0 | 108 | .indirect_symbol _invoke_count_words |
michael@0 | 109 | mflr r0 |
michael@0 | 110 | bcl 20,31,L1$pb |
michael@0 | 111 | L1$pb: |
michael@0 | 112 | mflr r11 |
michael@0 | 113 | addis r11,r11,ha16(L1$lz-L1$pb) |
michael@0 | 114 | mtlr r0 |
michael@0 | 115 | lwz r12,lo16(L1$lz-L1$pb)(r11) |
michael@0 | 116 | mtctr r12 |
michael@0 | 117 | addi r11,r11,lo16(L1$lz-L1$pb) |
michael@0 | 118 | bctr |
michael@0 | 119 | .lazy_symbol_pointer |
michael@0 | 120 | L1$lz: |
michael@0 | 121 | .indirect_symbol _invoke_count_words |
michael@0 | 122 | .long dyld_stub_binding_helper |
michael@0 | 123 | |
michael@0 | 124 | |
michael@0 | 125 | .picsymbol_stub |
michael@0 | 126 | L_invoke_copy_to_stack$stub: |
michael@0 | 127 | .indirect_symbol _invoke_copy_to_stack |
michael@0 | 128 | mflr r0 |
michael@0 | 129 | bcl 20,31,L2$pb |
michael@0 | 130 | L2$pb: |
michael@0 | 131 | mflr r11 |
michael@0 | 132 | addis r11,r11,ha16(L2$lz-L2$pb) |
michael@0 | 133 | mtlr r0 |
michael@0 | 134 | lwz r12,lo16(L2$lz-L2$pb)(r11) |
michael@0 | 135 | mtctr r12 |
michael@0 | 136 | addi r11,r11,lo16(L2$lz-L2$pb) |
michael@0 | 137 | bctr |
michael@0 | 138 | .lazy_symbol_pointer |
michael@0 | 139 | L2$lz: |
michael@0 | 140 | .indirect_symbol _invoke_copy_to_stack |
michael@0 | 141 | .long dyld_stub_binding_helper |
michael@0 | 142 |