200 bytes saved!

Drum-roll...  bzip2 exehead is now 37K.
Next target - 50 bytes to get zlib exehead down to 35.5K.


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1169 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
eccles 2002-09-24 18:49:21 +00:00
parent 424f6d1dd0
commit 063eade67b

View file

@ -130,9 +130,12 @@ static int NSISCALL process_string_fromparm_toint(int id_)
return myatoi(ps_tmpbuf); return myatoi(ps_tmpbuf);
} }
static void NSISCALL process_string_fromparm_tobuf(int id_) // NB - USE CAUTION when rearranging code to make use of the new return value of
// this function - be sure the parm being accessed is not modified before the call.
static char * NSISCALL process_string_fromparm_tobuf(int id_)
{ {
process_string_fromtab(bufs[id_ >> 4], parms[id_ & 0xF]); process_string_fromtab(bufs[id_ >> 4], parms[id_ & 0xF]);
return bufs[id_ >> 4];
} }
// returns EXEC_ERROR on error // returns EXEC_ERROR on error
@ -167,7 +170,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
return parm0; return parm0;
case EW_ABORT: case EW_ABORT:
{ {
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
log_printf2("Aborting: \"%s\"",buf0); log_printf2("Aborting: \"%s\"",buf0);
update_status_text("",buf0); update_status_text("",buf0);
} }
@ -186,7 +189,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
if (parm1) ui_st_updateflag=parm1; if (parm1) ui_st_updateflag=parm1;
else else
{ {
process_string_fromparm_tobuf(0x30); char *buf3=process_string_fromparm_tobuf(0x30);
log_printf2("detailprint: %s",buf3); log_printf2("detailprint: %s",buf3);
update_status_text(buf3,""); update_status_text(buf3,"");
} }
@ -218,17 +221,18 @@ static int NSISCALL ExecuteEntry(entry *entry_)
if (insthwndbutton) ShowWindow(insthwndbutton,parm1); if (insthwndbutton) ShowWindow(insthwndbutton,parm1);
if (insthwnd) ShowWindow(insthwnd,parm0); if (insthwnd) ShowWindow(insthwnd,parm0);
return 0; return 0;
case EW_SETFILEATTRIBUTES: case EW_SETFILEATTRIBUTES: {
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
log_printf3("SetFileAttributes: \"%s\":%08X",buf0,parm1); log_printf3("SetFileAttributes: \"%s\":%08X",buf0,parm1);
if (!SetFileAttributes(buf0,parm1)) if (!SetFileAttributes(buf0,parm1))
{ {
exec_errorflag++; exec_errorflag++;
log_printf("SetFileAttributes failed."); log_printf("SetFileAttributes failed.");
} }
}
return 0; return 0;
case EW_CREATEDIR: case EW_CREATEDIR: {
process_string_fromparm_tobuf(0x10); char *buf1=process_string_fromparm_tobuf(0x10);
log_printf3("CreateDirectory: \"%s\" (%d)",buf1,parm1); log_printf3("CreateDirectory: \"%s\" (%d)",buf1,parm1);
if (parm1) if (parm1)
{ {
@ -237,15 +241,17 @@ static int NSISCALL ExecuteEntry(entry *entry_)
} }
else update_status_text_from_lang(LANGID_CREATEDIR,buf1); else update_status_text_from_lang(LANGID_CREATEDIR,buf1);
recursive_create_directory(buf1); recursive_create_directory(buf1);
}
return 0; return 0;
case EW_IFFILEEXISTS: case EW_IFFILEEXISTS: {
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
if (file_exists(buf0)) if (file_exists(buf0))
{ {
log_printf3("IfFileExists: file \"%s\" exists, jumping %d",buf0,parm1); log_printf3("IfFileExists: file \"%s\" exists, jumping %d",buf0,parm1);
return parm1; return parm1;
} }
log_printf3("IfFileExists: file \"%s\" does not exist, jumping %d",buf0,parm2); log_printf3("IfFileExists: file \"%s\" does not exist, jumping %d",buf0,parm2);
}
return parm2; return parm2;
case EW_IFERRORS: case EW_IFERRORS:
{ {
@ -260,8 +266,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
#ifdef NSIS_SUPPORT_RENAME #ifdef NSIS_SUPPORT_RENAME
case EW_RENAME: case EW_RENAME:
{ {
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
process_string_fromparm_tobuf(0x11); char *buf1=process_string_fromparm_tobuf(0x11);
mystrcpy(buf3,buf0); mystrcpy(buf3,buf0);
if (mystrlen(buf0)+mystrlen(buf1) < NSIS_MAX_STRLEN-3) if (mystrlen(buf0)+mystrlen(buf1) < NSIS_MAX_STRLEN-3)
{ {
@ -298,9 +304,9 @@ static int NSISCALL ExecuteEntry(entry *entry_)
#ifdef NSIS_SUPPORT_FNUTIL #ifdef NSIS_SUPPORT_FNUTIL
case EW_GETFULLPATHNAME: case EW_GETFULLPATHNAME:
{ {
char *p=var0;
char *fp; char *fp;
process_string_fromparm_tobuf(0x01); char *p=var0;
char *buf0=process_string_fromparm_tobuf(0x01);
if (!GetFullPathName(buf0,NSIS_MAX_STRLEN,p,&fp)) if (!GetFullPathName(buf0,NSIS_MAX_STRLEN,p,&fp))
{ {
exec_errorflag++; exec_errorflag++;
@ -326,7 +332,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{ {
char *fp; char *fp;
char *p=var0; char *p=var0;
process_string_fromparm_tobuf(0x01); char *buf0=process_string_fromparm_tobuf(0x01);
if (!SearchPath(NULL,buf0,NULL,NSIS_MAX_STRLEN,p,&fp)) if (!SearchPath(NULL,buf0,NULL,NSIS_MAX_STRLEN,p,&fp))
{ {
exec_errorflag++; exec_errorflag++;
@ -350,10 +356,10 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{ {
HANDLE hOut; HANDLE hOut;
int ret; int ret;
char *buf3=process_string_fromparm_tobuf(0x31);
#define overwriteflag parm0 #define overwriteflag parm0
addtrailingslash(mystrcpy(buf0,state_output_directory)); addtrailingslash(mystrcpy(buf0,state_output_directory));
process_string_fromparm_tobuf(0x31);
log_printf3("File: overwriteflag=%d, name=\"%s\"",overwriteflag,buf3); log_printf3("File: overwriteflag=%d, name=\"%s\"",overwriteflag,buf3);
if (validpathspec(buf3)) if (validpathspec(buf3))
{ {
@ -443,7 +449,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{ {
HANDLE h; HANDLE h;
WIN32_FIND_DATA fd; WIN32_FIND_DATA fd;
process_string_fromparm_tobuf(0x10); char *buf1=process_string_fromparm_tobuf(0x10);
mystrcpy(buf0,buf1); mystrcpy(buf0,buf1);
log_printf2("Delete: \"%s\"",buf0); log_printf2("Delete: \"%s\"",buf0);
trimslashtoend(buf0); trimslashtoend(buf0);
@ -491,7 +497,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_MESSAGEBOX: // MessageBox case EW_MESSAGEBOX: // MessageBox
{ {
int v; int v;
process_string_fromparm_tobuf(0x31); char *buf3=process_string_fromparm_tobuf(0x31);
log_printf3("MessageBox: %d,\"%s\"",parm0,buf3); log_printf3("MessageBox: %d,\"%s\"",parm0,buf3);
v=my_MessageBox(buf3,parm0); v=my_MessageBox(buf3,parm0);
if (v) if (v)
@ -512,7 +518,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
#ifdef NSIS_SUPPORT_RMDIR #ifdef NSIS_SUPPORT_RMDIR
case EW_RMDIR: case EW_RMDIR:
{ {
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
log_printf2("RMDir: \"%s\"",buf0); log_printf2("RMDir: \"%s\"",buf0);
if (lastchar(buf0)=='\\') trimslashtoend(buf0); if (lastchar(buf0)=='\\') trimslashtoend(buf0);
@ -523,9 +529,10 @@ static int NSISCALL ExecuteEntry(entry *entry_)
return 0; return 0;
#endif//NSIS_SUPPORT_RMDIR #endif//NSIS_SUPPORT_RMDIR
#ifdef NSIS_SUPPORT_STROPTS #ifdef NSIS_SUPPORT_STROPTS
case EW_STRLEN: case EW_STRLEN: {
process_string_fromparm_tobuf(0x01); char *buf0=process_string_fromparm_tobuf(0x01);
myitoa(var0,mystrlen(buf0)); myitoa(var0,mystrlen(buf0));
}
return 0; return 0;
case EW_ASSIGNVAR: case EW_ASSIGNVAR:
{ {
@ -533,7 +540,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
int start=process_string_fromparm_toint(3); int start=process_string_fromparm_toint(3);
int l; int l;
char *p=var0; char *p=var0;
process_string_fromparm_tobuf(0x01); char *buf0=process_string_fromparm_tobuf(0x01);
*p=0; *p=0;
if (parm2 < 0 || newlen) if (parm2 < 0 || newlen)
{ {
@ -554,17 +561,18 @@ static int NSISCALL ExecuteEntry(entry *entry_)
} }
} }
return 0; return 0;
case EW_STRCMP: case EW_STRCMP: {
process_string_fromparm_tobuf(0x20); char *buf2=process_string_fromparm_tobuf(0x20);
process_string_fromparm_tobuf(0x31); char *buf3=process_string_fromparm_tobuf(0x31);
if (!lstrcmpi(buf2,buf3)) return parm2; if (!lstrcmpi(buf2,buf3)) return parm2;
}
return parm3; return parm3;
#endif//NSIS_SUPPORT_STROPTS #endif//NSIS_SUPPORT_STROPTS
#ifdef NSIS_SUPPORT_ENVIRONMENT #ifdef NSIS_SUPPORT_ENVIRONMENT
case EW_READENVSTR: case EW_READENVSTR:
{ {
char *p=var0; char *p=var0;
process_string_fromparm_tobuf(0x01); char *buf0=process_string_fromparm_tobuf(0x01);
if (parm2) if (parm2)
{ {
if (!GetEnvironmentVariable(buf0,p,NSIS_MAX_STRLEN)) if (!GetEnvironmentVariable(buf0,p,NSIS_MAX_STRLEN))
@ -624,11 +632,12 @@ static int NSISCALL ExecuteEntry(entry *entry_)
myitoa(p,v); myitoa(p,v);
} }
return 0; return 0;
case EW_INTFMT: case EW_INTFMT: {
process_string_fromparm_tobuf(0x01); char *buf0=process_string_fromparm_tobuf(0x01);
wsprintf(var0, wsprintf(var0,
buf0, buf0,
process_string_fromparm_toint(2)); process_string_fromparm_toint(2));
}
return 0; return 0;
#endif//NSIS_SUPPORT_INTOPTS #endif//NSIS_SUPPORT_INTOPTS
#ifdef NSIS_SUPPORT_STACK #ifdef NSIS_SUPPORT_STACK
@ -684,13 +693,11 @@ static int NSISCALL ExecuteEntry(entry *entry_)
int msg=process_string_fromparm_toint(2); int msg=process_string_fromparm_toint(2);
if (parm5&1) if (parm5&1)
{ {
process_string_fromparm_tobuf(0x03); b3=(int)process_string_fromparm_tobuf(0x03);
b3=(int)buf0;
} }
if (parm5&2) if (parm5&2)
{ {
process_string_fromparm_tobuf(0x14); b4=(int)process_string_fromparm_tobuf(0x14);
b4=(int)buf1;
} }
if (parm5>>2) exec_errorflag += !SendMessageTimeout(hwnd,msg,b3,b4,SMTO_NORMAL,parm5>>2,(LPDWORD)&v); if (parm5>>2) exec_errorflag += !SendMessageTimeout(hwnd,msg,b3,b4,SMTO_NORMAL,parm5>>2,(LPDWORD)&v);
@ -698,8 +705,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
} }
else else
{ {
process_string_fromparm_tobuf(0x01); char *buf0=process_string_fromparm_tobuf(0x01);
process_string_fromparm_tobuf(0x12); char *buf1=process_string_fromparm_tobuf(0x12);
v=(int)FindWindowEx((HWND)b3,(HWND)b4,buf0[0]?buf0:NULL,buf1[0]?buf1:NULL); v=(int)FindWindowEx((HWND)b3,(HWND)b4,buf0[0]?buf0:NULL,buf1[0]?buf1:NULL);
} }
@ -728,11 +735,10 @@ static int NSISCALL ExecuteEntry(entry *entry_)
RECT r; RECT r;
HWND hwImage = GetDlgItem(g_hwnd, parm1); HWND hwImage = GetDlgItem(g_hwnd, parm1);
GetWindowRect(hwImage, &r); GetWindowRect(hwImage, &r);
process_string_fromparm_tobuf(0x00);
if (g_hBrandingBitmap) DeleteObject(g_hBrandingBitmap); if (g_hBrandingBitmap) DeleteObject(g_hBrandingBitmap);
g_hBrandingBitmap=LoadImage( g_hBrandingBitmap=LoadImage(
0, 0,
buf0, process_string_fromparm_tobuf(0x00),
IMAGE_BITMAP, IMAGE_BITMAP,
parm2?r.right-r.left:0, parm2?r.right-r.left:0,
parm2?r.bottom-r.top:0, parm2?r.bottom-r.top:0,
@ -764,9 +770,9 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_SHELLEXEC: // this uses improvements of Andras Varga case EW_SHELLEXEC: // this uses improvements of Andras Varga
{ {
int x; int x;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
process_string_fromparm_tobuf(0x11); char *buf1=process_string_fromparm_tobuf(0x11);
process_string_fromparm_tobuf(0x22); char *buf2=process_string_fromparm_tobuf(0x22);
wsprintf(buf3,"%s %s",buf0,buf1); wsprintf(buf3,"%s %s",buf0,buf1);
update_status_text_from_lang(LANGID_EXECSHELL, buf3); update_status_text_from_lang(LANGID_EXECSHELL, buf3);
x=(int)ShellExecute(g_hwnd,buf0[0]?buf0:NULL,buf1,buf2[0]?buf2:NULL,state_output_directory,parm3); x=(int)ShellExecute(g_hwnd,buf0[0]?buf0:NULL,buf1,buf2[0]?buf2:NULL,state_output_directory,parm3);
@ -786,7 +792,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_EXECUTE: case EW_EXECUTE:
{ {
HANDLE hProc; HANDLE hProc;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
log_printf2("Exec: command=\"%s\"",buf0); log_printf2("Exec: command=\"%s\"",buf0);
update_status_text_from_lang(LANGID_EXECUTE,buf0); update_status_text_from_lang(LANGID_EXECUTE,buf0);
@ -828,7 +834,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
WIN32_FIND_DATA *ffd; WIN32_FIND_DATA *ffd;
char *highout=var1; char *highout=var1;
char *lowout=var2; char *lowout=var2;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
ffd=file_exists(buf0); ffd=file_exists(buf0);
if (ffd) if (ffd)
@ -853,7 +859,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
DWORD t[4]; // our two members are the 3rd and 4th.. DWORD t[4]; // our two members are the 3rd and 4th..
VS_FIXEDFILEINFO *pvsf1=(VS_FIXEDFILEINFO*)t; VS_FIXEDFILEINFO *pvsf1=(VS_FIXEDFILEINFO*)t;
DWORD d; DWORD d;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
s1=GetFileVersionInfoSize(buf0,&d); s1=GetFileVersionInfoSize(buf0,&d);
*lowout=*highout=0; *lowout=*highout=0;
exec_errorflag++; exec_errorflag++;
@ -885,8 +891,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
if (hres == S_FALSE || hres == S_OK) if (hres == S_FALSE || hres == S_OK)
{ {
HANDLE h; HANDLE h;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
process_string_fromparm_tobuf(0x11); char *buf1=process_string_fromparm_tobuf(0x11);
h=LoadLibrary(buf0); h=LoadLibrary(buf0);
if (h) if (h)
@ -908,7 +914,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
} }
else else
{ {
process_string_fromparm_tobuf(0x22); char *buf2=process_string_fromparm_tobuf(0x22);
update_status_text(buf2,buf0); update_status_text(buf2,buf0);
funke(); funke();
} }
@ -937,11 +943,11 @@ static int NSISCALL ExecuteEntry(entry *entry_)
return 0; return 0;
#endif #endif
#ifdef NSIS_SUPPORT_CREATESHORTCUT #ifdef NSIS_SUPPORT_CREATESHORTCUT
case EW_CREATESHORTCUT: case EW_CREATESHORTCUT: {
process_string_fromparm_tobuf(0x20); char *buf2=process_string_fromparm_tobuf(0x20);
process_string_fromparm_tobuf(0x11); char *buf1=process_string_fromparm_tobuf(0x11);
process_string_fromparm_tobuf(0x02); char *buf0=process_string_fromparm_tobuf(0x02);
process_string_fromparm_tobuf(0x33); char *buf3=process_string_fromparm_tobuf(0x33);
log_printf8("CreateShortCut: out: \"%s\", in: \"%s %s\", icon: %s,%d, sw=%d, hk=%d", log_printf8("CreateShortCut: out: \"%s\", in: \"%s %s\", icon: %s,%d, sw=%d, hk=%d",
buf2,buf1,buf0,buf3,parm4&0xff,(parm4&0xff00)>>8,parm4>>16); buf2,buf1,buf0,buf3,parm4&0xff,(parm4&0xff00)>>8,parm4>>16);
@ -956,6 +962,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{ {
update_status_text_from_lang(LANGID_CREATESHORTCUT,buf2); update_status_text_from_lang(LANGID_CREATESHORTCUT,buf2);
} }
}
return 0; return 0;
#endif//NSIS_SUPPORT_CREATESHORTCUT #endif//NSIS_SUPPORT_CREATESHORTCUT
#ifdef NSIS_SUPPORT_COPYFILES #ifdef NSIS_SUPPORT_COPYFILES
@ -963,8 +970,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{ {
int res; int res;
SHFILEOPSTRUCT op; SHFILEOPSTRUCT op;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
process_string_fromparm_tobuf(0x11); char *buf1=process_string_fromparm_tobuf(0x11);
log_printf3("CopyFiles \"%s\"->\"%s\"",buf0,buf1); log_printf3("CopyFiles \"%s\"->\"%s\"",buf0,buf1);
op.hwnd=g_hwnd; op.hwnd=g_hwnd;
op.wFunc=FO_COPY; op.wFunc=FO_COPY;
@ -1027,24 +1034,22 @@ static int NSISCALL ExecuteEntry(entry *entry_)
#ifdef NSIS_SUPPORT_INIFILES #ifdef NSIS_SUPPORT_INIFILES
case EW_WRITEINI: case EW_WRITEINI:
{ {
char *sec, *ent; char *sec=0, *ent=0;
sec=ent=0; char *buf0=process_string_fromparm_tobuf(0x00);
char *buf3;
#ifdef NSIS_CONFIG_LOG #ifdef NSIS_CONFIG_LOG
mystrcpy(buf1,"<RM>"); mystrcpy(buf1,"<RM>");
mystrcpy(buf2,buf1); mystrcpy(buf2,buf1);
#endif #endif
process_string_fromparm_tobuf(0x00);
if (parm1>=0) if (parm1>=0)
{ {
process_string_fromparm_tobuf(0x11); sec=process_string_fromparm_tobuf(0x11);
sec=buf1;
} }
if (parm2>=0) if (parm2>=0)
{ {
process_string_fromparm_tobuf(0x22); ent=process_string_fromparm_tobuf(0x22);
ent=buf2;
} }
process_string_fromparm_tobuf(0x33); buf3=process_string_fromparm_tobuf(0x33);
log_printf5("WriteINIStr: wrote [%s] %s=%s in %s",buf0,buf1,buf2,buf3); log_printf5("WriteINIStr: wrote [%s] %s=%s in %s",buf0,buf1,buf2,buf3);
if (!WritePrivateProfileString(buf0,sec,ent,buf3)) exec_errorflag++; if (!WritePrivateProfileString(buf0,sec,ent,buf3)) exec_errorflag++;
} }
@ -1053,9 +1058,9 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{ {
static const char *errstr="!N~"; static const char *errstr="!N~";
char *p=var0; char *p=var0;
process_string_fromparm_tobuf(0x01); char *buf0=process_string_fromparm_tobuf(0x01);
process_string_fromparm_tobuf(0x12); char *buf1=process_string_fromparm_tobuf(0x12);
process_string_fromparm_tobuf(0x23); char *buf2=process_string_fromparm_tobuf(0x23);
GetPrivateProfileString(buf0,buf1,errstr,p,NSIS_MAX_STRLEN-1,buf2); GetPrivateProfileString(buf0,buf1,errstr,p,NSIS_MAX_STRLEN-1,buf2);
if (*((int*)errstr) == *((int*)p)) if (*((int*)errstr) == *((int*)p))
{ {
@ -1069,14 +1074,14 @@ static int NSISCALL ExecuteEntry(entry *entry_)
case EW_DELREG: case EW_DELREG:
{ {
int rootkey=parm0; int rootkey=parm0;
char *buf3=process_string_fromparm_tobuf(0x31);
exec_errorflag++; exec_errorflag++;
process_string_fromparm_tobuf(0x31);
if (parm2 != -1) if (parm2 != -1)
{ {
HKEY hKey; HKEY hKey;
if (RegOpenKeyEx((HKEY)rootkey,buf3,0,KEY_ALL_ACCESS,&hKey) == ERROR_SUCCESS) if (RegOpenKeyEx((HKEY)rootkey,buf3,0,KEY_ALL_ACCESS,&hKey) == ERROR_SUCCESS)
{ {
process_string_fromparm_tobuf(0x02); char *buf0=process_string_fromparm_tobuf(0x02);
log_printf4("DeleteRegValue: %d\\%s\\%s",rootkey,buf3,buf0); log_printf4("DeleteRegValue: %d\\%s\\%s",rootkey,buf3,buf0);
if (RegDeleteValue(hKey,buf0) == ERROR_SUCCESS) exec_errorflag--; if (RegDeleteValue(hKey,buf0) == ERROR_SUCCESS) exec_errorflag--;
RegCloseKey(hKey); RegCloseKey(hKey);
@ -1094,14 +1099,14 @@ static int NSISCALL ExecuteEntry(entry *entry_)
HKEY hKey; HKEY hKey;
int rootkey=parm0; int rootkey=parm0;
int type=parm4; int type=parm4;
char *buf1=process_string_fromparm_tobuf(0x12);
char *buf3=process_string_fromparm_tobuf(0x31);
exec_errorflag++; exec_errorflag++;
process_string_fromparm_tobuf(0x12);
process_string_fromparm_tobuf(0x31);
if (RegCreateKey((HKEY)rootkey,buf3,&hKey) == ERROR_SUCCESS) if (RegCreateKey((HKEY)rootkey,buf3,&hKey) == ERROR_SUCCESS)
{ {
if (type <= 1) if (type <= 1)
{ {
process_string_fromparm_tobuf(0x23); char *buf2=process_string_fromparm_tobuf(0x23);
if (RegSetValueEx(hKey,buf1,0,type==1?REG_SZ:REG_EXPAND_SZ,buf2,mystrlen(buf2)+1) == ERROR_SUCCESS) exec_errorflag--; if (RegSetValueEx(hKey,buf1,0,type==1?REG_SZ:REG_EXPAND_SZ,buf2,mystrlen(buf2)+1) == ERROR_SUCCESS) exec_errorflag--;
log_printf5("WriteRegStr: set %d\\%s\\%s to %s",rootkey,buf3,buf1,buf2); log_printf5("WriteRegStr: set %d\\%s\\%s to %s",rootkey,buf3,buf1,buf2);
} }
@ -1132,8 +1137,8 @@ static int NSISCALL ExecuteEntry(entry *entry_)
HKEY hKey; HKEY hKey;
char *p=var0; char *p=var0;
int rootkey=parm1; int rootkey=parm1;
process_string_fromparm_tobuf(0x02); // buf0 == subkey char *buf0=process_string_fromparm_tobuf(0x02); // buf0 == subkey
process_string_fromparm_tobuf(0x13); // buf0 == key name char *buf1=process_string_fromparm_tobuf(0x13); // buf1 == key name
p[0]=0; p[0]=0;
if (RegOpenKeyEx((HKEY)rootkey,buf0,0,KEY_READ,&hKey) == ERROR_SUCCESS) if (RegOpenKeyEx((HKEY)rootkey,buf0,0,KEY_READ,&hKey) == ERROR_SUCCESS)
{ {
@ -1165,7 +1170,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
HKEY key; HKEY key;
char *p=var0; char *p=var0;
int b=process_string_fromparm_toint(3); int b=process_string_fromparm_toint(3);
process_string_fromparm_tobuf(0x12); char *buf1=process_string_fromparm_tobuf(0x12);
p[0]=0; p[0]=0;
if (RegOpenKeyEx((HKEY)parm1,buf1,0,KEY_ALL_ACCESS,&key) == ERROR_SUCCESS) if (RegOpenKeyEx((HKEY)parm1,buf1,0,KEY_ALL_ACCESS,&key) == ERROR_SUCCESS)
{ {
@ -1191,7 +1196,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{ {
HANDLE h; HANDLE h;
char *handleout=var3; char *handleout=var3;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
h=myOpenFile(buf0,parm1,parm2); h=myOpenFile(buf0,parm1,parm2);
if (h == INVALID_HANDLE_VALUE) if (h == INVALID_HANDLE_VALUE)
{ {
@ -1216,8 +1221,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
} }
else else
{ {
process_string_fromparm_tobuf(0x11); l=mystrlen(process_string_fromparm_tobuf(0x11));
l=mystrlen(buf1);
} }
if (!*t || !WriteFile((HANDLE)myatoi(t),buf1,l,&dw,NULL)) if (!*t || !WriteFile((HANDLE)myatoi(t),buf1,l,&dw,NULL))
{ {
@ -1308,7 +1312,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
char *handleout=var2; char *handleout=var2;
HANDLE h; HANDLE h;
WIN32_FIND_DATA fd; WIN32_FIND_DATA fd;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
h=FindFirstFile(buf0,&fd); h=FindFirstFile(buf0,&fd);
if (h == INVALID_HANDLE_VALUE) if (h == INVALID_HANDLE_VALUE)
{ {
@ -1329,7 +1333,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
{ {
int ret=-666; int ret=-666;
HANDLE hFile; HANDLE hFile;
process_string_fromparm_tobuf(0x00); char *buf0=process_string_fromparm_tobuf(0x00);
if (validpathspec(buf0)) if (validpathspec(buf0))
{ {
@ -1402,7 +1406,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
} }
else else
{ {
process_string_fromparm_tobuf(0x01); char *buf0=process_string_fromparm_tobuf(0x01);
log_printf2("%s",buf0); log_printf2("%s",buf0);
} }
return 0; return 0;