28 Mar 2010 @ 11:15 AM 

ph(z)
Func
If 3.5>=z and 0<=z Then
(.49998132583533+z*(.25704798516144+z*(-.013028431968512+z*.013909872543518)))/(1+z*(ª.28527797782298+z*(.21079685756164+z*(-.027639384901111+z*.0029194748417015))))»z
Return z
EndIf

If -3.5<z and 0>z Then
z*-1»z
(.49998132583533+z*(.25704798516144+z*(ª.013028431968512+z*.013909872543518)))/(1+z*(ª.28527797782298+z*(.21079685756164+z*(ª.027639384901111+z*.0029194748417015))))»z
Return 1-z
EndIf

EndFunc

Posted By: admin
Last Edit: 28 Mar 2010 @ 11:15 AM

EmailPermalinkComments (0)
Tags
 21 Jan 2009 @ 9:27 PM 

I created this class to facilitate some routine tasks when modding or hooking software. If you dont know what hooking is or how to use .dll’s it is of no use to your. It also bridges the gap between oop and asm a little, I try to give you the best of asm in a oop format.

Features

  • Console – debugging console similar to cmd, it provides a easy i/o for target application data or information you need from your .dll
  • jmpPatch – most people know what a jmp patch is, this has your generic one
  • stripJmpPatch – this will place a jmpPatch to functions that are members of a class, they dont have to be naked.
  • keyhook – you can easily hook the window class or you can use getasynckeystate. You just pass it your function.
  • other stuff – message boxes and such

In a Nutshell

This class does all the work for you, just create the project and pass a function into the constructor and it will take care of the threading. The function you pass to it is the main function of the thread that is started, in this function you can handle key input or whatever manipulations you wish.

How to use

This is for use with Visual Studio, as I use masm syntax in the inline asm. Basically you make a VS c++ project of “.dll” type, then you include modtoolz.h class. If you dont know how to do that, just stop now. If you want a in depth “noob” tutorial, I wrote one here.

add these to your stdafx.h

#include <stdio.h>
#include <iostream>
#include <io.h>
#include <stdio.h>
#include <fstream>
using namespace std;

Everything happens when you call the constructor (as it should with oop). So in your main.cpp you could call the constructor like this

#include ModTools.h
// other stuff
// modtools constructor one
ModTools mt("window name", &myEngine);

If you did it like that you would have to have a function “myFunction” that you could handle events and keys. The function you pass into it with this constructor gets started in the thread, so when that function terminates, so does the thread. You need a while loop and some stuff like so

1
2
3
4
5
6
7
8
9
10
long WINAPI myEngine(long lparam)
{
while(1){																		// this goes forever, so your thread stays alive
Sleep(10);																// ~10 millisecond delay so it dont lag
// if they hit f12 turn on the console
if(GetAsyncKeyState(VK_F12) == -32767)
{
mt.Console();
}
}// end the while loop

that function would toggle the console on/off with the press of F12. Of course you could make it do any action based on any keys, for instance call a function inside the program, or change a memory value inside the program. Since you are inside the program in your .dll you can change anything or call the programs functions.

The above method is easy and does work fine; however, there is another constructor that you can also use which is more efficent. The second constructor (that you can use) hooks directly into the window, this allows you to handle key input better.

You can use the second constructor like so

1
2
3
#include ModTools.h
// second constructor
ModTools mt("brood war", &amp;KeyHandler);

In this case you can only pass it a keyhandler, anything that takes time to process that is in this “keyhandler” function will lag the target application instantly. If you wish to do heavy processing and queues and such either make a new thread or jmpPatch to another function in your code.

Anyway this is what a keyhandler function looks like

1
2
3
4
5
6
7
8
9
bool KeyHandler(int keyCode)
{
// Is key ~ pressed?
if (keyCode == VK_OEM_3)
{
// DO SOMETHING
}
return FALSE;
}

This second constructor is more advanced and I do not recommend you use it unless you know what you are doing. That said, the second constructor is the way to go if you want to make really good applications.

If you are still confused I made a tutorial on another site that is pretty informational. You can acess that here. In that tut I show how to use the modtools.h class to do stuff with the game starcraft.

You can download modtools.h here modtools-v02

Posted By: Michael
Last Edit: 21 Jan 2009 @ 09:27 PM

EmailPermalinkComments (0)
Tags
 21 Jan 2009 @ 9:27 PM 

I created this class to facilitate some routine tasks when modding or hooking software. If you dont know what hooking is or how to use .dll’s it is of no use to your. It also bridges the gap between oop and asm a little, I try to give you the best of asm in a oop format.

Features

  • Console – debugging console similar to cmd, it provides a easy i/o for target application data or information you need from your .dll
  • jmpPatch – most people know what a jmp patch is, this has your generic one
  • stripJmpPatch – this will place a jmpPatch to functions that are members of a class, they dont have to be naked.
  • keyhook – you can easily hook the window class or you can use getasynckeystate. You just pass it your function.
  • other stuff – message boxes and such

In a Nutshell

This class does all the work for you, just create the project and pass a function into the constructor and it will take care of the threading. The function you pass to it is the main function of the thread that is started, in this function you can handle key input or whatever manipulations you wish.

How to use

This is for use with Visual Studio, as I use masm syntax in the inline asm. Basically you make a VS c++ project of “.dll” type, then you include modtoolz.h class. If you dont know how to do that, just stop now. If you want a in depth “noob” tutorial, I wrote one here.

add these to your stdafx.h

#include <stdio.h>
#include <iostream>
#include <io.h>
#include <stdio.h>
#include <fstream>
using namespace std;

Everything happens when you call the constructor (as it should with oop). So in your main.cpp you could call the constructor like this

#include ModTools.h
// other stuff
// modtools constructor one
ModTools mt("window name", &myEngine);

If you did it like that you would have to have a function “myFunction” that you could handle events and keys. The function you pass into it with this constructor gets started in the thread, so when that function terminates, so does the thread. You need a while loop and some stuff like so

1
2
3
4
5
6
7
8
9
10
long WINAPI myEngine(long lparam)
{
while(1){																		// this goes forever, so your thread stays alive
Sleep(10);																// ~10 millisecond delay so it dont lag
// if they hit f12 turn on the console
if(GetAsyncKeyState(VK_F12) == -32767)
{
mt.Console();
}
}// end the while loop

that function would toggle the console on/off with the press of F12. Of course you could make it do any action based on any keys, for instance call a function inside the program, or change a memory value inside the program. Since you are inside the program in your .dll you can change anything or call the programs functions.

The above method is easy and does work fine; however, there is another constructor that you can also use which is more efficent. The second constructor (that you can use) hooks directly into the window, this allows you to handle key input better.

You can use the second constructor like so

1
2
3
#include ModTools.h
// second constructor
ModTools mt("brood war", &amp;KeyHandler);

In this case you can only pass it a keyhandler, anything that takes time to process that is in this “keyhandler” function will lag the target application instantly. If you wish to do heavy processing and queues and such either make a new thread or jmpPatch to another function in your code.

Anyway this is what a keyhandler function looks like

1
2
3
4
5
6
7
8
9
bool KeyHandler(int keyCode)
{
// Is key ~ pressed?
if (keyCode == VK_OEM_3)
{
// DO SOMETHING
}
return FALSE;
}

This second constructor is more advanced and I do not recommend you use it unless you know what you are doing. That said, the second constructor is the way to go if you want to make really good applications.

If you are still confused I made a tutorial on another site that is pretty informational. You can acess that here. In that tut I show how to use the modtools.h class to do stuff with the game starcraft.

You can download modtools.h here modtools-v02

Posted By: admin
Last Edit: 21 Jan 2009 @ 09:27 PM

EmailPermalinkComments (0)
Tags
 13 Jan 2009 @ 5:46 PM 

My first attempt at reproducing a rts in flash. There is a lot to it, you have to calculate the speed and angle of everything. In this one I replaced the cursor, but you can see the probes dont look quite right.

Posted By: Michael
Last Edit: 13 Jan 2009 @ 05:46 PM

EmailPermalinkComments (0)
Tags
Categories: Flash
 13 Jan 2009 @ 5:44 PM 

Made this a while back, its not very efficient but it looks neat

Posted By: Michael
Last Edit: 13 Jan 2009 @ 05:44 PM

EmailPermalinkComments (0)
Tags
Categories: Flash
 13 Jan 2009 @ 5:39 PM 

made this for testing my web server that is on 24/7, turns out it only cost me about $10 max to run it all month.

Posted By: Michael
Last Edit: 13 Jan 2009 @ 05:39 PM

EmailPermalinkComments (2)
Tags
Categories: Flash
 13 Jan 2009 @ 5:35 PM 
this will change the color of the tablecloth or the chaircover. It would be useful for a page where users buy stuff of different colors.
&amp;lt;a href=”http://www.zonemikel.com/Flash/ana.swf” target=”_blank” class=”new_win”&amp;gt;http://www.zonemikel.com/Flash/ana.swf&amp;lt;/a&amp;gt;
Posted By: Michael
Last Edit: 13 Jan 2009 @ 05:35 PM

EmailPermalinkComments (0)
Tags
Categories: Flash
 13 Jan 2009 @ 5:31 PM 

Since there is very little in the way of Unicode/ascii comparison, or Unicode in general Ive found that writing them myself can be very useful. This compares a Unicode string to a ascii string. It could be used the other way around but it will stop when it reaches the null char in the Unicode string so you would have to be carefull when using it to compare ascii strings to Unicode strings.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Compare a unicode string to a ascii string
;;; unicode in ecx, ascii in ebx, result in zf, for je or jne
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
UniAsciiCmp:
push eax							; uses ecx
push esi							; uses esi
xor esi, esi
compare:
mov ah, [ecx+esi*2]	; char in unicode
mov al, [ebx+esi]		; char in ascii
cmp ah, 0x00		; is unicode finished ?
je	isEQ			; reached the end is eq
cmp ah, al			; compare both the bits
jne	notEQ		; if not equal return ne
cmp esi, 0x32		; if we have tested 50 chars
jge isEQ			; equal to 48 chars at least
inc esi
jmp compare		; compare next char
notEQ:
or 	al, 1		; zf = 0 so str-str !=0
pop esi
pop eax
ret
isEQ:
test al, 0		; zf = 1 so str-str = 0
pop esi
pop eax
ret

You can just set up your strings and then call it, then je or jne to act accordingly. It will stop when the unicode string has a null char (not a space) so i hope your strings are terminated by a null char.

example usage

1
2
3
4
mov ecx, UniString             ; unicode string
mov ebx, AsciiString	       ; Ascii string
loccall UniAsciiCmp		; do comparison
jne notequal	                 ; jump if they are not equal
Posted By: Michael
Last Edit: 13 Jan 2009 @ 05:31 PM

EmailPermalinkComments (1)
Tags
Categories: Assembly
 13 Jan 2009 @ 5:25 PM 

Collision detection,
All games have them. Whether its mario running into a turtle or a bullet flying past your head in CS or you getting stuck in a tree in your favorite mmorpg.

So how do you do it ? How do you detect if one object is colliding with another ?

One very inefficient way is to just compare each objects (x,y) to the bounds of every other object on the screen. So if you have 5 objects each object must compare to each other so thats 5*5, for n objects thats n*n. So thats big oh of O(N2).

But what if we were to split the screen into 4 sections and only check for object collisions between objects that are in the same quadrant? Well ya, that works great! What if we split those four quadrants into 4 more quadrants ? This way we can only check for a collision between objects in the smallest quadrants. I dont like the name “quadrant” it only works when you have 4 so lets call them “nodes”.

So there are 4 nodes for each parent node, well that sounds like some sort of tree, it is!

A quad tree has 4 child nodes for each parent nodes. We only check for collisions in leaf nodes, so for depth=1 that is 4 nodes, for depth=2 that is 16 nodes and so on.

This really reduces collision calculations.

I wont explain anymore, ill show it to you. Use this java applet to see. Start with 50 objects and a depth of 1, then increment your depth. Keep your eye on the calculation in the upper left corner of the screen, this is the total number of calculations. Each node also shows its current calculations.

To pause it drag over the screen, to resume just move the mouse without dragging. Also the objects repel off each other and your mouse, and the sides of the screen.

here is the link (i would stay below 200 objects, and depth 5 or else you might crash  :P)
http://www.zonemikel.com/Java/quadtreeexample/quadtreeexample.html

Posted By: Michael
Last Edit: 13 Jan 2009 @ 05:25 PM

EmailPermalinkComments (0)
Tags
Categories: Java
 13 Jan 2009 @ 5:20 PM 

Picture Math By Zonemikel,

If you want a way for kids to do math homework and have fun, well it does not exist  :P You can however make it a little more personal.

With Picture Math you can select a folder on your local machine with pictures and while kids are doing their math homework they can see the pictures. The pictures only change if the math problem was correct, so this motivates children to see what is next.

This applet can be run right from this web page. It will scan the folder you select for pictures, and it will get sub folders of that folder and randomly display images when a correct math problem is solved.

How to use ?
All you have to do is click the link below and put in the information, then hit launch.
The “operator” can be +, – or *
The “arguments” can be from 0 to 5. If you have smaller kids set arguments to 1 and let them practice typing numbers!
Difficulty should start out at 0. Difficulty of 0 means the numbers will be around 0 to 5. Above that setting the maximum value of arguments will be difficulty*10. so for instance a difficulty of 2 would give you problems like 13 + 20.
Set size is the amount of problems before finishing a level.
You must click the button “set pics” and select a picture in a folder with lots of pictures, if not no picture will show and it will look bland !

How do the levels work ?
Well every time a set is compleated, if above 90% was recived arguments will get incramented. So if you had 2 arguments before (2+4) you will now have 3 (2+3+4) but the difficulty will remain the same until you have reached 5 arguments, then it will increase the difficulty and change arguments to 2 again.

Few more things you should know
When you finish a level hit ‘n’ to go to the ‘n’ext level
If you want to see a log of all the progress hit ‘l’ L and hit ‘l’ again to turn it off
After each level is completed it will display your grade and problems per second
To start over again just refresh the page.
You must accept the security thing or the applet cannot read files on your pc

http://www.zonemikel.com/Java/BasicMath/MainApplet.html

Posted By: Michael
Last Edit: 13 Jan 2009 @ 05:20 PM

EmailPermalinkComments (0)
Tags
Categories: Java
Change Theme...
  • Users » 5
  • Posts/Pages » 71
  • Comments » 62
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Contact Me



    No Child Pages.

Front



    No Child Pages.