Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2005, 15:13
Dmit
 
Posts: n/a
Quote:
Originally Posted by WhoCares
for binary files, use feof() function, don't use EOF macro.
What the reason for such recommendation? According to MSDN
Quote:
To indicate a read error or end-of-file condition, getc and getchar return EOF
I've used EOF for more that 10 years in multiple progs, and never encountered any problem.
Reply With Quote
  #2  
Old 01-26-2005, 17:01
Kerlingen
 
Posts: n/a
@Dmit:
For me TYPE only truncates the output if it is directed to the console. As soon as it is redirected to any other file or any other program, it fully copies the filecontents. My BC++ compiled copy worked with the TYPE command just like the other way.

The VC++ and DMC copies truncated the file somewhere after 100kb or something (each one at the different position), so I guess (and tested) that there was at least one 0x1A before that file position.

@wasq:
For me it works with 0xF1 as XOR value. Using 0x0E gives me the wrong output.
Reply With Quote
  #3  
Old 01-27-2005, 03:39
sackpower sackpower is offline
Friend
 
Join Date: Jan 2003
Location: Europe
Posts: 26
Rept. Given: 5
Rept. Rcvd 3 Times in 1 Post
Thanks Given: 15
Thanks Rcvd at 13 Times in 6 Posts
sackpower Reputation: 3
@ wasq: 0xF1 is the right XOR value.

I started a small project and decrypted a setup.inx with ISDHelper,
then I worked on it with SID (Sexy InstallShield Decompiler) and
rebuild the original crypted setup.inx. All worked fine.

Here is my solution for rebuilding the crypted INX:

Code:
//Usage: ISDGoBack.exe <newsetup.inx> setup.inx

#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#define XOR_VAL 0xF1

void main (void) 
{
	int i, c;
	unsigned char b;
	// Set "stdin" and "stdout" to have binary mode
	setmode (_fileno (stdin), _O_BINARY);
	setmode (_fileno (stdout), _O_BINARY);
	// Rebuild the crypted INX
	for (i = 0; (c = getchar ()) != EOF; i++)
	{
            int d, e;

            d = 0x00;

            do
            {
                e = d;
	        e ^= XOR_VAL;
		b = (unsigned char)((e >> 2) | (e << 6)) - (i % 71);
                if (b == c)
                {
		    putchar (d);
                }
                else d++;
            } while (b != c && d <= 0xFF);
	}
}
I don't know if there is a better solution, but it works.
Reply With Quote
  #4  
Old 02-03-2005, 17:43
WhoCares's Avatar
WhoCares WhoCares is offline
who cares
 
Join Date: Jan 2002
Location: Here
Posts: 468
Rept. Given: 11
Rept. Rcvd 32 Times in 25 Posts
Thanks Given: 69
Thanks Rcvd at 247 Times in 94 Posts
WhoCares Reputation: 32
Quote:
Originally Posted by Dmit
What the reason for such recommendation? According to MSDN

I've used EOF for more that 10 years in multiple progs, and never encountered any problem.
You are right. sorry
__________________
AKA Solomon/blowfish.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
InstallShield 12 Script decompiler ? DARKER General Discussion 27 02-04-2024 00:40
packing-format MaRKuS-DJM General Discussion 4 11-11-2004 03:05
If anybody know this format... qaz_qaz General Discussion 4 07-15-2002 04:51


All times are GMT +8. The time now is 19:56.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )