1

I've been given a project handled by a former coder in our organization. It's a php based application and it is Massive (as in tons of files everywhere). I'm trying to find a logo that's stored...SOMEWHERE in this mess, so I can replace it with the updated (and properly oriented, this one is flipped for some reason) one.

I don't know know which file this is of even if it's stored as a file. The only reference I have when I run the app through localhost the file is referenced like this

data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAACAAAAAhCAYAAAC4JqlRAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
WXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QcGBx4hG+DYTwAACgtJREFUWMOll9uTFcd9xz+/7p7L
mXPO3tjlIpbbYnERIAzCJZVAkSISy7LQyi7bcpKqPOYhj6n8A3rOm5/y4nen7JJMoLCtQECWbCVB
ChEGARIXIQkte2GXvZzLnJnp/uVhDypM+SWVrurq6eme/n67a7p//UFVLY+k6elpUdVMVUdVdUxV
m3+q3/83qWrqAHnkpQM2A08BOwALTAE3VXUGyIEAKOD7zw9SAKp+GfrtvXfffbd8/vnn9U94MPKI
8BpgF/A88CLweN/APeALYBpo9UX8Q2L06yXQ7ecS6ACzD31XAMtAW0S8qor0xTNgZ1/4OVXdL8jG
oD4tZy8gi5fBUoUghQZfGdEggmrQ1VmJgkjAS2XKlZ4Z3pHLY0c9Lu2qMo/XGTF+UYxZEMwfgPPA
lIgE15/5DuBvgFeALYFQs2KlM3ed6fd+wsDiWZoDiSsr4wRFDAiCPlhUAS8OU/XAJrh9/0g8HhE0
qAnqwZQVVBZtW7gAOOBtYMkBGXAQ+LYqu9GAMZbK97h35TTz1z5AGoYsUSw5QYUQTH/dFQVEBKce
0XuEzZOY8VewxrJ45WPJv5x2o9865OzIIHjfVMszAp8DV1R12QBDwG5VxkFBBAFatz9k4cpvoCzI
yyatMqGMUnJiOj6j5VNaPqblY9q+RrfXI69P4CZeJxnaiC97TP3iBFf/6Sfcv3QZBxgxAAOqegD4
JjBggI0QJsA30ICIULbnmPv4XynmL2PTmE4J91tKJ7f0SkO3gDw3tHuGTs/R6QRWyp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SEiW1Q0MgjjzTq3Fpf4aGqBNGmSZE2QiCCCGgFjEePAWoyxWBsz1VLqkePp9RlZcwgfJ2Sb
tjDw7ZeQwQEVrYIYuyQi/yHCz4DfOxGpVPUG8A6wyWCe0OBrG5o1/vrJbVyYXuF61+HEoRUoBsT2
eU6/5gJLRMt7fn5rjifXN/nRjpThI4fRbx0i1DO0KlWMbQOfAP8O/LeIdFw/rsz0QQHgqFf2OC3X
Hdm0Nv2Hw/vM+9NtEhcrioiIwOrteRVM9MFpgxhPHpTcK3lVkGZ1qqyOCWWwQZYRcwU4CZzr4x6P
suE6YLeih4L6J63YzZ1S63N5qavnGRkiTQNZP+Kah7HWCt4HKiMUIzXXSaztoRpAugi3gbPAaeCW
iJSrVKdqRCQAzM3NyejoaAKM9Al5HGj0jRqgCYz1IbbJqgn7EJx2gRVgqZ87fYDNgTvAVeCuiPgH
tv/IwCOYboHkIQHpM10K1Pri7qH20CfivJ+LvqkHGF/MzMyU69ev/yNM/1839e17yVG35QAAAABJ
RU5ErkJggg==

Sorry I don't know how to make the above small - but yes that's the file I need to change to an updated one. Any help on how to FIND this file and or references to it would be appreciated.

I'm using Ubuntu 14.04.

closed as off-topic by Romeo Ninov, Archemar, Anthon, Rui F Ribeiro, Stephen Rauch Jul 6 '17 at 13:09

  • This question does not appear to be about Unix or Linux within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    That is the image. – Michael Homer Jul 6 '17 at 7:47
  • Let me rephrase my question: as I mentioned, yes that is the image I need to replace. My question is how do I FIND it? If this isn't a file then it must be a base64 string IN a file right? Is there a way to find that string? – Weej Jamal Jul 6 '17 at 7:53
2

To search for the decoded image, base64-decode it to reference.png and to

for file in `find /your/app/root/path -iname "*png"`; do
  if `cmp -s reference.png "$file"`; then
    echo $file
  fi
done

If this doesn't find it, it maybe doesn't have a png suffix, so instead of -iname *png simply use -f. This may take a while though.

Not found? It will take even longer to search for the base64-encoded image by greping for a relevant substring:

grep -rI "WrOWqDHKv135ghOXbgIwsnsn2ycnGRheh" /your/app/root/path
  • That chunk is all header - might be better to use one from later on in the file (though the chances of having multiple 32x33 images around may be low). – Michael Homer Jul 6 '17 at 8:23
  • Good point. Changed the piece – Philippos Jul 6 '17 at 8:34
  • Just wanted to say I was able to solve this thanks to BOTH Philippos and @Tiggers answers. From Phillippos answer: grep was the key. From Tigger's answer: While the image weren't stored within <img> tags that did put me in the right direction. I eventually found the images stored within CSS files. Thanks to both of you for answering the question! I sadly can only choose 1 tick mark and since there's a modicum of pedantry in this sub - I chose the answer that closest matched my (now edited) question. But again, Thank you both! – Weej Jamal Jul 28 '17 at 10:07
2

I'm guessing the image is in a database or a utility / common page. Something that would be called on every page the image is on.

I would be looking for the code (PHP) that shows that logo. I'm also guessing it would be in an include(...) or require(...) file. Steps to find it:

  • Open the source code for a few pages in an editor that has the image on it.
  • Look for the <img tag. The tag is still required with base64 data images.
  • Drill back from each <img until you find the code that renders the logo.

If you are lucky, there will be a comment block on how to change it. That is what I would have done :]

Not the answer you're looking for? Browse other questions tagged or ask your own question.