Re: It works... now what?
- From: "hutch--" <hutch@xxxxxxxxx>
- Date: 27 Dec 2005 14:58:46 -0800
#2pencil,
There is nothing really to optimise in what is high level code but you
can tidy it up a bit and remove a jump or two. There is no reason to
use a leading "@" in masm code for labels so I removed it.
Here is your algo tidied up a bit.
;
-------------------------------------------------------------------------
Proxy_Change PROC STDCALL,src:DWORD
; ------------------------------------
; this code opens the windows registry,
; replaces the proxy server address,
; & then sets enable to 0 or 1
; ------------------------------------
invoke RegOpenKey,HKEY_CURRENT_USER,ADDR lpSubKey,ADDR lpFullKey
cmp eax,ERROR_SUCCESS
je cont
invoke MessageBox,0,offset ErrMsg,offset AppName,MB_OK
ret
cont:
mov esi, src
cmp BYTE PTR [esi],48
je off
on:
mov arg,1
invoke RegSetValueEx,lpFullKey,addr lpValueName2,NULL,
00000004h,addr arg,4
invoke RegSetValueEx,lpFullKey,addr lpValueName,
NULL,00000001h,offset ProxyAddr,32
jmp done
off:
mov arg,0
invoke RegSetValueEx,lpFullKey,addr lpValueName2,NULL,
00000004h,addr arg,4
invoke RegSetValueEx,lpFullKey,addr lpValueName,
NULL,00000001h,offset FakeProxyAddr,32
done:
invoke RegCloseKey,lpFullKey
invoke MessageBox,0,addr Finish,offset AppName,MB_OK
ret
Proxy_Change ENDP
;
-------------------------------------------------------------------------
Regards,
hutch at movsd dot com
.
- Follow-Ups:
- Re: It works... now what?
- From: \\\~\o/~///annabee
- Re: It works... now what?
- References:
- It works... now what?
- From: #2pencil
- Re: It works... now what?
- From: Robert Redelmeier
- It works... now what?
- Prev by Date: Re: Numeric output
- Next by Date: Re: It works... now what?
- Previous by thread: Re: It works... now what?
- Next by thread: Re: It works... now what?
- Index(es):
Relevant Pages
|
|