Questions tagged [opcodes]
47 questions
1
vote
2 answers
Fetching variable length opcodes and CPU timing
I'm currently trying to write a NES emulator in C++ as a summer programming project to get ready for fall term next school year (I haven't coded in a while). I've already written a Chip8 emulator, so I thought the next step would be to try and…

Sean K
- 147
- 2
- 12
1
vote
3 answers
C++ Translate bytes to opcodes?
I am not sure how to word this question but, I am curious to find out how assemblers and other tools show the opcodes of certain bytes?
std::string BytesToOpcode( __in ::BYTE Bytes );
int main( void )
{
std::cout << BytesToOpcode( ( ::PBYTE…

Xorr
- 35
- 1
- 6
0
votes
1 answer
Using C# OpCodes to emit method that returns an object
I am creating a dynamic type which has a method that I'd like to return an object. I am failing to understand how to achieve this. Here's what I have so far:
// .. stuff to create type builder
MethodBuilder builder =
…

OnResolve
- 4,016
- 3
- 28
- 50
0
votes
0 answers
Regular expression-like pattern matching on IEnumerable instead of string chars in C#
I am trying to modify a list of CIL code instructions in C#. Common tasks include finding groups or patterns of instructions and replacing them with other instructions while reusing some of the information from the original match. That sounds a lot…

Andreas Pardeike
- 4,622
- 1
- 17
- 27
0
votes
0 answers
Extract opcodes from the entry point of an executable
I am working with the objdump command to decompile an executable and extract the opcodes, I need to know if I can extract the opcodes from the entry point of the file, because now I do it from the sections.

Stone
- 101
- 5
0
votes
0 answers
Java - write opcodes to .class file (for a custom compiler)
I played a bit around with Compilers. And I want to compile my language into JVM Bytecode but I was wondering how I could write those Opcodes to a .class file.
Example:
I have my .atan src file and I want to compile this to a .class file. I can…

John E.
- 55
- 1
- 8
0
votes
1 answer
DynamicMethod - Common language runtime detected an invalid program
So I try to call a method from an extern DLL via a dynamicmethod using the ilgenerator.
delegate void Write(string text);
static void Main(string[] args)
{
byte[] bytes = File.ReadAllBytes(@"externmethod.dll");
var assembly =…

Justus Bosschieter
- 83
- 5
0
votes
2 answers
SIGSEGV at executing machine code from array on ARMv6
I'm trying to execute machine code stored in array on first Raspberry Pi under ArchLinux. I've done it under x86, but I can't get what I'm doing wrong under ARMv6. The problem is that it doesn't matter what code is in the array, it will always crash…

cafebabe_t
- 65
- 1
- 9
0
votes
2 answers
Cython: use globals().update(...)?
I am writing a Python bytecode optimizer for a module that previously had a Cython tool-chain. While that may be deprecated by now, I encountered something strange while fiddling with it. Consider this simple piece of code:
from opcode import…

hellerve
- 508
- 1
- 6
- 30
0
votes
1 answer
Calling A Method That Was Just Created. Error Calculating Max Stack Value
so I was fooling around with DNLIB recently, and I was trying to add methods to a .net file. I got the methods from a previously compiled file, so basically, I was trying to mimic the method.
There are 3 methods: GetTheTypes, InvokeIt, and…

Mephobia
- 31
- 4
0
votes
1 answer
IL Opcode Modification
Language: VB.NET 3.5
IL opcodes:
718 ldarg.0
719 callvirt System.Windows.Forms.Button RClient.RClient::get_cmd1()
724 ldarg.0
725 ldfld System.String[] RClient.RClient::ButtonStrings
730 ldc.i4.5
731 ldelem.ref…

Dacto
- 2,901
- 9
- 45
- 54
0
votes
3 answers
Printing Opcodes to a File
Just curious, if open a hex editor and type opcodes manually and save it. Such as move 1 to register 1 move 2 to register 2 then call add, would that give me working program? Or does some how automating this gives me crappy compiler?
EDIT: Forgot…

Hamza Yerlikaya
- 49,047
- 44
- 147
- 241
0
votes
1 answer
How to Convert ASM Code(opcodes) To String
How can I convert assembly codes to string like this in PHP:
$shellcode…
user2040816
0
votes
1 answer
Opcode reading of a classfile at runtime with the use of ASM4
Does anybody have any document, which can show me end to end implementation of ASM framework to display opcode of a class file? Or is there any body help me with Hello, World! Program example for ASM frame implementation?
I want to display opcodes…

Prathako
- 91
- 1
- 8
0
votes
3 answers
Is there an allocate winapi call in x86 EXEs?
How is allocation handled within a C++ compiled EXE? Is the allocation manager baked into the app making it impossible to track allocations / unallocations if you don't have the code? Or is there a WinAPI call or something similar for memory…

Robin Rodricks
- 110,798
- 141
- 398
- 607