I have been researching for a few days now, and have found no useful tutorials or guides on how to perform a decode of an ioncube encoded file by using xdebug.. Multiple SO post answers do not serve a starting place for a complete beginner.
In short: You can't.
In long:
IonCube is an encoder, and Xdebug is a debugger - not a decoder. It does not know how to read encoded files and even if it could get into the process of intercepting the PHP things that it does, it still won't be able to show you the source code.
When a file is encoded, it is first converted from text into "opcodes"—that is an internal representation of binary stuff which PHP can execute. At this stage, it is already useless for Xdebug.
And then it is encoded, which makes it even less possible to do anything with.
Related
Is there a way to obfuscate PHP code with Ioncube without encoding it?
I.e. the code is just obfuscated and it can be executed without the ioncube loader?
I am not 100% sure but I remember it was possible with an old version of Ioncube and now (v. 8.3.2) I can't find the way to do it: I still have an obfuscate option but it seems it always work in addition to encoding
It seems that it is not possible and it has never been possible to obfuscate only: http://forum.ioncube.com/viewtopic.php?p=10797#10797
I'm not sure how to debug this, or even how best to describe the problem, but all symfony requests are returning strange characters at the beginning of every page. Example:
§{"id":"c8184631","version":0.1}
This should be a json response. Those two characters appear at the beginning of every response no matter the bundle or controller. But only happens on symfony, regular PHP on that server is fine.
This doesn't happen locally. I'm unsure how to start debugging this or even which questions to ask.
Maybe there are some files with different encoding (utf-8 or iso-8859-13), that happened to me before, but I was not using symfony2, just php.
What I did was open every file and changed the file encoding to utf-8.
You can check the encoding for each file for example in "Notepad ++"
Encoding->Convert to UTF-8.
It worked for me.
I have been scouring the internet trying to figure this one out. Any ideas would help. I'm trying to take an .xfdl file (base64gzip of XML) from my server and convert it to .xml with PHP for viewing and modification but, I can't see to figure out this process. I've seen people try to with Ruby but, I don't know any Ruby. If no one can help, I guess I'll be learning Ruby hahaha! Thanks in advanced. Also, I have looked through this website and couldn't find any php examples of this.
Assuming the XML is gzipped first and then base64 encoded, you can use base64_decode() and gzdecode().
echo gzdecode(base64_decode(file_get_contents('file.xfdl')));
However if you're not running on a Windows box, you will need to compile PHP with --with-zlib to include the zlib library and functions.
Once you have it in XML form, you might want to look at XMLReader to see how you can modify and read XML in PHP.
I would like to extract a thumbnail from a RAW image file, like Canon's .CR2 or Nikon's .NEF. I've understood that this can somehow be done with ImageMagick, but haven't grasped if it's possible through the PHP wrapper.
Are there any good solutions? Preferably using the built in thumbnail for speed.
Yep, iMagick (the php version of ImageMagick) can handle these extensions: http://www.imagemagick.org/script/formats.php
Here's a great set of tuts that got me going with Imagick. The owner responded to a few of my questions quickly, and despite a bit of a language barrier was able to easily get me through my hurdles
As an aside, I've begun using Gallery to do image admin. No need to worry about thumbnailing, uploading, etc....it's all automatic. Then on the front end I can do jquery magic (getting photos via php query from the gallery database tables) to make it look really good.
Likely, if PHP's imagemagick libraries are to support this, they would be drawing from some functionality exposed through imagemagick's 'identify' command line tool (as the tool would be itself exposing functionality in the imagemagick libraries). Looking at the documentation for this tool, it doesn't look good. If you tried running identify -verbose, theoretically, the thumbnail information would appear in there somewhere, perhaps as an encoded value. Try it yourself: if it does, maybe you could possibly further extract the information returned from identify, either through the imagemagick functions in PHP (though I don't see any past the Exif libraries which only work on JPEG), or by scraping the return of a PHP system call to the identify tool.
Either way, doesn't look likely.
Benjamin Horn has submitted a complete example about reading the requested data and even saving it locally for later use.
Check this out:
https://benjaminhorn.io/code/extracting-thumbnails-from-camera-raw-files-cr2-and-nef-with-php/
I am passing a json encoded string from javascript to a php file on the server via ajax. on my online server this works fine. but locally, it does not.
There are a few differences in the php installs in the 2 places. minor ones. both are php4. the install locally is actually a newer php4.
I'm trying to track down why this is happening. It looks like the json parsing on the server side with the pear servies_json (json.php), isn't parsing correctly. It manages the first brackets, but then it stops there, and all the internal data is lost?
Is there a php plug in or something that I need to install that keeps this from happening. A setting switch? Thanks for any help.
json_decode() should be used on the server-side to decode the JSON object, it should work fairly consistently. Its sister function json_encode() is equally good for encoding an array/object to a JSON string which can be echoed in your javascript.
Both functions require php 5, for php 4 you can check out this code.