Page 3 of 5
Posted: Thu Dec 07, 2006 6:30 am
by volka
You would have to parse the argument by yourself, see
http://msdn.microsoft.com/library/defau ... mbstok.asp e.g.
Posted: Thu Dec 07, 2006 6:35 am
by neel_basu
Ok So We Can This Trick To Use Comma As Separator
The Programm Will Scan Only That comma Separated Argument And Treat It as 1 Argument And Then It Will Explod It By comma To Separate Arguments
Posted: Thu Dec 07, 2006 6:38 am
by ok
neel_basu wrote:Ok So We Can This Trick To Use Comma As Separator
The Programm Will Scan Only That comma Separated Argument And Treat It as 1 Argument And Then It Will Explod It By comma To Separate Arguments
No
It but
you!
Posted: Thu Dec 07, 2006 6:44 am
by neel_basu
Can I Change The Variable Names Of argc and argv
with My Own Variable Names ??
Posted: Thu Dec 07, 2006 6:48 am
by ok
Yes
Posted: Thu Dec 07, 2006 6:55 am
by neel_basu
I Wanna Use php To Interact With That C Program
That Programm Doesn't Have Any Interaction With File System
Can Hackers Make Any Damage To It By Passing A Bad Value As Argument To That Program Through Script Kiddies To Make That Programm Injurious To The Health Of http Server??
If yes Then Would You Please Tell Me About That Bad Values ??
Posted: Thu Dec 07, 2006 6:58 am
by volka
really depends on what your actual c code does (or does not)
Posted: Thu Dec 07, 2006 7:02 am
by neel_basu
If Its The C Code
============
Code: Select all
#include <stdio.h>
#include <stdlib.h>
int main(int argc,char *argv[])
{
if ( argc > 1 ) {
long x = strtol(argv[1], NULL, 10);
printf("%s",argv[1]);
printf("->%ld", x*5);
}
return 0;
}
Is There Any Risk ??
Posted: Thu Dec 07, 2006 7:08 am
by ok
I don't see that this program can damage the server. But, why you don't use PHP for this purpose?
intval()!
Posted: Thu Dec 07, 2006 7:09 am
by neel_basu
I Wanna Create My Own Encryption Decryption Module
So If The Encryption Decryption Function Is Written On php
It Would Be Easy To The Hackers
Thats Why I Am Using An External program
Posted: Thu Dec 07, 2006 7:15 am
by neel_basu
I Have Another Question Also
Would This Code Run In Linux or Free BSD Servers as Well As Windows Server ??
Code: Select all
$output = shell_exe('mult.exe');
print $output;
If I Upload The exe File In That Server In The Same Drectory Where My php Script Is ??
Posted: Thu Dec 07, 2006 7:17 am
by ok
No. Linux can't run .exe files (you can use
wine).
Posted: Thu Dec 07, 2006 7:28 am
by neel_basu
So How Can I Create Binary Program For Linux By C And What Would Be The Exetension Of That File ??
Posted: Thu Dec 07, 2006 8:19 am
by ok
You just need to compile it under linux (using gcc or different compiler).
The extension would be (I think...) .out or .bin
Posted: Thu Dec 07, 2006 8:51 am
by volka
neel_basu wrote:I Wanna Create My Own Encryption Decryption Module
So If The Encryption Decryption Function Is Written On php
It Would Be Easy To The Hackers
eh... why?
And please, don't write an "Own Encryption Decryption Module". It's very,very unlikely you come up with a good strong one just like that.
Better take a look at
http://de2.php.net/mcrypt