reaver: quote soreau "ah woops, don't leak memory either"

This commit is contained in:
Zero_Chaos 2012-10-13 23:30:36 +00:00
parent 636bf92c2b
commit 58a8e0c6d1
2 changed files with 80 additions and 94 deletions

View file

@ -2,7 +2,7 @@ AUX 0001-wpscrack-big-endian-fixes.patch 21117 SHA256 dd44a966424a5c207db5658374
AUX 0002-Use-the-current-directory-for-storing-and-loading-se.patch 1672 SHA256 8decc8453936f10df1ec5af8ce5322c527853ed7fde3fccf2996d92f64ecc691 SHA512 3fa5ba7e0b3784bfe4d28efa63dd9ef64d496c33d6538d38fc867c669ac978d1a4512334a1103eb9bf0f898e12b839dbe287bddad6238f54979b17ba0ffd095e WHIRLPOOL a944fecee470fc57fe2211a335d08ead2a7976839b7da2159b49929e93c1d2027ca64b0ad8ed49bb4ceeed67ed1407f7a1d626316ca536d1972aeb4e540e22a6
AUX 0003-wash-wpsmon-use-less-useless-spaces-in-output-to-fit.patch 1604 SHA256 02ecd27516806917d2970d67f408139f50644bb3bdfed94300ea4703e295b468 SHA512 8960223cf5f84a7b999b2b79d195d2b5e690dd66338f97549a931df9b4156823190b03f37702317fb3af6aac91712b46866dba955b0ee60f6dd4a3630f1b7fd5 WHIRLPOOL 8f4335d3786e893ceedf6a6949903b6fecd29566746ccb4fd95e57236195ea23fa68548e769d1e1cbd3ac2e8cfca2167b99242d7a3a086460f47676ce9191df4
AUX 0004-wash-probe-request.patch 687 SHA256 66b27d18353ba85612dfd4806a730ca004027a86b80de5bc8a0c869800e429a9 SHA512 cdf1bf370b2915dd87afe93aa8df4db0ad9124eb076ce1398a384afe1b5e66c9499c891857b21ec7897d0d52a1fea0ad635163d796eca981db7956d8bb7c7c6e WHIRLPOOL ae381d3598721151beed7eef46678e0208baf64905bb1200eda547be7d500ea7d6a9cd27033385982cea0b117bca167848f6c5fd93808000ec792f95b10a04e8
AUX 0005-soreau-show-status.patch 2287 SHA256 a472939ace7d62fe75a9cafaf0547272ab9119c1faa2eb37d84c2c67f0eaa9eb SHA512 3dc7441dcb4d6d65251abb1ca143e85a4677b7ec1613e9fa8705b4b964b32ea829021b2f73746148812b145e57f13f45575f928db592697aa53d7324f4d39150 WHIRLPOOL cb7b8b78d102ae8140ae2640c3c27eee37550e55eadf21f9c056cb8ffb37e87a5047a93b25d7229439505cde6623f993da90f7ca13754a0b1b9683d86b7ced13
AUX 0005-soreau-show-status.patch 2438 SHA256 606faa72ee07dfa5ce855fffc192d8792b2ef6c8c0045dd5c98a8e5ec49aa0e2 SHA512 7c49859d4a36d1110849a1190ef5781452318cefcf24cb5ce173d4a7e55eb2d72846a8855c7781a8319ec109ba449d90a0f59f6fdc793bc419f3c4f8528a04a7 WHIRLPOOL 285f6b908b4a27b751c72fd5dce6cd69f9788cc228c5e6181512b3745c17160409d1fa968d61b708da2a1eb33cc2351ee61a11b7bc99e0fa162f344531aa4c93
DIST reaver-1.4.tar.gz 766603 SHA256 add3050a4a05fe0ab6bfb291ee2de8e9b8a85f1e64ced93ee27a75744954b22d SHA512 59f2d6f8aa6228988ce5d1c102d9a48b2a23e582ff3d9afe39d7c9717b7e4be059362fdd21a3e5f5d59948df1a7616acdaa6df20f139e9c5aa9bd673f764dfbc WHIRLPOOL 5b8a91fe97bf08d6dc544b41dd04baedb9488d574e9a0695d8babeb34a9fa5acc81cfc86899c600b12b445cb83887dfbb18517f2ebbd5d34ab27e8c9ce428e38
EBUILD reaver-1.4-r1.ebuild 840 SHA256 81c5f8f881ed104f4aa3e3e9128db188735e1679eb1e311a34c160281886efbf SHA512 4beab059d5ac2de4bd45e7382f9e67c1387fd984c8dba6efe0789528123b665b29d6f3874ad2dd4a4c4366a1c4d0fc3f06a09da158ed91aef5ea56390c4b1a2d WHIRLPOOL cb8016ade89e0f0b4b72be9507552305a5496c650555e34b016628f1841bcb26d9474be955871875cb9c535b07825b46f8501b65060258b6fb625576164e239c
EBUILD reaver-1.4-r2.ebuild 840 SHA256 16736e23ac82278415473f69d31bf28abe85e99d765d27ff8b32d62533fabd0b SHA512 98f1925f91580aa65dd529050c46612450d851cec19235786ceaf3bf2d189046288c1cfcc8c199b74f2e6975848b1e00053398e33debdcbd0520e8934a65cbb6 WHIRLPOOL e95c22325fae15a31508b7597e88da821bd79e81cb05915509483e340ee10b5dfc92c037803deaef32d671eef3d77dfa51b7aebd4d0af17adcc26aefe795c955

View file

@ -1,93 +1,79 @@
Index: cracker.c
===================================================================
--- cracker.c (revision 113)
+++ cracker.c (working copy)
@@ -285,18 +285,61 @@
}
}
+char *get_max_time_remaining(int average, int attempts_remaining)
+{
+ char *max_time, hours[60], minutes[2], seconds[2];
+ int max_hours = 0, max_minutes = 0, max_seconds = 0;
+
+ max_time = malloc(64);
+
+ if(!max_time)
+ exit(-1);
+
+ if(average)
+ {
+ max_seconds = attempts_remaining * average;
+ if(max_seconds > 60)
+ {
+ max_minutes = max_seconds / 60;
+ max_seconds -= max_minutes * 60;
+ }
+ if(max_minutes > 60)
+ {
+ max_hours = max_minutes / 60;
+ max_minutes -= max_hours * 60;
+ }
+
+ if(max_seconds < 0 || max_minutes < 0 || max_hours < 0)
+ return NULL;
+
+ sprintf(hours, "%d", max_hours);
+ sprintf(minutes, "%s%d", max_minutes > 9 ? "" : "0", max_minutes);
+ sprintf(seconds, "%s%d", max_seconds > 9 ? "" : "0", max_seconds);
+
+ sprintf(max_time, "%s:%s:%s", hours, minutes, seconds);
+ }
+ else
+ {
+ return NULL;
+ }
+
+ return max_time;
+}
+
/* Displays the status and rate of cracking */
void display_status(float pin_count, time_t start_time)
{
float percentage = 0;
int attempts = 0, average = 0;
+ int attempts_remaining = 0;
time_t now = 0, diff = 0;
struct tm *tm_p = NULL;
- char time_s[256] = { 0 };
+ char time_s[256] = { 0 }, *max_time;
if(get_key_status() == KEY1_WIP)
{
attempts = get_p1_index() + get_p2_index();
+ attempts_remaining = 11000 - attempts;
}
/*
* If we've found the first half of the key, then the entire key1 keyspace
@@ -305,10 +348,12 @@
else if(get_key_status() == KEY2_WIP)
{
attempts = P1_SIZE + get_p2_index();
+ attempts_remaining = 11000 - attempts;
}
else if(get_key_status() == KEY_DONE)
{
attempts = P1_SIZE + P2_SIZE;
+ attempts_remaining = 0;
}
percentage = (float) (((float) attempts / (P1_SIZE + P2_SIZE)) * 100);
@@ -335,7 +380,12 @@
average = 0;
}
+ max_time = get_max_time_remaining(average, attempts_remaining);
+
cprintf(INFO, "[+] %.2f%% complete @ %s (%d seconds/pin)\n", percentage, time_s, average);
+ cprintf(INFO, "[+] Max time remaining at this rate: %s\n", max_time ? max_time : "(undetermined)");
+ free(max_time);
+
return;
}
<html>
<head>
<title>hastebin</title>
<link rel="stylesheet" type="text/css" href="solarized_dark.css"/>
<link rel="stylesheet" type="text/css" href="application.css"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="highlight.min.js"></script>
<script type="text/javascript" src="application.min.js"></script>
<meta name="robots" content="noindex,nofollow"/>
<script type="text/javascript">
var app = null;
// Handle pops
var handlePop = function(evt) {
var path = evt.target.location.pathname;
if (path === '/') { app.newDocument(true); }
else { app.loadDocument(path.substring(1, path.length)); }
};
// Set up the pop state to handle loads, skipping the first load
// to make chrome behave like others:
// http://code.google.com/p/chromium/issues/detail?id=63040
setTimeout(function() {
window.onpopstate = function(evt) {
try { handlePop(evt); } catch(err) { /* not loaded yet */ }
};
}, 1000);
// Construct app and load initial path
$(function() {
app = new haste('hastebin', { twitter: true });
handlePop({ target: window });
});
</script>
</head>
<body>
<ul id="messages"></ul>
<div id="key">
<div id="pointer" style="display:none;"></div>
<div id="box1">
<a href="/about.md" class="logo"></a>
</div>
<div id="box2">
<div class="save function"></div>
<div class="new function"></div>
<div class="duplicate function"></div>
<div class="raw function"></div>
<div class="twitter function"></div>
</div>
<div id="box3" style="display:none;">
<div class="label"></div>
<div class="shortcut"></div>
</div>
</div>
<div id="linenos"></div>
<pre id="box" style="display:none;" tabindex="0"><code></code></pre>
<textarea spellcheck="false" style="display:none;"></textarea>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27329119-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>