At the moment it seems I've tried every trick in the book trying to get this to work. I need some way of encoding AMF requests and then decoding the responses. At this point I don't care what language it's in, as long as it's doable and free (as in to me), however I would prefer PHP.
I don't know what other information is needed, but I'm happy to supply more info - just comment this!
Thanks.
EDIT:
It seems the version of AMFPHP I was using was broken. Using a different version that I extracted from somewhere worked.
You can use amfphp for PHP side or from the zend framework or weborb for PHP who is also free
Although this question is very old, but still if someone is searching like me.
Checkout the answer over here
SabreAMF has a decoder. Check http://code.google.com/p/sabreamf/
Related
I wonder if it's possible to view a PHP code source in a way that https://j11y.io/jquery/ shows a JQ code. Of course I mean reading code from a given file, not from websites code.
I'm not looking for programs like the PHPdocumentor.
Thank you in advance for any reasonable reply.
P.S. For perfectionists - I'm searching for a nice website or software (and I would prefer that option, so that I can be quite sure about the security), which will give me such a useful ability. I'm disturbed after using CTRL-F all the time ;)
My goal is simple: I'd like to modify the 'Comments' field on an image. This is easy to do manually on any file on Windows (just right click and type in whatever you want).
To do so via PHP does not seem clear at all. There are several drivers out there. I have tried them all and simply could not get them to work. Does anyone have direct experience with one and can provide a concrete example how to do this?
The only thing I got that sort of worked was this http://blog.jacobemerick.com/web-development/manipulating-jpeg-exif-headers/.
However, although I can update some fields it also deletes everything else. I have no experience with EXIF before and from what I can tell he is decodeing the raw image data and interpreting the sections. I simply do not have the knowledge to modify his code for my purposes.
I've tried https://github.com/romainneutron/PHPExiftool but I simply get errors about different classes not being available. I guess this is expected as it's clearly still in development.
I would appreciate any guidance as I'm pretty sure I've read everything the internet has to offer on the topic.
The easiest way is to just use exiftool via imagemagick. This is technically command line, not PHP, though you can use exec (bad) or lean on some of PHP's imagemagick extension. The post you linked to was something I wrote a few years ago and has a few limitations... Only working for certain encoding (Canon, can't remember the specifics) and yes, it does strip out everything and then rebuild. Easier than surgical replacements ;)
I have what I think is a ByteArray. When using urlencode on the string, I get this data...
%0A%82%03%01%11SaleDate%0DToYear%0DYardId%15BuyNowOnly%0BState%0BModel%0FStockId%11FromYear%11FullText%13Inventory%11Category%09Make%0FOrderBy%1DOrderDirection%0FPageNum%11PageSize%01%01%06%05-1%02%06%01%01%01%01%06%0F1024187%06%09Sale%01%01%06%13RunNumber%06%07Asc%04%01%04d
I am looking at the php function unpack, and trying unpack('c4char/Xstr/...') where X is a, A, h, H to try to pull the "SaleDate" string out, but I can't get it to work.
Probably the completely wrong approach. Do I need to write a custom unpacker of some sort?
I'm not even sure what I'm dealing with here, it's the output from a flash file, so I think it's an Amf "ByteArray" but I'm at a loss as to how to parse it.
Looking for even just a direction to start hunting for how to manipulate/parse/rebuild something like this. Ultimately I'd love to be able to run it through a function, get an associative array, change a few values, repack it, and send it on it's merry way.
I think it's AMF3 and this is the data in the messages part.
I guess if there's one "main" question, how do I manipulate that string of data simply and safely?
Thanks for any leads.
There are a lot of AMF deserializers out there that are open source, for simplicity sake, would probably make a lot of sense to not roll your own here, even though AMF3 is fairly simple.
I came across this link on github which looks promising:
https://github.com/silexlabs/amfphp-2.0
You probably don't want to roll the whole framework, but can probably roll this:
/core/amf/Deserializer.php
/core/amf/Serializer.php
As far as I can tell, this appears to be a proprietary encoding method specific to the vendor. They use a "Byte Array" to allow greater flexibility of the payload. There isn't an easy way to work with this, without completely reverse engineering their encoding and decoding algorithms.
As strange as I find this, I have not been able to find a good PHP function anywhere which will do an intelligent parse of a user agent string? Googled it for about 20 minutes now.
I have the string already, I just need something that will chop it up and give me at least browser/ver/os.
Know of a good snippet anywhere?
The get_browser() function has been available in PHP for quite a long a time.
The PHP manual is free, can be downloaded in various formats and viewed online (with comments)
https://github.com/browscap/browscap-php - this is a standalone library that aims to replace get_browser function. For shared hostings it seems to be a better option.
Works on: PHP 5
You can try to use: https://github.com/tobie/ua-parser. This is multi-language tool to parsing user agent string. For PHP is here: https://github.com/tobie/ua-parser/tree/master/php
Try out ThaDafinser/UserAgentParser it's an abstraction for many available user agent parsers.
So if you are not happy with one - just switch to another (or combine them)
You can try it out here
There is a PHP class library i found out, and it has worked so well for me. It is in the link below.
https://www.toms-world.org/blog/parseuseragentstring
It is lightweight and just does what I wanted (Browser, Version, OS, Mobile/PC, and much more) in a memory-friendy manner.
I was looking for php encoder and found a zend safeguard. I googled about safeguard and found out that there are many decoders for zend safeguard.
Zend told me that it is not possible to decode zend encoded files, but users over the internet do not agree.
I cannot seem to find a clear answer for my situation.
what do you guys think?
To put it simply, it must be decoded for you to be able to run it. At some point, the encrypted data is decrypted to PHP bytecode during normal operation, meaning it's possible for someone to capture that bytecode and store it, unencrypted.
However, it's probably impossible to retrieve the original PHP source, just like you can't get the original C++ code, comments and all, by decompiling a .exe file.
So, in the end, both sides are right, for specific meanings of "decode".
And tools like Zend Guard will never stop a determined attacker, making their value questionable.
The source code can be decoded back in to valid PHP, there are some less than reputable services out there..
However, not encoding your source normally works out fine, since it allows people to hack their own code in to make a slightly customised version