Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Lambchops

Pages: 1 ... 93 94 [95] 96 97 ... 112
1411
Mods & Development / Re: Nerd's Corner
« on: March 20, 2017, 12:46:36 PM »
RE-PURPOSING COMMON PORTS FOR WC2
Maybe some programmer should change the ports in the files from war2 : instead 6112-6119 make it on a port range which are usually open.
That could help a lot for all !!!

This is a nice idea, but I'm pretty sure it wouldn't work in most cases. There MAY be a solution here for some people, depending on their gear/connection, IMHO it's unlikely, but if you want to try....

The first thing I should point out is that you can already select your game port via the CE installer.

This is the only port you need to worry about (6112 by default).

The 6112-6119 thing is a misnomer which was probably introduced into some docs that were being written at the same time BNE was being written and before they had the final IPX --> UDP conversion sorted out. When you are in a game you may be getting WC2 game packets on a variety of ports, depending on whether any of the other players have changed their default port. THIS DOES NOT MATTER for hosting, it is all taken care of by hole punching. It's only that single game port that is the issue.


RELEVANT STUFF
1) “open” is an over-simplification. Ports are not “open” or “closed”.

2) Routing tables aren't made to assume that there is only one end user connected to them, even if that is all there is. The job they are doing is to try to find the right place to send each packet.

3) What we tend to refer to as “opening” a port is adding a rule to the routing table to tell it to send traffic on that port to a particular place (our WC2 computer).

4) If we can't do that then we need to give the router some kind of hint to let it know we want those packets.

5) Even for common ports, packets are not just forwarded without the router having more information, as per (2) above they still don't know where to send it. The only ports for which this is done are called “Multicast” ports.



MULTICAST:
In theory a router receiving a packet on a multicast port will re-transmit it to all nodes downstream. I'm sure you can all guess what these ports were used for 99% of the time – yes, either spam or hacking. As a result most servers do not re-transmit multicast traffic, they just ditch it without a second thought. So apart from all the other logistical issues there would be with using one of these ports, you can bet if your provider is not letting you add a simple routing rule for one port, there's no way they will be sending you multicast traffic.

SO, USING COMMON “OPEN” PORTS:
Let's use the example of a very common port that handles UDP traffic, port 53, which is the port for DNS. Anything accessing the network using domain names needs to use DNS to translate the name (i.e. server.war2.ru)  into an IP address (i.e. 145.233.94.234), which is what the network protocol actually uses.

So a router has 3 computers attached to it, with people using web-browsers. Every time one of the 3 users loads a page, the address of the page (i.e. Forum.war2.ru) will be looked up using a DNS, then the HTML for that page is loaded which might include another 10 embedded items, like images, youtube vids or whatever, that are all hosted on different sites, and the HTML has named addresses in it so an additional DNS lookup may be required for each one of these. But even if the 3 computers are all using the same DNS server, they will all get the correct responses to their queries returned to them (and only them).

How? Well for UDP traffic in general ( DNS is UDP ) the router just keeps track of which computer was the last one to send a packet OUT to a given address on a given port, then when any traffic arrives from that address on that port, it sends it back to that computer – this is where the “hole punching” thing comes in...... but for the case where our 3 users are all simultaneously loading pages with 10-20 DNS lookups each, things would still get messed up.

So, in addition to that, for commonly used ports that are reserved for known protocols  like 53, 80 ,443 etc. the LAN router, and/or the relevant local client service will often also be doing some amount of port translation. i.e. The to:/from: port numbers on the packets will be different. DNS servers are usually dedicated to just that single job and will accept requests on a broad range of ports, not just 53. They just check if any incoming traffic on any port is a valid DNS request, then if so, respond to it. So computer A will be talking to the DNS server on port 53:100 and computer B will be using 53:1987 or whatever. i.e. 'A' sends requests with “To Port: 100” and “From Port: 53” then the DNS server will respond with  “To Port: 53” and “From Port: 100” so the LAN router will send it back to the correct node, where it will end up on port 53 and go to the correct service (DNS).

So you can see that even for the most commonly used UDP service port: the DNS port #53, in some cases NONE of the external traffic will actually be on port 53, and regardless of that, when some random packet turns up from an unknown address on port 53, even if the local router accepts it as being valid DNS traffic, it still doesn't know if it should be sent to computer 'A', 'B' or 'C', and as I have said, the fact that there may be only one computer connected locally usually does not change this. If the router can't find a valid reason to send a packet to a node, it won't. That's its job.

TRY IF YOU WANT:
So if you want, you can try changing you game port to 21, 25, 53, 80, 123, or 443. Perhaps even 37, 43,  67, 68, 137, 143 or 8080, and just hope that there is some kind of exception built into the upstream routing.

However this approach also requires all other players in a game to be able to reliably send you WC2 data over these ports, and the chances of NOBODY having these ports either A) blocked, B) running on stateful or app-layer firewalls, or C) being controlled by protocol specific daemons, seem fairly remote.

BEST BET:
For the people who are having issues because they are using some kind of mobile service that reduces it's bandwidth by tracking its routing upstream of the end-user, I think your best bet for something that is might possibly “sneak through” and not get butchered by everyone else's firewalls might be one of these: 


    2195 - Apple Push Notification Service
    3689 - iTunes, AirPlay
    4488 - Apple WACS
    5223 - Apple Push Notification Service
    5228 - Google play store,  Android cloud messaging

As a wild stab-in-the-dark, I'd try 4488 first.

But this is just if you want to try and hope, I don't really think there is much chance of it working.

**and using an Apple port definitely wouldn't work through an Apple phone, or probably not even if there was an Apple phone connected anywhere on the network.**

1412
.... with an emphasis of parding new players. Anyone who is interested please post bellow.

Side note Its unreasonable to think that we can grow this server without allowing new players to play.........

This is an excellent idea, well done  :)

Sadly I'm not in a position to be able to commit to any set times right now, but I will definately try to host some games like this when I find the time to do some gaming.


1413
Mods & Development / Re: Nerd's Corner
« on: March 20, 2017, 09:41:50 AM »
Hey  :)
Sorry I've been MIA for a few days, thanks for posting that output.
Have made a self checking version.

It takes a SS then goes back through every screen in reverse order and gets it again, then checks if it's the same as the one from the first pass. If anything doesn't match it gets that screen again taking extra time/precautions and hopefully making sure that it has the right image. It's hard to tell because it just never fails on my machine.

Please try it out. It will also produce a small text file called "SSgrab.txt" that will look something like this:
Code: [Select]
Assuming single player mode.
Map Dimensions 128x128
Image aquired in 0.09 seconds
Check/re-aquire in 0.06 seconds
GdiplusStartup returned Ok
GdipGetImageEncodersSize returned Ok
GdipGetImageEncoders returned Ok
GdipCreateBitmapFromGdiDib returned Ok
GdipSaveImageToFile returned Ok
GdipDisposeImage returned Ok
GdiplusShutdown returned Ok

Checking GDI+ output
GDI+ confirmed OK

GDI+ check/Save (png) 0.36 sec
Complete. Total Time 0.52 seconds

Assuming single player mode.
Map Dimensions 128x128
Image aquired in 0.09 seconds
Check/re-aquire in 0.06 seconds
GdiplusStartup returned Ok
GdipCreateBitmapFromGdiDib returned Ok
GdipSaveImageToFile returned Ok
GdipDisposeImage returned Ok
GdiplusShutdown returned Ok
Save (png) 0.16 sec
Complete. Total Time 0.31 seconds

Which should help me track down why the PNG save is failing, if you can please post the results.




1414
Mods & Development / Re: Nerd's Corner
« on: March 17, 2017, 06:25:15 AM »
   ... and damnit there's still a glitch at 3 o'clock  grrrrr.

I'm going to have to inject this thing aren't I? ..... at least the anti-virus software will finally be right calling it a worm  ;D


1415
Mods & Development / Re: Nerd's Corner
« on: March 17, 2017, 06:17:02 AM »
it's glorious, ty lamby!!!

Cool bananas  :D  ... and thank YOU for your testing and reports - that stuff is invaluable. Wish I knew why the GDI+ stuff isn't working though  :-\  oh well... another day.

What sort of image capture / save times is it reporting?

(Beetle Island people, great chaotic map!)

Yeah, fun map. I think we've done that one once or twice  :)

1416
Mods & Development / Re: Nerd's Corner
« on: March 16, 2017, 03:58:38 AM »
OK have updated it again HERE

Hopefully it should work Ok on all systems now, hard to tell "flying blind" because it works here when I test it...

Should save to PNG but will check for correct GDI+ behavior and switch to BMP if there's a problem.

Have added a check to ensure that the screen offset is being set correctly, which should stop "glitchy" images being saved. If this is still happening I will just have to slow down the capture loop until it is stable. This will allow time for WC2 to have the screen updated. IDK why this is happening as in theory that function should not return until the screen has been updated - and that is how it works on my computer, but it's hard to guess how another version of Windows is behaving.

Another thing I thought could *MAYBE* be a problem is the cpusavior program, so I tried it with that running and on my system all it did was make the image capture take 10x as long - but it still worked properly, however if you are still having problems and you are using the "cpusavior" app please also test without that.

Please let me know how it goes.

Thanks for your help.  :)

1417
Mods & Development / Re: Nerd's Corner
« on: March 15, 2017, 06:37:35 AM »
Great, thanks very much for doing that, and no don't be concerned that you are causing me problems, you are helping me. :) If I have written routines to do basic things like save an image, I need to know that they will work as they are supposed to, and if not, find out why, and fix the issue.

I really should have a bunch of VMs set up running different versions of windows so I can test things out to make sure that they are work in all environments, but at the moment I am limited to just my main machine, which remains, as it has been for many years, a 32 bit XP installation. So until told otherwise I can only assume that when things work on that that they will work everywhere else.

So just making sure I have this right: you have tried with 2 different systems, both running win7, both fail to save a .png image, and you have now ruled out your monitor/desktop configuration as a factor? Also using the original version that saves to .BMP you have, at lest some of the time, had glitchy SSs saved that are not constructed correctly on both systems?



1418
Mods & Development / Re: Nerd's Corner
« on: March 14, 2017, 05:30:09 AM »
Ok. For the first problem, where the PNG file is 0 length, would you please run the attached .exe on any machine that has this problem then post the results.

the .exe will produce a small text file, which should look something like this:

Code: [Select]
Class ID   : {557cf400-1a04-11d3-9a73-0000f81ef32e}
Format ID  : {b96b3cab-0728-11d3-9d7b-0000f81ef32e}
Codec      : Built-in BMP Codec
Module     :
Description: BMP
File Types : *.BMP;*.DIB;*.RLE
MIME Type  : image/bmp

-------------------------------------------

Class ID   : {557cf401-1a04-11d3-9a73-0000f81ef32e}
Format ID  : {b96b3cae-0728-11d3-9d7b-0000f81ef32e}
Codec      : Built-in JPEG Codec
Module     :
Description: JPEG
File Types : *.JPG;*.JPEG;*.JPE;*.JFIF
MIME Type  : image/jpeg

-------------------------------------------

Class ID   : {557cf402-1a04-11d3-9a73-0000f81ef32e}
Format ID  : {b96b3cb0-0728-11d3-9d7b-0000f81ef32e}
Codec      : Built-in GIF Codec
Module     :
Description: GIF
File Types : *.GIF
MIME Type  : image/gif

-------------------------------------------

Class ID   : {557cf405-1a04-11d3-9a73-0000f81ef32e}
Format ID  : {b96b3cb1-0728-11d3-9d7b-0000f81ef32e}
Codec      : Built-in TIFF Codec
Module     :
Description: TIFF
File Types : *.TIF;*.TIFF
MIME Type  : image/tiff

-------------------------------------------

Class ID   : {557cf406-1a04-11d3-9a73-0000f81ef32e}
Format ID  : {b96b3caf-0728-11d3-9d7b-0000f81ef32e}
Codec      : Built-in PNG Codec
Module     :
Description: PNG
File Types : *.PNG
MIME Type  : image/png


1419
Mods & Development / Re: Nerd's Corner
« on: March 13, 2017, 02:44:53 PM »
actually they're still coming out goofy without 2nd monitor (I thought it worked right at one point though)
I noticed crazy eights ss was buggy too

hmm. Ok thanks for letting me know.
This is unrelated to the  0 length .PNG problem.
(That is probably a bad class ID or encoders not installed properly type of thing)

Its good that you have text on the screen in your SS, from that I can see that the bitmap is being constructed and saved correctly.

The problem is that the screen offset is not being set correctly.
Could I ask what OS you are using and are you pressed for processor time... like VM or older comp? I should be able to get this fixed with a little bit of tinkering, but right now i have to be at court in 5 hours and I'd like to spend at least 1 of them asleep. bbl
 


1420
Mods & Development / Re: Nerd's Corner
« on: March 13, 2017, 01:03:03 PM »
I am a huge scrub

won't hear of it   :-X

and need help Lamby.

OMG Sorry I missed this post and didn't reply mousey.

I opened the app then went to single player custom scenario and pressed F6 key and it did the scrolling around thing & saved the file as .png but it's 0kb. halp

The original version that saves a bmp works though (after I figured out that having a 2nd monitor makes it do odd things... :D)

Well firstly, cool I'm glad you got something working.

The first version just uses bread&butter file writing to save the internal buffer straight to a .BMP file. Very uncomplicated.

The next version uses the Windows GDI+ interface (GDIPlus.dll) to save to either PNG, JPG or BMP. This is done via the GdipSaveImageToFile func for all 3 image types, the format depends on the CLSID and encode paramaters you pass it.

It doesn't use anything that should interact with the screen or the desktop AFAIK, so in theory a dual monitor system should have no effect.

That being said, I don't have a dual monitor system to test it out on, and "in theory" has never stopped windows from messing things up before, however I would still check if there are any GDI+ updates of fixes released for your operating system.


1421
Server.War2.ru / Re: [resolved] SS missing from Lone
« on: March 13, 2017, 12:01:22 AM »
 ;)

1422
Server.War2.ru / Re: [resolved] SS missing from Lone
« on: March 12, 2017, 05:42:01 PM »
Conspiracy Theories??

I normally like creativity but you're really starting to worry me now.

Here.. look i'll send RamChops home will that make you feel better?

Sorry about him, but u know u really can't go around accusing people of stuff like that... it's just bad form. That's why I don't do it eh?

1423
Mods & Development / Re: Easycompany
« on: March 12, 2017, 03:58:15 PM »
here's one hf  ;)



Going to try to find this weekend to set up my VM on a lan! I will try to make a good quality video of this nasty risk. I would recommend we remove the save feature from multiplayer! We said too much in public I know a few people who are not trust worthy who can pull this off. It might not auto execute but still we should remove save because it will drop the exe in their war2 map sav folder.....

Cool, just remember your old mate Lamby when they start handing out briefcases full of cash  ;D

... and yeah if you can just make an exe appear on someones puter - can you imagine back when there was 50K players on bnet every day? You would have had hundreds of people randomly clicking ok it...     Hey! now I think about it, I should make one with a .PUD file icon :P that would be really tricky.... give it some interesting name that stands out so people want to look at it. hehe.. then OMG they will see my HELLO WORLD MESSAGE! AAARRRRGGHHHH!!  ;D


Anyway... such silliness aside, for custom mods if you write a mod editor that produces a custom section, I can write a mod app that will impliment them.
Just have it produce a file like this
Code: [Select]
4 BYTES "MODS"
DWORD  size of mods (file size-8)
DWORD  NumberOfMods

   then a list of mods like this:

DWORD  memory offset
BYTE    number of bytes
N*BYTE  data to write at offset

obviously it will be restricted from writing to executable sections otherwise this could be use to inject malicious code - so that won't be happening  :)

I understand about 80 percent of that code. Is that how asm is setup? What does Number of Mods means a variable? Or is it like a sub name? How does the data look that I want to write in hex??? Sorry me and many people here have 0 knowledge in such low level programming.

Well it's kinda pseudocode.
its just a description of how I suggest the file (which would end up as a PUD section) be laid out.

A "DWORD" or double-word is a 4 byte number
A BYTE is a byte

so for example if you make and app that allows you to change spell MP costs and some other stuff... the app would have to know the EXE offsets that correspond to each spell or whatever, and what the appropriate format is to write the values, so the user changes some stuff and saves their work, then the app has decided it needs to do this:

(just makin stuff up for example)

     it needs to write a 0xFF byte at offset 0x444555

and these: 0x01, 0x02, 0x03, 0xAB, 0xBA at offset 0x432100

and 0xC0, 0xDE at offset 0x439991


then if you were using the file format I suggested you would create a file and wite this to it:

"MODS" ... the signature, which ends up as 0x4D, 0x4F, 0x44, 0x53
... not that u really need to know that - just write the 'M' 'O' 'D' 'S', it all ends up the same.

next is a DWORD (4 bytes) for the size of the data (this combination of a  4CC and a Section size is for the PUD format)

so we dont know the data size yet - you could pre-calculate it, but in this situation it's much easier to just write the data, see how big it is then go back and fill in the size at the end.

so...

"MODS"
(skip 4 bytes)

then DWORD number of mods,
which in ths case is 3, so it would end up
03:00:00:00

then we write the 3 mods, each one is like this:
    DWORD  memory offset
    BYTE    number of bytes
    N*BYTE  data to write at offset

so the first one is:

55:45:44:00
01
FF

the second one is
00:21:43:00
05
01:02:03:AB:BA

and the last one is

91:99:43:00
02
C0:DE

so at this stage we have:
Code: [Select]
4D:4F:44:53:00:00:00:00:
03:00:00:00:55:45:44:00:
FF:00:21:43:00:01:02:03:
AB:BA:91:99:43:00:C0:DE:
and we can see that the file is 32 bytes long.

Those 4 zeros at the end of the first line there is where we need to write our DWORD size value.

But we just want the length of the data, not the the "MODS" and the size DWORD itself - they are 4 bytes each so we subtract 8 from the total size (32-8=24) so now we just need to write a DWORD 24 (0x00000018) there
so seek to file offset 4 then write 18:00:00:00 and we're done:

4D:4F:44:53:18:00:00:00:
03:00:00:00:55:45:44:00:
FF:00:21:43:00:01:02:03:
AB:BA:91:99:43:00:C0:DE:


In a hex editor it might look something like this
Code: [Select]
4D:4F:44:53:18:00:00:00:03:00|MODS↑.....
00:00:55:45:44:00:FF:00:21:43|..UED. .!C
00:01:02:03:AB:BA:91:99:43:00|....½║æÖC.
C0:DE:                       |└▐

of course the actual values would depend on what offsets you can track down in the exe, and what you wanted to change them to. All the normall PUD stuff is there, but you can just set them in the .PUD anyway.

Swagier had some interesting ideas a while back like:
edit spells(for example change that orge got heal not lust)
mission objective
edit upgarde( u can change dmg +2 -> +4)
changing side train knights as orc

the mission objective I have no clue about, but this sort of stuff should be do-able.

Then the app at the other end would be locating the WC2 process, monitoring its status and waiting for you to enter a game, then when a game starts it would check the PUD for a "MODS" section and if it finds one, write the changes to the WC2 process, and back up the previous values to be restred after the game.

I would also want to include some kind of safeguard so that players couldnt shut down the app half way through a game then leave mods in place for other games on normal maps. In most cases this would probably just cause desync/drop but no doubt if there is some sneaky little exploit some gremlin will find it... so I would want to prevent this, probably by diverting part of the WC2 program flow through the app so if its terminated unexpectedly then WC2 would crash... or if you just shut it down normally it would remove it's hook and exit gracefully.

Probably this project would be an excellent candidate for dll injection.  8)



1424
Server.War2.ru / Re: [resolved] SS missing from Lone
« on: March 12, 2017, 03:39:09 PM »
hell if i know, but lamb is humping claw looool

Yeah that's actually my cousin RamChops, he looks after that kind of thing for me... but can you see the expression on that little polish peon's face? I think he was really enjoying the attention for a while, but now he's not so sure ;D

1425
Server.War2.ru / Re: [resolved] SS missing from Lone
« on: March 12, 2017, 01:41:55 PM »
CLAW IS MY FAV GUY

HE IS SO AWESOME, AND HIS PENIS IS REALLY ENORMOUS

WHAT A LEGEND

 :fro:



Pages: 1 ... 93 94 [95] 96 97 ... 112