Donnerstag, 21. Mai 2015

[C#] A little bit of networking ... and other stuff

A friend got an old printer which doesnt support WLAN. The distance to the router is to big to establish a physical connection. Luckily there is a desktop PC next to the printer which is connected to the LAN!
I wrote a little tool where the server part recieves a XPS file and forwards it to the default printer of the machine it is running on.

To demonstrate it I setup a Virtual Machine which is in a network with my main system. Since the VM doesnt have any printer connected the file is send to the Microsoft XPS writer but watch yourself:

It is one of those typical programs you write in an hour with the intention to just use it yourself. In conclusion there is no error checking or whatsoever but who will use such a tool any way in a time where every printer has WLAN support right? :D
Incase you are interested in the source code you can download it here:,58353234/CS_BlockDruck.rar/
 I feel no need to explain anything here since everything should be understandable easily but if you have a question you can ask any time over IRC / Skype.

Got another idea for a tiny tool? I enjoy writing those tiny programs. Send a request if you like.

More Updates?

I am stil playing WoW from time to time and I am also stil working on tools here and there. Some time ago I shared my 1.12.1 bot which interacts with WoW using Read/WriteProcessMemory aswell fasm_managed to inject Assembly code at a specific address.
Main reason for sharing the bot was fading motivation and a push for me to finally start going injected and using C# code to call functions instead of writing assembly code. Probably one or two months ago I started another attempt at writing a bot for 1.12.1 but this time as a fully injected clr application which means that my program is loaded into WoWs address space instead of running on its own.
As a little example of how easy life can be being injected I got a little snippet for you:

 /// <summary>  
 /// Set the target by guid  
 /// </summary>  
 private delegate void SetTargetDelegate(ulong guid);  
 private static SetTargetDelegate SetTargetFunction;  
 internal static void SetTarget(ulong parGuid)  
      if (SetTargetFunction == null)  
           SetTargetFunction = Memory.Reader.RegisterDelegate<SetTargetDelegate>((IntPtr)0x493540);  


 internal static void SetTarget(UInt64 guid)  
      lock (Call_Lock)  
           byte[] guidBytes = BitConverter.GetBytes(guid);  
           String[] asm = new String[]   
                     "push " + BitConverter.ToInt32(guidBytes, 4),  
                     "push " + BitConverter.ToInt32(guidBytes, 0),  
                     "call " + (uint)0x493540,  
           //Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + " Calling Set Target");  
           Inject.InjectAndExecute(asm, true);  

There is no more dealing with calling conventions beside telling your program which one to use. Functions are much easier to detour and in general every aspect of interacting with WoW will be easier and cleaner. For example I run my whole bot logic inside the DirectX Endscene now Instead of injecting new ASM for each function I want to call.
Personally I dodged going injected for a long time because I was to lazy to learn how to do it but afterall I can only advice it to everyone who downloaded my previous bot and started with the same bullshit I did.

Once I find a few days I will start explaining how to be inprocess using C# and also continue a few things like the WoW hacking tutorials I started to write previously but stopped somewhere inbetween. If you want to try your luck I can advice IceFlake by Miceiken from Ownedcore which was a very big help getting started. Thanks to Miceiken at this point :).

Speaking about programming I will also release a little multihack with all hacks I could use on Nostalrius without being catched by Warden or any other mechanic they got in place: All kind of tiny movement hacks which shouldnt be detected even after the tool is released.
Also I updated the link to the Render Disabler (sorry for being that late).

Non-programming stuff

I got a chance to travel around the world a bit. If everything works out well I will get myself a new camera and try to record a few freerunning runs here and there whenever I find a good spot.