Beispiel #1
0
$md5 = Common::getMD5("report");
$icon = Common::getInteger("icon");
$binary = "uploads/{$md5}.bin";
@ob_clean();
if (!file_exists($binary)) {
    $path = "img/computers.jpg";
    header("Content-Type: image/jpg");
    print file_get_contents($path);
} else {
    $cache_icon = "cache/{$md5}" . "_icon_" . $icon . ".bmp";
    if (!file_exists($cache_icon)) {
        $count = 0;
        $offset = 0;
        $size = 0;
        $b = new Binary($binary);
        $html = Pefile::call("res_offsets", $binary);
        preg_match_all("/RT_ICON (.+)/", $html, $i);
        if ($icon > count($i[1])) {
            die;
        }
        foreach ($i[1] as $icn) {
            $count++;
            if ($count == $icon) {
                list($va, $offset_d, $size, $offset) = preg_split("/\\s/", $icn);
                break;
            }
        }
        list($width, $height) = getIconWH($b, $html, $icon);
        //print "width: ".ord($width)." height: ".ord($height);
        $out = $b->headerOf("RT_ICON", $width, $height);
        $out .= $b->readBytesAtOffset($offset, $size);
Beispiel #2
0
if (file_exists($binary)) {
    if ($action == "res_offsets") {
        print $html_res_offsets;
        preg_match_all("/RT_ICON (.+)/", $html_res_offsets, $i);
        $count = 0;
        foreach ($i[1] as $icon) {
            $count++;
            list($offset_d, $size, $offset) = preg_split("/\\s/", $icon);
            print "<img src=\"?report={$md5}&icon={$count}\" class=\"img-thumbnail\" title=\"RT_ICON@" . $offset . "\">";
        }
        preg_match_all("/RT_BITMAP (.+)/", $html_res_offsets, $i);
        $count = 0;
        foreach ($i[1] as $bitmap) {
            $count++;
            list($offset_d, $size, $offset) = preg_split("/\\s/", $bitmap);
            print "<img src=\"?report={$md5}&bitmap={$count}\" class=\"img-thumbnail\" title=\"RT_BITMAP@" . $offset . "\">";
        }
    } else {
        $html = Pefile::call($action, $binary);
        print $html;
    }
} else {
    print "Binary not found.. removed?";
}
?>
					</p>
				</div>
			</div>
		</div>
	</div>
Beispiel #3
0
				<div class="col-md-10 column">
					<p>
						<?php 
if (file_exists($binary)) {
    if (preg_match("/^radare2\\/(rabin2|rahash2)/", $app)) {
        print Radare2::call($app, $fun, $binary);
    }
    if (preg_match("/^radare2\\/radare2/", $app)) {
        $functions = Radare2::r2_functions($binary);
        $codesize = Binary::codeSize($binary);
        $entrypoint = Pefile::entrypoint($binary);
        print Templates::Load("templates/art/drawing3.php", array("functions" => $functions, "codesize" => $codesize, "entrypoint" => $entrypoint, "md5" => $md5));
        print Templates::Load("templates/radare2/r2_functions.php", array("functions" => $functions, "md5" => $md5));
    }
    if (preg_match("/^pefile/", $app)) {
        print Pefile::call($fun, $binary);
    }
    if (preg_match("/^monodis/", $app)) {
        if ($fun == "presources") {
            print Templates::Load("templates/mono/presources.php", array("presources" => $presources, "binary" => $binary, "md5" => $md5));
        } else {
            print Mono::call($fun, $binary);
        }
    }
} else {
    print "Binary not found.. removed?";
}
?>
					</p>
				</div>
			</div>