I don't have any use for this myself, not being a server admin, but I thought it might be interesting to try...
DISCLAIMER: I don't know that much about assembly programming or the program used; so this may make your computer melt down, steal your credit card numbers, turn your computer into a monster that eats your dog, and so on.
Short version: open a copy of mb_warband_dedicated.exe (version 1.132) with a hex editor, search for the hex string "8d4ffe83c40483f9", the next number should be "3e" (62 in decimal): change this to whatever you please; the next numbers might be "7734", and after that it should be "8d50fe83fa" and then another "3e": change this to match the other number changed. So the string should look something like "8d4ffe83c40483f9
3e77348d50fe83fa
3e", with the ones to change marked red.
From my interpretation of the assembly code 2 is subtracted from the input value, which is then checked to be greater than the constant (3e) - if so it fails, if not it continues. So you could in theory set it to "ee" (23
and the game would allow you to set values between 2 and 240; but in practice it seems any values above "7f" (127, biggest 7 bit number, 0 based) break the code somehow so any number is taken as valid input - so you could set it to 7f and have the max players safely limited to 129, or you could set it to "80" (12
or above, but then make sure you don't start a server with a max of 43,000 players or something. The server error message will not be changed - the code for that didn't look like it would be a straightforward modification of constants. I haven't tested this properly with a client, so it might crash - I'll leave it to others to find out.
I used the program
Cheat Engine to find this out: I started the dedicated server without any script, ran "set_max_players 5 5", started cheat engine, attached to the server and searched for 5, set_max_players and searched again... until I found the two locations that kept matching (actually there were 3 but the last one was quite far away from the other 2, and got set to 0 on server "start"), then I right clicked on one and selected the option to see what code modifies the value, then ran set_max_players in the server window again; then scrolled up a bit and tried to decipher the assembly. I then tried to figure out the offsets for the hex editor to find the location of the code in the binary, but niether of the memory address or the "module offset" (whatever it is, exactly) were correct; so I just searched for some of the preceeding binary code, which seemed to be correct at the first match. The code I posted above should hopefully remain the same for later versions, unless taleworlds deliberately obfusticates it - apart from the "7734" bit, possibly.
Starting to wonder whether the taleworlds people would not like this to be posted... probably should have asked first. Oh well, too late. It's not like it describes how to cheat them; rather, they might get more sales from players being attracted to additional larger servers.