void set_lparname(char *name) { if (gsysinfo_init_flg == FALSE ) get_gsysinfo(NULL); set_static(gsysinfo.lparname, name); }
//===================================================================================== // // * Function : defence() // * Description // 두 개의 스레드를 생성해 하나로는 target_ip로 ARP Request 패킷을 보내고 다른 하나로는 // 보낸 Request 패킷에 대한 Reply 패킷을 필터링해 전역변수 packets에 저장하도록 한다. // 전역변수 packets에 저장 된 ARP reply 패킷 중 ARP Spoofing 공격자가 아닌 IP를 가지는 // 패킷을 찾는다. 찾은 패킷의 IP 주소와 MAC 주소를 set_static 함수를 사용해 ARP table에 // static으로 설정한다. //===================================================================================== int defence(int index) { HANDLE handles[2]; int i,largest=0; char att_mac[18]; char infolog[250]; getTargetIP(index); sprintf_s(att_mac,18,"%02x-%02x-%02x-%02x-%02x-%02x",attk_mac[0],attk_mac[1],attk_mac[2],attk_mac[3],attk_mac[4],attk_mac[5]); init(); handles[0] = CreateThread(NULL,0,listen,(LPVOID)target_ip,0,NULL); handles[1] = CreateThread(NULL,0,request,(LPVOID)target_ip,0,NULL); WaitForMultipleObjects(2,handles,true,2000); for(i=0; i<5; i++) { if(packets[i].cnt != 0 && memcmp(packets[i].sf_mac,att_mac,18)!=0) { sprintf(msg_mac,"%s",packets[i].sf_mac); sprintf(msg_ip,"%s",packets[i].sf_ip); if(set_static(packets[i])){ sprintf(infolog,"[Info] Static setting complete. TargetIP:%d.%d.%d.%d %02X:%02X:%02X:%02X:%02X:%02X -> %02X:%02X:%02X:%02X:%02X:%02X", target_ip[0],target_ip[1],target_ip[2],target_ip[3],att_mac[0],att_mac[1],att_mac[2],att_mac[3],att_mac[4],att_mac[5], target_mac[0],target_mac[1],target_mac[2],target_mac[3],target_mac[4],target_mac[5]); log(infolog); SendMessage(hC1,WM_SPOOF, SM_RESUME_THREAD, NULL); return 1; } } } log("[Info] Static setting failure"); SendMessage(hC1,WM_SPOOF, SM_RESUME_THREAD, NULL); return 0; }
void set_loadparm(char *name) { if (gsysinfo_init_flg == FALSE ) get_gsysinfo(NULL); set_static(gsysinfo.loadparm, name); }
// ========================================================================== int main(int argc, char * argv[]) { BLOCK_S * block_ptr=NULL; BITMAP * pcxbmp = NULL; FILE * in, * out; char strtmp[256], pcxfilename[256], * ptr; long b, t, w, h; enum {PT_FA, PT_FS, PT_WU, PT_WD, PT_MAX}; int pcx_idx, i; struct { char * name; long w; long h; int col; } pcx[PT_MAX]; // header & syntaxe printf("DT1EXTR v 0.97 beta, by Paul Siramy, Freeware\n" "=============================================\n"); if (argc == 1) { printf("syntaxe : dt1extr <file.dt1> [-pal <file.dat>]\n"); exit(0); } // palette & atexit() if (strcmp(argv[2], "-pal") == 0) load_palette(argv[3]); else { printf("opening default palette\n "); load_palette("d2pal\\act1.dat"); } // dt1 file in = fopen(argv[1], "rb"); if (in == NULL) { printf("can't open %s\n", argv[1]); exit(1); } else printf("opening %s\n", argv[1]); read_dt1_header(in); read_blocks_headers(in); for (t=0; t<glb_block_number; t++) read_tiles_of_block(in, t); fclose(in); allegro_init(); set_color_depth(8); atexit(dt1con_exit); memset(pcx, 0, sizeof(pcx)); pcx[PT_FA].name = "fa"; // floor animated pcx[PT_FS].name = "fs"; // floor static pcx[PT_WU].name = "wu"; // walls up pcx[PT_WD].name = "wd"; // walls down ptr = argv[1]; i=strlen(ptr) - 1; while ((i >= 0) && ( * (ptr+i) != '\\') && ( * (ptr+i) != ':')) i--; if (i != 0) i++; strcpy(strtmp, ptr+i); strtmp[strlen(strtmp) - 4] = 0; strcat(strtmp, ".ini"); out = fopen(strtmp, "wt"); printf("saving %s\n", strtmp); strtmp[strlen(strtmp) - 4] = 0; // start of ini fprintf(out, "nb_blocks = %li\n\n", glb_block_number); // check the size of each pcx for (b=0; b<glb_block_number; b++) { block_ptr = glb_block + b; // set some flags if ( ((block_ptr->direction == 3) && (block_ptr->orientation == 0)) || ((block_ptr->direction == 5) && (block_ptr->orientation == 15)) ) { // floor set_floor(block_ptr->f); if (block_ptr->animated) { set_animated(block_ptr->f); } else set_static(block_ptr->f); } else { // wall set_wall(block_ptr->f); if (block_ptr->orientation & 0xF0) set_wall_down(block_ptr->f); else set_wall_up(block_ptr->f); } // boxsize h = block_ptr->ysize; if (h < 0) h = - h; if (is_wall(block_ptr->f)) h += 32; // 1 worldstone down wall need more border w = block_ptr->xsize; // place the block in the pcx pcx_idx = -1; if (is_floor(block_ptr->f)) { h = 80; if (is_static(block_ptr->f)) pcx_idx = PT_FS; else if (is_animated(block_ptr->f)) pcx_idx = PT_FA; } else if (is_wall(block_ptr->f)) { if (is_wall_up(block_ptr->f)) pcx_idx = PT_WU; else if (is_wall_down(block_ptr->f)) pcx_idx = PT_WD; } if (pcx_idx != -1) { block_ptr->pcx_n = pcx_idx; block_ptr->pcx_x = pcx[pcx_idx].w; if ( (pcx_idx == PT_FA) || (pcx_idx == PT_FS) ) { block_ptr->pcx_y = 80 * (block_ptr->pcx_x / 800); block_ptr->pcx_x = block_ptr->pcx_x % 800; } pcx[pcx_idx].w += 160; if (pcx[pcx_idx].h < h) pcx[pcx_idx].h = h; pcx[pcx_idx].col++; // ini fprintf(out, "block = %li\n", b); fprintf(out, "pcx_file = %s\n", pcx[pcx_idx].name); fprintf(out, "pcx_x = %i\n", block_ptr->pcx_x); fprintf(out, "pcx_y = %i\n", block_ptr->pcx_y); fprintf(out, "direction = %08lX\n", block_ptr->direction); // fprintf(out, "flags = %08lX\n", block_ptr->flags); fprintf(out, "y_delta = %i\n", block_ptr->y_delta); fprintf(out, "tile_sound = %i\n", block_ptr->tile_sound); fprintf(out, "animated = %i\n", block_ptr->animated); fprintf(out, "orientation = %08lX\n", block_ptr->orientation); fprintf(out, "main_index = %08lX\n", block_ptr->main_index); fprintf(out, "sub_index = %08lX\n", block_ptr->sub_index); fprintf(out, "frame = %08lX\n", block_ptr->frame); fprintf(out, "unknown = %08lX\n", block_ptr->unknown); fprintf(out, "floor_flag1 = %02X %02X %02X %02X %02X\n", block_ptr->sub_tiles_flags[20], block_ptr->sub_tiles_flags[21], block_ptr->sub_tiles_flags[22], block_ptr->sub_tiles_flags[23], block_ptr->sub_tiles_flags[24] ); fprintf(out, "floor_flag2 = %02X %02X %02X %02X %02X\n", block_ptr->sub_tiles_flags[15], block_ptr->sub_tiles_flags[16], block_ptr->sub_tiles_flags[17], block_ptr->sub_tiles_flags[18], block_ptr->sub_tiles_flags[19] ); fprintf(out, "floor_flag3 = %02X %02X %02X %02X %02X\n", block_ptr->sub_tiles_flags[10], block_ptr->sub_tiles_flags[11], block_ptr->sub_tiles_flags[12], block_ptr->sub_tiles_flags[13], block_ptr->sub_tiles_flags[14] ); fprintf(out, "floor_flag4 = %02X %02X %02X %02X %02X\n", block_ptr->sub_tiles_flags[5], block_ptr->sub_tiles_flags[6], block_ptr->sub_tiles_flags[7], block_ptr->sub_tiles_flags[8], block_ptr->sub_tiles_flags[9] ); fprintf(out, "floor_flag5 = %02X %02X %02X %02X %02X\n", block_ptr->sub_tiles_flags[0], block_ptr->sub_tiles_flags[1], block_ptr->sub_tiles_flags[2], block_ptr->sub_tiles_flags[3], block_ptr->sub_tiles_flags[4] ); fprintf(out, "\n"); } } for (i=0; i<PT_MAX; i++) { if (pcx[i].w > 0) { if ((i == PT_FA) || (i == PT_FS)) { if (pcx[i].w > 800) { pcx[i].h = 80 * (1 + pcx[i].w / 800); pcx[i].w = 800; } } pcxbmp = create_bitmap(pcx[i].w, pcx[i].h); clear(pcxbmp); if (pcxbmp != NULL) { for (b=0; b<glb_block_number; b++) { block_ptr = glb_block + b; if (block_ptr->pcx_n == i) { if (is_floor(block_ptr->f)) draw_block(pcxbmp, block_ptr->pcx_x, block_ptr->pcx_y, b); else { if (is_wall_up(block_ptr->f)) draw_block(pcxbmp, block_ptr->pcx_x, pcx[i].h, b); else draw_block(pcxbmp, block_ptr->pcx_x, 96, b); } } } } sprintf(pcxfilename, "%s-%s.pcx", strtmp, pcx[i].name); printf("saving %s\n", pcxfilename); save_pcx(pcxfilename, pcxbmp, & the_pal); destroy_bitmap(pcxbmp); } } fclose(out); // end printf("done\n"); return 0; }
inspector_param_t::inspector_param_t( const std::string& id) : param_t() { set_static( true); set_id( id); contents_ = 0; }
static_param_t::static_param_t( const std::string& name) : param_t(name) { set_static( true);}
static_param_t::static_param_t() : param_t() { set_static( true);}