|
someone changed ur system date to a forward date and then you edited the files (and changed the date back) and saved it happens to me all the time , just edit the files once more and their modifed date will be taken care of (after changing the time)
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Hi,
How can I get the IP address of the system in which the executable is running using C functions(both for linux and windows).
Karteek
|
|
|
|
|
gethostbyname() and so on
|
|
|
|
|
Anonymous wrote:
gethostbyname()...
Preceded by gethostname() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
Can you give an example?I tried it but it did not work.
Thank you
Karteek
|
|
|
|
|
http://tinyurl.com/3df5s[^]
char szHost[128];
gethostname(szHost, sizeof(szHost));
struct hostent *pHost;
pHost = gethostbyname(szHost);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi,
I did the same thing and I tried to print pHost->h_addr_list[0].But I am not getting the ip address of the system
Karteek
|
|
|
|
|
karteek wrote:
I am not getting the ip address of the system
Sure you are. It's just not in dotted notation like you are accustomed to seeing it. You need to copy pHost->h_addr_list[0] into a sockaddr_in structure, and then call inet_ntoa() passing it the sin_addr member of that structure.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hello Guys,
How ru all doing..i need some some help in VC++, When iam declaring an CInternetSession variable as global, i get some debug assertion error, when the application runs, i have created the applicaiton through MFC Wizard, in the dialog i do some operations for FTp Connection, so i establish a CInternetSession and CFTPConnection Variable globally, because it is accesed by many functions, when the app runs, the error is thrown off, when i declare the CInternetSession inside a function, i dont get any error, but i want it only globally.
|
|
|
|
|
I just began learning assembler programming on the Linux/i386. I know how the shell code works and can write the assembler for it. I also understand what the code in the main() function does. Creates an int pointer, sets it equal to the cast address of the pointer + 2 then copies the cast shell code int to the dereference of the int pointer and somehow executes. If you have the time could you please explain how the code in the main() function works. Thanks, I really appreciate it.
#include <stdio.h>
char shellcode[] =
"\x31\xc0\x50\x68\x31\x33\x33\x37"
"\x66\xb9\xed\x01\x89\xe3\xb0\x27"
"\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
"\x80\x90\x90\x90\x55\x89";
int main()
{
int * ret;
ret = (int *)&ret + 2;
*ret = (int)shellcode;
}
John
Programmer
|
|
|
|
|
That's a classical buffer overrun. You're basically modifying the function return address to that of shellcode . When the function tries to return using the return address provided by the C-runtime which called main, it'll return straight into the memory area of shellcode . shellcode contains CPU instructions which will do something which was not intended (well, in this case it is intended, but it's just for show).
Here is a more detailed document on the subject: http://www.cs.ucsb.edu/~jzhou/security/overflow.html[^]
I just hope you're not a bad guy
--
In the land of the blind, be king![^]
|
|
|
|
|
|
|
The 22-Nov entry in this blog[^] may provide an answer.
Btw, I hate to do this to you, but my ISP just upped my standard broadband connection (downloads) to 3Mb/sec (about 400 KB/sec).
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
OK, you got me where it hurts. You know I live on ham and cheese sandwiches, while you casually gorge yourself on wondrous delights that for me are but a distant memory. I'd kill for a medhu wada soaked in spicy sambar...
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi!
How do make a counter that starts with zero and then counts up til the program is finished?
I will have misçroseconds precision. I have used struct timeval to get microseconds and it counts p till 999999 microseconds. Then it starts again at 0, but it do not add number 1 for one seconds has gone. In other words it doesn't show 1000000, instead only 0.
Thankful for your help
|
|
|
|
|
Is counter a varible or related with one register of 8254?
If it is a varible to store a value you can work well by "%"
My Family & myself wish you &
yours a very
Merry Christmas & a Happy & Safe New Year.
|
|
|
|
|
lookup QueryPerformanceFrequency and QueryPerformanceCounter if you do a QueryPerformanceCounter at the beginning of your program and on the end, the difference is the amount of time spent.
|
|
|
|
|
I have a project which is a SDI Application,I want to create a button in the StatusBar,So I made a New class
(CMyStatusBar),and write some codes like this:
int CMyStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatusBar::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect;
GetItemRect(CommandToIndex(ID_MYBAR),&rect);
int ret=m_button.Create("test",WS_VISIBLE|WS_CHILD|WS_BORDER,rect,this,ID_MYBAR);
m_button.MoveWindow(rect,TRUE);
return 0;
}
but why i can't see my button :ID_MYBUTTON?????
thanks!
|
|
|
|
|
who can help me? thank you ....
|
|
|
|
|
try
ShowWindow(SW_SHOW)
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Thank you, i add this code:
ShowWindow(SW_SHOW)
but i can not see button also.......
|
|
|
|
|
1. Do you derive your statusbar from CStatusBar or CStatusBarCtrl ?
2. What coords of rectangle rc did you obtain from GetItemRect() ?
|
|
|
|
|
And another problem that has me completely floored:
In a Windows Installer DLL, it is necessary for me to get and adjust the commandline, write it into RunOnce and reboot the machine.
I've never used GetCommandLine before because I've always had access to the WinMain arguments, so it has never been necessary but in this case there is no other way to access it.
On Windows 9X, I have no problem. I use _tcscpy( szRunOnce, GetCommandLine() ); and szRunOnce is populated with "C:\WINDOWS\SYSTEM\msiexec.exe" /i "E:\MyFolder\MyInstaller.msi" /l*v C:\msilog.txt . That's exactly what I expect.
On Windows 2000, I get something else entirely - something like: C:\WINNT\System32\MsiExec.exe -Embedding 03E11881F81557A4CAAAA7C7B6ADDFBB
This is no use to me whatsoever, as far as I can see.
Is this Windows Installer doing this to me or GetCommandLine? If the latter then is there a good way of building the string that I'm really looking for?
Paul
|
|
|
|