Questions tagged [opcode]
The binary number that represents a machine instruction for a specific processor type.
470
questions
0
votes
2
answers
61
views
Disassembling bytecode into opcodes across different EVM versions
I need to disassemble bytecode into opcodes across different EVM versions, to make it agnostic to the EVM version used during compilation?
As the second best option - is there a disassembler, that ...
0
votes
0
answers
19
views
Any useful way (amd64) to effect a transfer like this? pc <-- (sp) [Note the absense of auto-decrement]
That's it. Seems to be specifically absent.
Just read ('red') the instruction set, I don't see an obvious way to do this?
Looking for a way to get the same result, shorter is better of course.
(Have ...
0
votes
1
answer
39
views
Explaining LLVM for loop
I am following along this post however I am new to C++ and LLVM and need help breaking down what everything means in this for loop
for(auto I = inst_begin(F), E = inst_end(F); I != E; ++I) {
...
0
votes
0
answers
12
views
ANSI C90 68hc11 Assembly Language, Opcode Error Trapping
im trying to write a program that implements modifying memory and then disassembling it with Assembly Language.
Currently ive got the basics set up, as in it'll take the commands and you can modify ...
0
votes
0
answers
53
views
How can I write a short bitwise code as jmp $ without directives?
I have a one line program in assembly
`jmp $
When compiling the program
nasm -f bin jmp$.s -o a.out
It generates a file a.out in binary. Seeing him with xxd a.out
00000000: ebfe
My understanding is ...
0
votes
1
answer
462
views
Migrations hit an invalid opcode while deploying
When run truffle migration command it throws error, Tried many solutions but couldn,t corrected it.
PS C:\Users\Jatin\OneDrive - nsut.ac.in\Desktop\Truffle\web> truffle migration
Compiling your ...
0
votes
0
answers
324
views
System.InvalidProgramException Common Language Runtime detected an invalid program for Reflection
System.InvalidProgramException : Common Language Runtime detected an invalid program.
Seeing this error message whilst trying to check the expression's correctness and if it is the correct IL.
The ...
0
votes
2
answers
38
views
How does the VM OS issue privileged Opcodes without being terminated by the Host OS/CPU?
My understanding is that the host Operating System upon booting associates with and locks certain CPU Opcodes/instructions so that only the host OS may use them. The CPU architecture, additionally, ...
1
vote
0
answers
84
views
how to detect the instruction boundary while designing a disassembler?
If I want to write a disassembler program, how can I determine the boundaries of instructions? By "boundaries," I mean the rule of separating a sequence of bytes into individual instructions....
3
votes
1
answer
321
views
machine code FF 25 should have 64-bit operand but actually only 32-bit is available
I have some machine codes as follow:
FF 25 CA 21 00 00
I know it's a JMP's opcode with Op/En set to M, which means there's a ModR/M byte after it.
0x25 => 0x00100101, so the reg is 0b100, and the ...
0
votes
1
answer
92
views
Create a Field using FieldBuilder and add one to Field Value in MethodBuilder ILCode Emit
I have a Method that creates a MethodBuilder Method and defines the Behaviour using ILGenerator and Emit + OpCodes.
This Method was created with the help of a previous StackOverflow Question I made - ...
1
vote
0
answers
89
views
OPCUA subscribing to all events
I want to get all events when subscribing to server object at UA Expert, for that how can I listen to the Server object.
I am using prosys JAVA sdk 4.2.0
As of now when I am subscribing directly to ...
1
vote
2
answers
155
views
How can I using OpCodes and Emit set a parameter to an instantiated Property of type T?
I am trying to write a Method that returns that a DynamicMethod which when Invoked sets the first parameter to an object of Type T, This Object is called Value and is set when the class is ...
0
votes
0
answers
25
views
Why MOVZX r64, r/m8 behave like MOVZX r32, r/m8 [duplicate]
Here is the code snippet
int main()
{
unsigned long int ui64{};
unsigned char ui8{ 0xAA };
unsigned short ui16 { 0xBBBB};
ui64 = ui8;
ui64 = ui16;
}
Here is the opcodes that ...
1
vote
1
answer
209
views
Opcode differences between MOV r/m32, imm32 and MOV r32, imm32
These are MOV instruction opcodes from the Intel® 64 and IA-32 Architectures Software Developer Manuals:
B8+ rd id MOV r32, imm32 OI Valid Valid Move imm32 to r32.
C7 /0 id MOV r/m32, imm32 MI Valid ...
0
votes
1
answer
74
views
MSP430 opcode table
What does "As" stand for in this MSP430 opcode table?
I looked all over the place and did not find anything on the meaning of the abbreviation
1
vote
1
answer
773
views
Reassemble Python bytecode to source (CTF challenge)
I have a text file with python bytecode which is part of the output you'd get when issuing python -m dis file.py. My goal is to reassemble the source from the bytecode.
I've seen a similar question ...
3
votes
1
answer
332
views
How to access content of stack in Python disassembler?
I'm creating a tool that analyses code used within definition of user defined function, for example:
Test 1 ✅
def help_fun(a, b): return a * b
def test1(numbers):
r1, r2 = np.multiply.reduce(...
1
vote
1
answer
257
views
Can a processor have same opcode for different sets of instructions?
I have a processor. Some instruction sets are AND, ADD, ANDI, ADDI. These looks like same but they are not. Can I assign same opcode for looks like same instructions sets as follows screen shot:
or ...
1
vote
1
answer
545
views
Opcode vs Operand in x86 assembly source code
Recently in an exam, when asked about opcode vs operand, I gave an example
mov [ax],0000h
where I said the mov was the opcode and [ax],0000h was the operand and together they formed an instruction. ...
5
votes
2
answers
479
views
Is there a list of unused binary opcodes for X86_64 (amd64)
I am trying to add custom instructions in X86_64 (amd64) ISA. I will create a binary using these instructions and then I'll run it in gem5 simulator. To find the list of unused opcodes, I am referring ...
0
votes
2
answers
168
views
If a computer has an Intel processor does it mean that it is an x86 machine?
Is it true that every machine that has an Intel CPU is an x86 machine?
Considering that all Intel CPU are backward compatible does it mean that every x86 machine is able to run Intel CPUs instruction ...
2
votes
1
answer
50
views
Is Python unpacking atomic w.r.t. interrupts?
Given the following example
try:
a, b = 0, 0
for _ in range(100):
a, b = (a+1, b+1)
except KeyboardInterrupt:
assert a == b
could an AssertionError be thrown? If so, is there a ...
-1
votes
1
answer
528
views
how to read lines of ECDSA recover public key from signature in assembly?
im looking into how to read the ECDSA recovery output in assembly in etherscan
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// ...
0
votes
0
answers
463
views
Conversion from opcode to assembly one by one
I want to know that how can I convert a single opcode with it's operands in it's equivalent assembly code.
For example:
Opcode:33 C0
Assembly code: XOR AX,AX
As mentioned above, I want to put "33 ...
2
votes
1
answer
170
views
Which EVM opcodes produce traces on GoEthereum
I was reading through the Geth docs and noticed it mentioning traces. It covered when traces occur and mentioned that logs are created anytime there are traces.
The simplest type of transaction trace ...
3
votes
1
answer
5k
views
Can't solve "SystemError: unknown opcode"
I am executing a notebook on my laptop and I get the following error.
XXX lineno: 17, opcode: 120
---------------------------------------------------------------------------
SystemError ...
2
votes
2
answers
140
views
What is the action of the GRPL instruction in the I386 instruction set?
What is the action of the "Grpl" instruction in the I386 instruction set? I am learning about computer instruction and doing instruction simulation experiments. During the simulation I ...
0
votes
0
answers
66
views
How many Bits for operand specification in indirect addressing
Hey^^ hopefully someone can help me out here:
The question in a test is the following (I had to translate it)
A CPU has 16 General Purpose Registers, it handles data and addresses with a length of 32 ...
0
votes
2
answers
218
views
What affects generated machine code at each step of the compilation process?
I am almost certain this question has been asked before, but I can not seem to find the right keywords to search for to get an answer. My apologies if this is a duplicate.
I am better trying to ...
0
votes
1
answer
1k
views
'Label' in assembly language - opcode
I am currently learning to program in the 8085 microprocessor. Take a look at the program below:
LXI H, 2050
MOV B, M
INX H
MOV C, M
MVI A 00H
TOP: ADD B
DCR C
JNZ TOP
INX H
MOV M, A
HLT
This program ...
1
vote
0
answers
431
views
Data back NULL in OPC UA client with VB.net
im trying to connect to a S7 1500 PLC with an OPC UA client with the Visual Studio using VB.net.
The project need to be auto, so i have an Excel that have the names of the variables that i will read ...
0
votes
0
answers
256
views
Why does CMP L and CMP M instructions in Microprocessor 8085 have same opcode BD?
CMP L compares Accumulator(A) contents with L register. CMP M compares Accumulator(A) contents with 8-bit data stored in the memory location as stored in H-L register pair. That's two different ...
0
votes
1
answer
172
views
I don't understand this opcode in JVM Implementation
I am writing a JVM.
I was implementing all opcodes one by one, until I faced dup2.
The oracle instruction set https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.dup2 says
...
2
votes
1
answer
72
views
Assembly instruction to alter for spaceship movement (DEC to MOV)
I have permission to modify this executable.
A game called Emperor of the Fading Suns has spaceships in it. When you launch into orbit with a specific ship, said ship lose one movement point.
Game\...
3
votes
0
answers
377
views
How are blocks processed while syncing Ethereum blockchain in full sync mode?
I am syncing a Geth client in full sync mode and also have made some changes in the client to log the execution time , time stamp and block number of all the opcodes executed in the Ethereum virtual ...
1
vote
1
answer
79
views
How to understand the opcode of AzerothCore?
I've been study the opcode of AzerothCore, there a lot of opcodes like below:
CMSG_ZONE_MAP
CMSG_CREATEITEM
CMSG_CREATEGAMEOBJECT
CMSG_PETGODMODE
Could you pls help me understand how it works and ...
-1
votes
1
answer
198
views
does windows handle the opcode different?
(btw this ist my first question here, so I dont know any guidelines)
Im trying to learn reading the pure opcodes (I do not know the exact term) of Programms on x-86-architectur (intel i5-7400) but if ...
0
votes
1
answer
134
views
How does makeLog instruction function works in Ethereum virtual machine
The following code snippet is a constituent piece of the instructions.go file in geth.
// make log instruction function
func makeLog(size int) executionFunc {
return func(pc *uint64, interpreter *...
0
votes
0
answers
41
views
GCC asm function, how to insert specific op code? [duplicate]
I'm trying to use the asm function in C to insert redundant xor instructions:
int main (int argc, char** argv) {
asm(".rept 100 ; xor %eax, %eax; .endr");
return 0;
}
...
0
votes
1
answer
114
views
How to identify data type from opcode?
Suppose I have the following bytes in the .data segment of a PE file opened in IDA:
32 A2 DF 2D 99 2B 00 00 CD 5D 20 D2 66 D4 FF FF
01 00 D2 8B 0A 35 60 BD F1 C9 D6 5D 6C 59 51 D5
24 FD 02 F5 43 26 ...
0
votes
0
answers
36
views
Attack Lab phases 4 and 5 [duplicate]
In the particular version of Attack Lab that I am following, I have various codes in my farm that look like the following :
0000000000401a4c <getval_440>:
401a4c: b8 48 89 c7 c3 ...
1
vote
1
answer
905
views
c3 at the end of an opcode in Attack Lab
I was working on a version of Attack Lab. For phases 4 and 5, among the farm operations, I have several operations ending with a c3, but also followed by a separate retq (c3) instruction such as ...
0
votes
1
answer
114
views
how to differentiate Code vs Data bytes pefile
Basically, I am trying to understand how to differentiate a bunch of bytes whether they are code or data?
Say I have the following bytes which are dissassembled:
b'.data\x00\x00\x00'
b"\xb9\x08\...
2
votes
0
answers
936
views
Assembly, Moving 64-bit Immediate to memory? [duplicate]
I was reading:
why we can't move a 64-bit immediate value to memory?
In one of the answers it's mentioned:
mov reg64, imm (in intel syntax, destination first) is the only
instruction that accepts ...
3
votes
1
answer
536
views
x86 sub instruction opcode confusion [duplicate]
Playing around a bit with Turbo Assembler and Turbo Debugger, I was surprised about opcodes. More precisely, I have some assembled binary in which Turbo Debugger disassembles the word
29 C3
correctly ...
2
votes
1
answer
72
views
first argument from module (opcode llvm)
In https://github.com/llvm/llvm-project/tree/main/llvm/examples/ModuleMaker is static variable.
How read argument module and put to Add instructions?
Instruction *Add = BinaryOperator::Create(...
0
votes
0
answers
654
views
Confused with binary to hex ARM encoding
Can you explain to me, please, why the heck is there 16 instructions in the following example? I thought there were more. And how the heck can I translate this binary scheme into HEX string?
Let's, ...
0
votes
0
answers
315
views
How do i convert mov RAXto lea RAX?
I have a question about opcode
Have i converted it correctly to lea rax?
also, how do i converty jmp rax to call rax?
0x48, 0xB8 // mov rax, [xxx]
0xFF, 0xE0, // jmp rax
How do i convert his to
lea ...
0
votes
1
answer
508
views
Portable opcode generation
I'm currently developing, in Python, a very simple, stack-oriented programming language intended to introduce complete novices to programming concepts. The language does allow users to craft their ...