|
What are you trying to do exactly ? I have absolutely no idea of what you mean by 'original bytes'... Could you elaborate a bit ?
|
|
|
|
|
I hooked opengl and i want before the hooking function to spoof/patch the memory coz detours leave a leave a 0xE9 op trace. But i have no idea how to call the original memory i quess something with readprocessmemory but here aint a tutorial ok.
|
|
|
|
|
nah1337 wrote: The problem is i hooked opengl glDrawElements and i want to read before hooking the opengl with detours the real memory.
Dunno havent found anything yet could anyone post a example how would look it. And i want read the 32 first bytes on the original opengl ok thnx.
are you attempting to capture and trace openGL commands in order to trace/record them? Very few people have ultimately been successful at this. glDebugger has the most capable interface that captures graphics commands as they are issued and before they are sent to the card, recording and timing them. WireGL/Chromium is an open source project that captures OpenGL commands and reissues them to a cluster of computers. But as far as I know there are no tutorials on exactly how to do this. I expect you could find out how by pulling the source code for Chromium. http://sourceforge.net/projects/chromium/[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
actually i dont wanna do anything more than just call the real 32 bytes off the function to just hide the detouring nothing more ... thats the purpouse
i wanna do it with readprocessmemory and writeprocessmemory
-- modified at 19:02 Wednesday 26th September, 2007
|
|
|
|
|
Class A
{
A() //Constructor
}
class B: public A
{
B(...):A(...)
{...}
.
.
.
}
Any body know what is instruction "B(...):A(...)" in class B doing ?
Beginner
|
|
|
|
|
1) you'll have to speak a better english if you want people here to understand you.
2) when providing a code sample, place it between <pre></pre> html tags so that it will be well formatted.
3) a function with the same name as a class is called a constructor. it's purpose is to initalize its members.
you should really consider buying a C++ book and learn about object oriented programming...
|
|
|
|
|
Yes, in the constructor of B, you call the constructor of A. It is usefull for example when you need to pass arguments to the constructor of A.
|
|
|
|
|
What is difference between
B(...):A(...)
{
.
.
.
}
and
B(...)
{
A(..);
.
.
.
}
Beginner
|
|
|
|
|
The second syntax is invalid: the base class (A) needs to be constructed before your child class (B). So the only way to do that is to put it in the constructor initialisation list.
|
|
|
|
|
|
the value 0.00922307 should be rounded to 0.01.
Is there any method available in c++?
|
|
|
|
|
Math.round ();
public static long round( double a )
Parameters
a
a double value.
Returns
the value of the argument rounded to the nearest long value.
Description
Returns the closest long to the argument.
If the argument is negative infinity or any value less than or equal to the value of Long.MIN_VALUE, the result is equal to the value of Long.MIN_VALUE.
If the argument is positive infinity or any value greater than or equal to the value of Long.MAX_VALUE, the result is equal to the value of Long.MAX_VALUE.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I need to get result with two decimal places not long value.
|
|
|
|
|
ROUND(nExpression, nDecimalPlaces)
Returns
Numeric
Arguments
nExpression
Specifies the numeric expression whose value is to be rounded.
nDecimalPlaces
Specifies the number of decimal places nExpression is rounded to.
If nDecimalPlaces is negative, ROUND( ) returns a whole number containing zeros equal in number to nDecimalPlaces to the left of the decimal point. For example, if nDecimalPlaces is –2, the first and second digits to the left of the decimal point in the value are 0.
This may work check once...
Megha
|
|
|
|
|
Which language is that ?
When you copy paste documentation that you found, it would be better to post the link instead.
|
|
|
|
|
AFAIK, this is java libraries, not C++.
|
|
|
|
|
That looks like C#, not C++!
Steve
|
|
|
|
|
I have taken this text from the VS 6.0 help, but without seeing from which library. It is java. Sorry for the confusion.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
In general, rounding is needed when you want to display the number as a string. Is that the case for you ?
If yes, you can use sprintf and specify a precision:
char szBuff[25];<br />
sprintf(szBuff,"%.2f",yourDouble);
This tells sprintf to print 2 decimals after the floating point.
If you need to use it as a double (and not a string), you can multiply it by 100, convert it to an int and divided it back by 100.0:
double yourDouble = 0.00922307;<br />
int yourInt = yourDouble * 100;<br />
double roundedDouble = yourInt / 100.0;
(you must be carefull and divide by 100.0, not by 100, otherwise the you will end up with an integer and not a double).
|
|
|
|
|
but as per logic it returns 0.00 not 0.01 which required.
|
|
|
|
|
Cedric Moonen wrote: double yourDouble = 0.00922307;
int yourInt = yourDouble * 100;
double roundedDouble = yourInt / 100.0;
I think
double yourDouble = 0.00922307 + .005;
will be more right.
- NS -
|
|
|
|
|
Yes, you are perfectly right
I forgot that the rounding is always rounded-down.
|
|
|
|
|
This is another way to do that.
I did it with VC++ 6.0 to be used in my project. The return value is a string to be shown in the GUI, but you can easily adapt it just for numbers.
CString CMyDoc::CutAndRoundStringToNDecimals (double dValue, const int nDec)
{ double dTemp = 0, dFract = 0, dInt = 0, dRes = 0;
int nCount = 0;
CString cLetter = "";
dTemp = dValue*pow(10,nDec);
dFract = modf (dTemp, &dInt);
if (dFract >= 0.5)
dInt++;
dRes = dInt/pow(10,nDec);
CString szResult;
szResult.Format ("%s%f", szResult, dRes);
int nLarge = szResult.GetLength ();
for (int i = 0; i < nLarge; i++)
{ nCount++;
CString cLetter = szResult.GetAt (i);
if (cLetter == ".")
{ nCount += nDec;
break;
}
}
LPTSTR pStr = szResult.GetBufferSetLength (nCount);
szResult.ReleaseBuffer ();
return szResult;
}
Hope it helps
I forgot to say that math.h has to be included to use pow () and modf()
-- modified at 11:41 Wednesday 26th September, 2007
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello,
i have come across with the int version of this function somewhere and changed to double in order to avoid precision problems for big and small values. You may use the int version if it fits your requirement.
double roundExt(double Num, double Seed)
{
// get rational factor
double fac = Num / Seed;
// get natural factor
fac = (fac < 0) ? (ceil(fac - 0.5)) : (floor(fac + 0.5));
// fac = (fac < 0) ? static_cast<int>(fac-0.5) : static_cast<int>(fac+0.5);
// return multiple
return fac * Seed;
}
roundExt(0.009,0.01); is the usage.
Hope this helps.
Bekir.
|
|
|
|
|
Yes , it working fine.
Thanks to all.
|
|
|
|