Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1001771 // fullBotScan

JavaX fragment (include)

1  
srecord ScannedBot(S helloString, S address) {}
2  
3  
static L<ScannedBot> fullBotScan() {
4  
  ret fullBotScan("");
5  
}
6  
7  
static L<ScannedBot> fullBotScan(S searchPattern) {
8  
  new L<ScannedBot> bots;
9  
  for (ProgramScan.Program p : quickBotScan()) {
10  
    S botName = firstPartOfHelloString(p.helloString);
11  
    boolean isVM = startsWithIgnoreCase(p.helloString, "This is a JavaX VM.");
12  
    boolean shouldRecurse = swic(botName, "Multi-Port") || isVM;
13  
    
14  
    if (swic(botName, searchPattern)) bots.add(new ScannedBot(botName, "" + p.port));
15  
16  
    if (shouldRecurse) try {
17  
      Map<Number, S> subBots = (Map) unstructure(sendToLocalBotQuietly(p.port, "list bots"));
18  
      for (Number vport : subBots.keySet()) {
19  
        botName = subBots.get(vport);
20  
        if (swic(botName, searchPattern)) 
21  
          bots.add(new ScannedBot(botName, p.port + "/" + vport));
22  
      }
23  
    } catch (Exception e) { e.printStackTrace(); }
24  
  }
25  
  ret bots;
26  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv, yanjaxplzisb

No comments. add comment

Snippet ID: #1001771
Snippet name: fullBotScan
Eternal ID of this version: #1001771/3
Text MD5: 5370c984902a0259638859fcf18a7229
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-25 22:38:21
Source code size: 948 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 611 / 842
Version history: 2 change(s)
Referenced in: [show references]