opcode

PHP Opt-Code Caching/Zend Acceleration and include_once vs. require_once

I have a colleague who is looking into Opt-Code Caching/Zend Acceleration (I've always assumed these are the same thing) for our PHP based application. His Benchmarks appear to indicate that we're NOT seeing a performance benefit if we include our (large) class libraries with require_once, but we DO see the performance benefit when usin...

calling code stored in the heap from vc++

Imagine I am doing something like this: void *p = malloc (1000); *((char*)p) = some_opcode; *((char*)p+1) = another_opcode; // for the sake of the example: the opcodes are ok .... etc... How can I define a function pointer to call p as if it was a function? (i'm using VC++ 2008 express). Thanks ...

Can someone explain this directly assembled x86 JMP opcode?

At school we have been using a bootstrap program to run stand-alone programs without an operating system. I have been studying this program and when protected mode is enabled there is a far jump executed by directly assembling the opcode and operands as data within the program. This was for the GNU assembler: /* this code imme...

Unhandled dwarf expression

hello can anyone tell me what exactly the following means that occurs during segmentation fault. Unhandled dwarf expression opcode 0x93 any advice appreciated, Edit : Its on solaris 10 i386 ...

The easiest way to convert a PHP script into OpCode using C#?

Hi, What is the easiest way to convert a PHP script (.php) into OpCode/Bytecode (Operation Code) using C#? I can use DLLs if I have to. I need this to be done for the project I am working in order to analyze PHP code easier. Any thoughts or ideas are welcome. ...

How does the putspecialobject opcode in the RubyVM work?

I'm working on an implementation of the RubyVM and I've searched all over for some documentation on the opcodes, but to no avail. If anyone knows specifically how the putspecialobject opcode works, or even just a link to some fullish documentation I'd much appreciate it! ...

What are these opcodes for?

Using reflector I get the following output: .method private hidebysig static class myModelTestarea.Foo Method() cil managed { .maxstack 1 .locals init ([0] class myModelTestarea.Foo CS$1$0000) L_0000: nop L_0001: ldc.i4.0 L_0002: newarr object L_0007: call object myModelTestarea.Program::Resolve(object[]) L_000c: castcla...

VM Design: More opcodes or less opcodes? What is better?

Don't be shocked. This is a lot of text but I'm afraid without giving some detailed information I cannot really show what this is all about (and might get a lot of answers that don't really address my question). And this definitely not an assignment (as someone ridiculously claimed in his comment). Prerequisites Since this question can...

APC Caching with variable includes

I have been doing some research on APC Caching with PHP and found that conditional includes just don't work. Like: if($a) { include('a.php'); } else { include('b.php'); } My question is: Can I get around this with variable includes? Such as: if($a) { $file = 'a.php'; } else { $file = 'b.php'; } include($file); Wo...

C String literals not in machine code?

I need to slightly change a string in an exe which I dont have source code for anymore. It was writtin in C. I notice that C string literals do not seem to appear in the machine code listing at all - not in raw ASCII anyway, not in utf8/16/32 or anything like that. They seem to be encoded, I am guessing as part of 32bit op-codes. For ex...

Dynamic object property populator (without reflection)

I want to populate an object's properties without using reflection in a manner similar to the DynamicBuilder on CodeProject. The CodeProject example is tailored for populating entities using a DataReader or DataRecord. I use this in several DALs to good effect. Now I want to modify it to use a dictionary or other data agnostic object so ...

Can we construct an instance of `OpCode`?

The .NET Framework 4.0 introduces several items to the Reflection API that range from extremely useful to vital for my work. Among these are protected constructors for Assembly, Module, MethodBody, and LocalVariableInfo and the new CustomAttributeData class. There are a couple items I still need that are quite troublesome to work around....

Opcode (APC/XCache), Zend, Doctrine, and Autoloaders

I am trying to use either APC or XCache as an opcode to cache my php pages. I am using it with Zend and Doctrine and it's having a problem with the autoloader. If I try with APC, I get the following: Fatal error: spl_autoload() [<a href='function.spl-autoload'>function.spl-autoload</a>]: Class Doctrine_Event could not be loaded in ...

Looking for a way to trap CPUID instructions

I am looking for a neat way to trap and fiddle with the CPUID instruction of Linux processes. Played around with ptrace() and patching all cpuid opcodes in all executable mmap'ed regions that are created by a process, replacing them by int3's. Didn't work that well since the CPUID opcode bytes appears quite often as parts of other longer...

[ASM] JMP to absolute address (op codes)

I'm trying to code a exe packer/protector as a way of learning more about assembler, c++, and how PE files work. I've currently got it working so the section containing the EP is XORed with a key and a new section is created that contains my decryption code. Everything works out great except when I try and JMP to the original EP after de...

Can the APC cache be shared among multiple PHP processes running as fastcgi/fcgid?

I'm running a LAMP box with PHP running as fcgid. APC is installed and working well. However, each PHP process gets its own cache. This is a problem, because it would make far more sense to have 10 PHP processes with 300MB shared APC cache than 10 PHP processes, each with a redundant 30MB unshared APC cache. There was a prior thread on ...

How to get opcodes of PHP?

<?php $show_value = 123; echo 'sing_quote'.$show_value; echo "double_quote{$show_value}"; ?> Its opcode is: 1: <?php 2: $show_value = 123; 0 ASSIGN !0, 123 3: echo 'sing_quote'.$show_value; 1 CONCAT 'sing_quote', !0 =>RES[~1] 2 ECHO ~1 ...

Things to avoid when coding PHP programs that work on OpCode Cachers

Hi, What kinds of things should I avoid if I want to support PHP OpCode Caches? Are static calls evil? What about __autoload? ...

Does apc_compile_file() invalidate the in-memory cache for the particular file?

Hi, If I run the following PHP code: apc_compile_file("relative/path/to/file"); will it invalidate the in-memory cache that is used for this particular file? That is, if I first access /path/to/file, APC will compile it, and cache the OpCode in memory. Now, if I access /path/to/file again, APC will just use the cached OpCode. Howeve...

x86 instruction set roadmap

I'm just touching the surface of the x86 instruction set after a long period of high level programming. It's been about 20 years I had my first read on x86 assembly programming and from my googlings I get just lost with the myriad of instruction set references; from ones that mix new generations of processors (286, 386, 486...) to others...