Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
For example, how could I obfuscate this sample code from:
/*
The code below will write
to a heading and to a paragraph,
and will represent the start of
my homepage:
*/
document.getElementById("myH1").innerHTML="Welcome to my Homepage";
document.getElementById("myP").innerHTML="This is my first paragraph.";
into the form:
var _0xcc34=["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x6D\x79\x48\x31","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x57\x65\x6C\x63\x6F\x6D\x65\x20\x74\x6F\x20\x6D\x79\x20\x48\x6F\x6D\x65\x70\x61\x67\x65","\x6D\x79\x50","\x54\x68\x69\x73\x20\x69\x73\x20\x6D\x79\x20\x66\x69\x72\x73\x74\x20\x70\x61\x72\x61\x67\x72\x61\x70\x68\x2E"];document[_0xcc34[2]](_0xcc34[1])[_0xcc34[0]]=_0xcc34[3];document[_0xcc34[2]](_0xcc34[4])[_0xcc34[0]]=_0xcc34[5];
using PHP?
I know that I can do this using http://javascriptobfuscator.com/ but I need to do that inside my PHP file, because it dynamically changes.
OK. On theory about how to obsfucate.
you need to know the language, as you will need a parser for good results.
when you know what is what, then you can start replacing things.
for a very stupid example replace all instances of
document.getElementById('string'); with ab(cd('fgevat'); like
function cd(s) { /* ROT13 implemented here*/ } function ab(s) { return document.getElementById(s); } ab(cd('fgevat');
you can use eval to avoid unpacking to clear text. and then you can go
like this
function h(s) { /*implement hexdecode in an ugly way, and run eval() on the resulting string */} h('2020202066756e6374696f6e206364287329207b202f2a20524f54313320696d706c656d656e74656420686572652a2f207d2066756e6374696f6e206162287329207b2072657475726e20646f63756d656e742e676574456c656d656e74427949642873293b207d206162286364282766676576617427293b'); // which is the above code.
this is all r=1 stuff. And can be done waay better with a deeper understanding of the language, also these are absolutely trivial to reverse
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Last year I was working on a project concerning the creation of R-graphics. I remember that, during my research then, I came across something to visualize interactive R-graphics on a webpage. Unfortunately, I don't remember the name.
Does anyone know a good package/... to achieve this? I would like to get data from a database, use this data to generate a plot using R, and then visualize the plot on a webpage.
There are two ways of doing this. You could either use an direct method or an indirect method. For the indirect method you generate the javascript in your R script and pas it on to PHP (which is a lot of work but gives really nice graphs):
direct method
Knitr - compatible with R-studio
GridSVG
Shiny - compatible with R-studio
Indirect
Highcharts
D3.js
Rickshaw
Personally I'm most excited about epivizr which makes use of D3.js
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to create random sentences. I can't create any lists or populate anything myself. I will end up asking questions that analyze the sentence's words.
I don't understand how to use PHP to arrange verbs and nouns to create complete sentences.
I'm not asking for an external reference, just how to use PHP to generate random sentences.
Is it possible to grab a sentence of a web page and test to see if it is grammatically correct?
Thanks!
On this site you will get your wordlists. If you separately load them into your database, you can save the part of speech too.
Simple english grammar helps you building the sentence ;)
Oh, I'm sorry. Did not read that you want meaningful sentences.
You can use the tips above to check the grammar of the sentences too ;)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
if is not in PHP, is possible use some command line tools which convert PO file into some structured format e.g. XML or some other which I can simple process in PHP?
Update: As of 2018/05, the best options are:
https://github.com/oscarotero/Gettext
https://symfony.com/doc/current/components/translation.html
https://docs.zendframework.com/zend-i18n/translation/
See http://www.phptherightway.com#i18n_l10n_title
There are some:
https://github.com/jyxo/php/tree/master/Jyxo/Gettext
https://github.com/clinisbut/PHP-po-parser
http://code.google.com/p/php-po-parser/
http://pear.php.net/package/File_Gettext/redirected
http://drupalcode.org/project/drupal.git/tree/HEAD:/core/lib/Drupal/Component/Gettext
The last one is part of Drupal, and it's probably the most maintained.
Some simple regular expressions will allow you to parse .PO/.POT files. I did a similar thing recently. Take the following regex from a script I have recently written:
$poMsgIdAndMsgStrRegex = '/^#\s*(.+?)\nmsgid "(.+?)"\nmsgstr "(.+?)"/m';
This does only capture the final comment line but it has so far been suitable for my purposes. You may need to adapt it.
Anyway, you can use the above regex with preg_match_all() to capture all MsgId and MsgStr strings into an array of matches. Once you have the array then you can put it into any format you wish.
There may be libraries for doing this but I have not seen any.
Edit: You may also want to check out the PHP class for converting.po files .mo format that is referred to in the 'possible duplicate' comment. It doesn't sound like it will solve your problem (since you want to convert .po files to XML), but it is worth examining anyway. It helped me a lot.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I want to know the PHP code for Word to HTML conversion. When we retrive the Word document from the database and display in the frontend, the Word document should display as HTML page.
wvware
I don't completly understand your request but I think you can try TinyMCE for PHP, it's a Web based Wysiwyg editor, where all you type and format will be saved as HTML code, you can even paste and convert Word documents.
So like symcbean said, the best way to do is wvWare, otherwise,you could hardcode a class yourself, but it will be a difficult path.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Does anyone here know of good batch file code indenters or beautifiers?
Specifically for PHP, JS and SGML-languages.
Preferably with options as to style.
The following page has code on it to tidy Javascript (written in javascript as well):
http://www.howtocreate.co.uk/tutorials/jsexamples/JSTidy.html
There are various ways to tidy SGML based files (i.e. XML) - HTMLTidy will often do the trick, and there are various 'pretty print' implementations in various languages out there.
And finally a link to a web site with PHP code for pretty printing PHP: http://tobyinkster.co.uk/blog/2007/07/17/php-pretty-printer/
For HTML/XML HTML Tidy is the best option:
http://tidy.sourceforge.net/