From 869a2de0490b517877270a0327e265adc3635362 Mon Sep 17 00:00:00 2001 From: orboditilt <45944072+orboditilt@users.noreply.github.com> Date: Tue, 8 Jan 2019 15:54:20 +0100 Subject: [PATCH] Remove option to set a fixed length inside the loader payload. --- wiiu_browserhax_common.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/wiiu_browserhax_common.php b/wiiu_browserhax_common.php index d3f02d4..f8afd24 100644 --- a/wiiu_browserhax_common.php +++ b/wiiu_browserhax_common.php @@ -29,7 +29,6 @@ if($filesysver == 540)$filesysver = 532; require_once("wiiuhaxx_rop_sysver_$filesysver.php"); -if(!isset($USE_FIXED_PAYLOAD_LEGNTH)) $USE_FIXED_PAYLOAD_LEGNTH = -1; if(!isset($payload_size)) $payload_size = 0x20000; //Doesn't really matter if the actual payload data size in memory is smaller than this or not. @@ -123,7 +122,7 @@ function generate_ropchain() function wiiuhaxx_generatepayload() { - global $wiiuhaxxcfg_payloadfilepath, $wiiuhaxxcfg_loaderfilepath, $USE_FIXED_PAYLOAD_LEGNTH; + global $wiiuhaxxcfg_payloadfilepath, $wiiuhaxxcfg_loaderfilepath; $actual_payload = file_get_contents($wiiuhaxxcfg_payloadfilepath); if($actual_payload === FALSE || strlen($actual_payload) < 4)return FALSE; @@ -131,12 +130,8 @@ function wiiuhaxx_generatepayload() $loader = file_get_contents($wiiuhaxxcfg_loaderfilepath); if($loader === FALSE || strlen($loader) < 4)return FALSE; - if($USE_FIXED_PAYLOAD_LEGNTH != -1){ - $len = $USE_FIXED_PAYLOAD_LEGNTH; - }else{ - $len = strlen($actual_payload); - } - + $len = strlen($actual_payload); + while($len & 0x3)//The actual payload size must be 4-byte aligned. { $actual_payload.= pack("C*", 0x00);