aluigi wrote:
If I'm not in error (if I remember well I already looked in this thing for curiosity in the past) the limitation is hardcoded in the executable.
I mean that there is no a simple check like "if players major than 8 quit" but ALL the buffers and structures are limited to 8 players which means that a "#define MAX_PLAYERS 8" in the source code is transformed in many differences and less memory allocated in the final executable.
hi luigi ;)
well, you are right. the 8 users are hardcoded.
there are about 6 places where the hardcoded size is used.
also the userinfos are some static aligned struct.
here is some howto if one wants to test aroud with more than just 8 users.
i moved it to some unused area to get 512 users limit
Code:
Ventrilo v2.3.1 Linux
--------------------------
remap:
- 'ventrilo_srv.prop',0 08174DF8 -> 08174A0A (replace 3 times F84D1708 with 0A4A1708)
- one useless '%s' 081751F8 -> 081749F4 (replace 1 time F8511708 with F4491708)
old usertable area -> new usertable area | replace all with
|
081960C8 08174A20 start | C8601908 -> 204A1708
081960CC 08174A24 entry_1 | CC601908 -> 244A1708
081960E8 081755F4 end | E8601908 -> F4551708
081960EC 081755F8 num_clients | EC601908 -> F8551708
=> 0x2F5 users! limited to 0x200 (for checking with 3-byte opcode "cmp dh,01")
replacing with
---------------- -------------
CMP EDX, 08h -> CMP DH, 02h
[83 FA 08] 7D 0E 8B 08 replace with 80 FE 02
[83 FA 08] 7C F2 33 C0 replace with 80 FE 02
8B 15 EC 60 19 08 [83 FA 08] replace with 80 FE 02
8B 15 EC 60 19 08 [83 FA 09] replace with 80 FE 02
8B 15 EC 60 19 08 [83 FA 08] 0F 8E C9 00 00 00 => CMP DH, 01h!! replace with 80 FE 01
8A 80 79 01 00 00 84 C0 74 01 [47] => INC EDX (47) -> NOP (90)
i also started with ventrilo 3.0.2. but it is crashing when a user disconnects.
well, ok. i just looked at the disassembled code, and tried to remap the area
like i did in the old version.
but when it didnt worked on the first try, i stopped further analysis.
its for sure just some small stupid mistake.
maybe some other person is interested in analyzing and patching the code.
Code:
Ventrilo v3.0.2 Linux
--------------------------
function: [?]
.text:0804EA97 83 FA 08 cmp edx, 8
[83 FA 08] 7D 0E 8B 08 -> 80 FE 02
.text:0804EAA5 83 FA 08 cmp edx, 8
89 48 FC 83 C0 04 [83 FA 08] -> 80 FE 02
function: ServerConnAccept
.text:0804E923 83 FA 09 cmp edx, 9
8B 15 E8 98 1B 08 [83 FA 09] 7C 3E -> 80 FE 02
function: check_server_limits
.text:0804EA3C 83 FA 08 cmp edx, 8
8B 15 E8 98 1B 08 [83 FA 08] -> 80 FE 02
.text:0804EA4E 83 FA 09 cmp edx, 9
8B 15 E8 98 1B 08 [83 FA 09] 7C 05 -> 80 FE 02
add segment:
offset 0x30 0x17 -> 0x18 (add one segment)
append to file:
DE000000010000000300000000002008840B07000020000000000000000000000400000000000000
(segment with 0x2000 bytes data starting at offset 00070b84)
then append 0x2000 times 0x00
mapping:
.bss:081B98C4 [usertable_start] -> 08200000 C4981B08 -> 00002008
.bss:081B98C8 [usertable_entry1] -> 08200004 C8981B08 -> 04002008
.bss:081B98E4 [usertable_end] -> 08201FF8 E4981B08 -> F81F2008
.bss:081B98E8 [num_users] -> 08201FFC E8981B08 -> FC1F2008
of course i discourage you from using a crac*ed version of ventrilo.
but it might be useful for some errrhm tests :)