xor

x86 jnz after xor?

纵饮孤独 提交于 2021-02-04 17:43:59
问题 After using IDA Pro to disassemble a x86 dll, I found this code (Comments added by me in pusedo-c code. I hope they're correct): test ebx, ebx ; if (ebx == false) jz short loc_6385A34B ; Jump to 0x6385a34b mov eax, [ebx+84h] ; eax = *(ebx+0x84) mov ecx, [esi+84h] ; ecx = *(esi+0x84) mov al, [eax+30h] ; al = *(*(ebx+0x84)+0x30) xor al, [ecx+30h] ; al = al XOR *(*(esi+0x84)+0x30) jnz loc_6385A453 Lets make it simpler for me to understand: mov eax, b3h xor eax, d6h jnz ... How does the

x86 XOR opcode differences

橙三吉。 提交于 2021-02-04 07:24:11
问题 looking at http://ref.x86asm.net/coder32.html I found two opcodes that match for the statement xor eax,eax 1) opcode 31 XOR r/m16/32 r16/32 2) opcode 33 XOR r16/32 r/m16/32 both refers to 32bit register for operand1 and operand2. So, is there any differences in this specific case of the XORing two 32bit registers ? 回答1: x86 has 2 redundant ways to encode a 2-register instance of any of the basic ALU instructions that have r/m source and r/m destination forms. This redundancy is a consequence

What is an XOR sum?

泪湿孤枕 提交于 2021-01-20 16:26:49
问题 I am not sure of the precise definition of this term. I know that a bitwise XOR operation is going bit by bit and taking the XOR of corresponding bits position wise. Is this result termed the 'XOR sum'? If not, what is an XOR sum, and how do you use XOR to implement this addition? 回答1: In a bit wise XOR operation: a b a^b ----------- 0 0 0 0 1 1 1 0 1 1 1 0 XOR sum refers to successive XOR operations on integers. Suppose you have numbers from 1 to N and you have to find their XOR sum then for

What is an XOR sum?

ぃ、小莉子 提交于 2021-01-20 16:26:19
问题 I am not sure of the precise definition of this term. I know that a bitwise XOR operation is going bit by bit and taking the XOR of corresponding bits position wise. Is this result termed the 'XOR sum'? If not, what is an XOR sum, and how do you use XOR to implement this addition? 回答1: In a bit wise XOR operation: a b a^b ----------- 0 0 0 0 1 1 1 0 1 1 1 0 XOR sum refers to successive XOR operations on integers. Suppose you have numbers from 1 to N and you have to find their XOR sum then for

What is an XOR sum?

霸气de小男生 提交于 2021-01-20 16:25:45
问题 I am not sure of the precise definition of this term. I know that a bitwise XOR operation is going bit by bit and taking the XOR of corresponding bits position wise. Is this result termed the 'XOR sum'? If not, what is an XOR sum, and how do you use XOR to implement this addition? 回答1: In a bit wise XOR operation: a b a^b ----------- 0 0 0 0 1 1 1 0 1 1 1 0 XOR sum refers to successive XOR operations on integers. Suppose you have numbers from 1 to N and you have to find their XOR sum then for

Xor of all pairwise sums of integers in an array

妖精的绣舞 提交于 2020-12-03 07:37:09
问题 We have an array A for example [1, 2, 3] . I want to find the XOR of the SUM of all pairs of integers in the array. Though this can easily be done in O(n^2) (where n is the size of the array) by passing over all of the pairs, I want to improve the time complexity of the solution? Any answer that improves the time complexity would be great. E.g. for the above example array, A , the answer would be (1+2)^(1+3)^(2+3) = 2 . Since the pairwise elements are (1,2), (1,3), (2,3) , and 3 ^ 4 ^ 5 = 2 .

Xor of all pairwise sums of integers in an array

强颜欢笑 提交于 2020-12-03 07:31:01
问题 We have an array A for example [1, 2, 3] . I want to find the XOR of the SUM of all pairs of integers in the array. Though this can easily be done in O(n^2) (where n is the size of the array) by passing over all of the pairs, I want to improve the time complexity of the solution? Any answer that improves the time complexity would be great. E.g. for the above example array, A , the answer would be (1+2)^(1+3)^(2+3) = 2 . Since the pairwise elements are (1,2), (1,3), (2,3) , and 3 ^ 4 ^ 5 = 2 .