Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: running the CPU and GPU on a Raspberry pi.(Searching..) and I ran across this.

  1. #1

    running the CPU and GPU on a Raspberry pi.(Searching..) and I ran across this.

    In the spirit of leaving a trail of breadcrumbs through the forest, I�m going to run through some of what I learned along the way.

    Excellent article and has links to even more interesting documentation for the pi.

    As a side note or tip for running mono C# code on raspberry pi.
            static Object FileLock = new Object();
            static void Main()
    	        //Get the Directory This is executing from example "WorkFolder\XmlData\..."
    	        System.IO.DirectoryInfo workingDirectory = new System.IO.DirectoryInfo(System.IO.Directory.GetCurrentDirectory());
    	        //## requirement of being in the directory where the xml files to be parsed are.##
    	        //read all the ProductData*.xml files in the current directory
    	        System.IO.FileInfo[] xmlFiles = workingDirectory.GetFiles("ProductData*.xml");
    	        //Create A thread Array equal to the number of files to parse
    	        //Create a thread for each file found to parse in parallel
    	        for (int i = 0; i < xmlFiles.Length - 1; i++) {
    		        System.Threading.Thread T = new System.Threading.Thread(() => thread_parser(xmlFiles[i].FullName));
    This will not work if the number of files and there sizes exceeds the memory Threshold of the device.
    There are a few ways to accomplish this.
    Use a global counter and to only allow a certain number of threads to be running in the code.
    Remove the threading part all together and go for a function loop on thread_parser.
    Implement a lock in thread_parser to only allow 1 thread.

  2. #2
    Teach, Not Flame Kayaker's Avatar
    Join Date
    Oct 2000
    Blog Entries
    Still reversing that esoteric stuff huh? Good on ya, keep it up
    Sorry, we still haven't banned you after all these years

  3. #3
    Nah, just got a pi for Christmas and jumped into what I thought was interesting in the community and wanted to see if I could write code to run on the GPU of the pi.

    The code is the head of the implementation to parse GS1 1worldsync product data from manufacturers into NCR Power Menu for a distributor.(boring shit right there..)

    Towards the last comment:
    Self made shackles work best for me, breaking out of them is really hard and time consuming unlike anything you or others could have done to me.

    This is supposed to be off-topic so I should have avoided your question and just rambled on..

  4. #4
    I dont see any way I could ban him.

    Anyway, interesting stuff regarding pi.

    Learn Or Die.

  5. #5

    Post GPGPU with WebGL more in depth usage examples

    Enjoy the reading, any further information or usage experimentation notes would be greatly appreciated if a link was posted here.

  6. #6

    Embedding ascii to a image to make image that is self documenting.

    So taking a idea from stenography and encoding 1 picture inside another using the least significant byte of a pixels RGB...So this is all well and good when combining 2 images, but what if I don't want to embed a image into another image. what if I want to embed Ascii into a image. I suppose the same method would work, read a the image data for RGBA, find the least significant byte and overwrite it with desired code for 1 value. But what if we don't care who see's my modifications to the image, this opens up RGB for storage in the full scale. To accomplish this I take image and load it into a canvas with image.width - 2 and image.height -2 to allow for a 1 pixel border region for data. I then directly associated ascii keycodes to color codes and write the desired text to the image. 1 of the most annoying things I ran across while implementing this functionality was CORS(cross origin resource sharing policy) and SORS(Same origin resource sharing Policy) which describe a set of permissions for editing and modifying content downloaded from the web.It seems chrome chokes on this much more then even IE, firefox or opera.

    The next stage of this is taking the 2d data fragments and storing them into a 3D cylinders inner surface with multiple viewpoints set onto a line that runs up the middle of the cylinder. IE each viewpoint has a range of accessible data located next to that view point to which I can send a query to retrieve the data in question via reducing the overall space the query has to look through.

  7. #7
    Teach, Not Flame Kayaker's Avatar
    Join Date
    Oct 2000
    Blog Entries
    If you're into transmogrifying files, you might be interested or already seen some of these examples of binary polyglots. (under Binary Files)

    A few of the polyglots are actual issues of the International Journal of Proof-of-Concept or Get The Fuck Out (PoC||GTFO)
    (google 'pocgtfo' for some analysis of how to manipulate the file contents)

    Issue 03 is, at the same time, several file formats: PDF/ZIP/JPG/Audio (raw AFSK)/PNG (encrypted with AES)
    Issue 04: TrueCrypt, PDF , ZIP polyglots
    Issue 05: Flash, Iso, PDF, ZIP polyglots

    Pretty amazing stuff. I found that Foxit might open the pdf format if Adobe doesn't, and 7-zip or or 'nix unzip could handle it when the extension is changed to .zip.

    Would be interested in seeing your ascii-in-jpg if you get a poc.


  8. #8
    Code is written in Javascript, and I have posted it to a few times to get idea's on improvements for my code.

     <!DOCTYPE html>
    <canvas id="myCanvas" width="200" height="200" style="border:1px solid #d3d3d3;">
    Your browser does not support the HTML5 canvas tag.</canvas>
    <p id="Start"></p>
    <p id="End"></p>
    <div id="img_store" style="display:none"></div>
    <textarea id="WriteThis"></textarea>
    <button onclick="loadImageAndWrite('download.png');">Load Image and Write Text</button>
    var ColorizeData = function(canvas) {
    	this.canvas = canvas;
    	this.charToDecTable = {};
    	this.decToCharTable = {};
    ColorizeData.prototype.initTables = function(){
    	var charDecPairs = [
    		["	","09"],
    		[" ","32"],
    	for(i=0; i < charDecPairs.length; i++)
        		var pair = charDecPairs[i];
        		var cchar = pair[0];
        		var dec = pair[1];
        		this.charToDecTable[cchar] = dec;
        		this.decToCharTable[hex] = cchar;
    ColorizeData.prototype.textToColor = function(arg){
        var context = this.canvas.getContext("2d");
        var upDown = 1;
        var upDown1 = 1;
        var leftRight = 0;
        var cindex = 0;
        arg = arg.toLowerCase();
    	if(cindex + 1 < arg.length)
    		if(cindex + 2 < arg.length)
    			context.fillStyle = rgbToHex(this.charToDecTable[arg.charAt(cindex)],this.charToDecTable[arg.charAt(cindex+1)],this.charToDecTable[arg.charAt(cindex+2)]);
    			cindex += 3;
    			context.fillStyle = rgbToHex(this.charToDecTable[prop], this.charToDecTable[arg.charAt(cindex+1)],0);
    			cindex += 2;
    		context.fillStyle = rgbToHex(this.charToDecTable[prop],0, 0);
    		cindex +=1;
    	if(context.fillStyle != "#000000")
            	if(cindex/3 < this.canvas.width) {
            	    context.fillRect(leftRight, 0, 1, 1);
            	    leftRight += 1;
            	    if(upDown < this.canvas.height) {
            	        upDown += 1;
            	        if(upDown1 < this.canvas.height) {
            	            leftRight = 0
            	            upDown1 +=1
            	            if(leftRight < this.canvas.width -2) {
            	                leftRight+= 1;
        }while(cindex < arg.length)
    function componentToHex(c) {
    	var hex = Number(c).toString(16);
    	return hex.length == 1 ? "0" + hex : hex;
    function rgbToHex(r, g, b) {
    	return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
    ColorizeData.prototype.colorToText = function(arg) 
    	var text = "";
    	var context = this.canvas.getContext("2d");
    	var size = 0;
    	for(var index = 0;index<4;index++)
    		switch (index)
    			case 0:
    				imgData = context.getImageData(0,0, this.canvas.width,1);
    				size = this.canvas.width;
    			case 1:
    				imgData = context.getImageData(this.canvas.width - 1,1, 1,this.canvas.height - 1);
    				size = this.canvas.height - 1;
    			case 2:
    				imgData = context.getImageData(0,1, 1,this.canvas.height - 1);
    				size = this.canvas.height - 1;
    				imgData = context.getImageData(1,this.canvas.height -1, this.canvas.width-2, 1);
            			size = this.canvas.width - 2;
    		for(var i = 0; i < size; i += 4) {
    			//hide this pixel.[i + 3] = 0;
    			//check red for 0
    			if([i + 0] != 0)
    				text += this.decToCharTable[[i + 0]];
    			//check green for 0
    			if([i + 1] != 0)
    				text += this.decToCharTable[[i + 1]];
    			//check blue for 0
    			if([i + 2] != 0)
    				text += this.decToCharTable[[i + 2]];
    			case 0:
    			case 1:
    				context.putImageData(imgData,this.canvas.width - 1,1);
    			case 2:
    			case 3:
    				context.putImageData(imgData,1,this.canvas.height -1);
    	document.getElementById(arg).innerText = text;
    ColorizeData.prototype.loadImage = function(arg) {
    	var canvas = document.getElementById("myCanvas");
    	var context = canvas.getContext("2d");
    	var img = new Image();
    	img.onload = function () {
    	    context.drawImage(img, 0, 0, 200, 200);
    	img.src = arg;
    ColorizeData.prototype.loadImageAndRead = function(arg) {
    	var canvas = document.getElementById("myCanvas");
    	var context = canvas.getContext("2d");
    	var img = new Image();
    	img.onload = function () {
    	    context.drawImage(img, 0, 0, 200, 200);
    	img.src = arg;
    ColorizeData.prototype.loadImageAndWrite = function(arg) {
    	var canvas = document.getElementById("myCanvas");
    	var context = canvas.getContext("2d");
    	var img = new Image();
    	img.onload = function () {
    	    context.drawImage(img, 0, 0, 200, 200);
    	img.src = arg;
    ColorizeData.prototype.clear = function() {
    	var context = this.canvas.getContext("2d");
    	context.clearRect(0,0,this.canvas.width, this.canvas.height);
    var Colorizer = new ColorizeData(document.getElementById("myCanvas"));
    Colorizer.textToColor("Testing 123...");
    Example of (1st) generation image is attached. This code is 3rd generation, translation tables changed so it wont work for this image.
    1st generation code is here.

    Thanks for all the decent reading material.
    Attached Images Attached Images  
    Last edited by BanMe_2; February 3rd, 2015 at 10:53. Reason: thirds.

  9. #9
    I want to learn, even while I am dying.
    Last edited by BanMe_2; February 10th, 2015 at 16:12.

  10. #10
    I have more than the arts in mind kayaker.

    I plan to use this concept to reduce http traffic on the web, by embedding content into images and have the client parse the images with javascript.

    (Re)think my idea's please.
    Last edited by BanMe_2; December 30th, 2015 at 18:09.
    What is old will become new again.

  11. #11
    Super Moderator
    Join Date
    Dec 2004
    Blog Entries

    I want to learn, even while I am dying.
    are you still stuck on the damapi ??
    iirc you opened another thread here on the same damapi
    if you are struck use this powershell script

    i don't know if it works with your data or not in the link but it works with the damapi pdf example correctly

    $a = New-Object System.Security.Cryptography.HMACSHA256
    $a.key = [Text.Encoding]::ASCII.GetBytes($args[1])
    run as

    :\>powershell -f hmack.ps1 "/V2/assets?app_id=12345& ipGLN=1234567891234&senderGLN=1234567891234&TIMESTAMP=2012-12-06T13:08:02Z" 6
    the input and output can be verified from page 36 of the damapi.pdf (retrieved around the date of the other damapi thread)

  12. #12
    That's a pretty small implementation. But I finished it all. got it all working synchronously and then there like ok use it to upload 20k images.. it was to slow so I looked into speed it up with asynchronous tasks and was unable to get it to work properly so I reverted to type and wrote a html page with a javascript multi drop file handler for image files, made the load code wrap in a xml file with some predefined variables, zipped them up and sent them on as2 connection. :] But thank you for the effort good citizen. I appreciate it.

    On a side note I have been thinking about something, that you might be able to help me with, has to do with javascript.

    But I was wondering, if an idea I had was feasible, from my laymen perspective could 2 RGBA webgl pixels be combined to form a register?Could we define 0 as black or white and perform shader operations on the set color values? I mean couldn't we colorize a pair of RGBA 4 bytes each into a qword length buffer and store data in registers, and compare how far away from black or white it is to determine the value of it. The pixel paired registers could then be used to process instructions from some source.
    I should patent the ideas I have, but I choose to just give them to the winds...
    Last edited by BanMe_2; December 29th, 2015 at 11:39. Reason: fixed for accuracy and completed train of thought.
    What is old will become new again.

  13. #13
    Super Moderator
    Join Date
    Dec 2004
    Blog Entries
    well to be frank i have no idea my JavaScript know-how is very limited
    just because i wanted to get into my head something before i can make a half or quarter sensisible reply i followed into the
    link (first generation thingy) a brief glance tell me you want to make some thing like this

    Add-Type -AssemblyName *sys*forms*
    Add-Type -AssemblyName System.Drawing
    $fg=($f=New-Object Windows.Forms.Form).createGraphics()
    $f.Width=350;$f.Height=70;$f.Text="Banme Games" 
    "y"="#306050";"z"="#408070";" "="#50a090";"-"="#60c0b0";"="="#70e0d0";"0"="#800000";
    $in = "hello ban me @ 42 d0wnning greet!";Name:  banme.PNG
    Views: 189
    Size:  6.4 KB
    $i = $j = $k = 0;
    $p = @(0..50);
    $in.ToCharArray() | %{ 
    $p[$j++] = New-Object Drawing.Solidbrush ($table.Item($_.tostring()))
    } $f.ShowDialog() > null

  14. #14
    Excellent stuff this what looks to be javascript, but probably is powershell.. excellently small. but no, I meant in a canvas with a pixel and a fragment shader.

    This link might help in clarifying, what I am talking about.

    I also heard about storing data in images even if they are resized? Is there further reading material for this as well? I need to be less of a librarian or something.. sorry.

    Also greetz to you blabberer, much respect for the truths.

    001010 0000a0 005090 005090 0080f0 50a090 000040 801000 000020 000040 00004 0000a0 00b060 0000a0 00b060.

    and yes blabber png is the extension I misspoke before.but it doesn't matter, because you don't need to load and render the image on the canvas, because the canvas is the image. That's some "there is no spoon" shit right there if I ever saw it..
    Last edited by BanMe_2; December 29th, 2015 at 12:15.
    What is old will become new again.

  15. #15

    Capturing a exe file in color and symbolically executing the colored representation.

    That is what I want to do, and I would like to do that in the gpu's renderings.So Not Image processing,processing in a image, emulated but realtime rendered. executing the input and giving a output instruction by instruction on something in that image and 'could' be rendered in a web page.

    scrape a concept™ from UNU project

    Maybe the question you ask yourself, is why the fuck does this bloke want to do any of this, what is his end goal, I have no fucking idea, but I do try and explore things and ideas differently because I wish to have my own. Even if it is coupling the many disparate and unrelated fields of my interests together.
    Last edited by BanMe_2; December 29th, 2015 at 11:55.
    What is old will become new again.

Similar Threads

  1. Searching commands
    By Bilal in forum OllyDbg Support Forums
    Replies: 4
    Last Post: July 17th, 2004, 03:02
  2. Searching Games
    By Woodmann in forum The Newbie Forum
    Replies: 15
    Last Post: June 5th, 2003, 17:59
  3. Searching for SentinelLM 7.0 SDK
    By Sope in forum Tools of Our Trade (TOT) Messageboard
    Replies: 0
    Last Post: July 13th, 2001, 13:22
  4. Searching for breakpoint(s)
    By bobik in forum Malware Analysis and Unpacking Forum
    Replies: 1
    Last Post: July 5th, 2001, 01:27
  5. Searching 4 ??
    By Critter in forum Malware Analysis and Unpacking Forum
    Replies: 2
    Last Post: March 12th, 2001, 09:47


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts