Displaying 20 results from an estimated 32 matches for "virtualprotect".
2001 Dec 11
0
VirtualProtect and app crash: what's your interpretation?
...5D704
00760D83 imul eax, 28h
00760D86 mov eax, [eax+ecx+34h]
00760D8A sub eax, [ebp-4]
00760D8D cmp ds:dword_75D734, 2
00760D94 mov [ebp-14h], eax
;
; If (*(long *)75D734) != 2 then skip the call to
; VirtualProtect
;
00760D97 jnz short loc_760DC4
;
; Push arguments to VirtualProtect(
; LPVOID lpAddress,
; SIZE_T dwSize,
; DWORD flNewProtect,
; PDWORD lpflOldProtect)
;
00760D99 lea eax, [ebp-8]
;
; lpflOldProtect is a local variable
;
00760D9C...
2008 Jul 30
2
[LLVMdev] More llvm-gcc build breakage
On Wed, Jul 30, 2008 at 11:32:18AM -0700, Bill Wendling wrote:
> On Jul 30, 2008, at 11:17 AM, Julien Lerouge wrote:
>> ../../../llvm-gcc4.2-src/gcc/libgcc2.c:2095: error: conflicting types
>> for 'VirtualProtect'
>>
>> c:/cygwin/home/jlerouge/buildbot/llvm/lib/../include/winbase.h:1998:
>> error: previous declaration of 'VirtualProtect' was here
>>
> This is weird. Why is it #including this header during the bootstrap?
Not sure, I'll take a look. This is not a re...
2001 Dec 11
1
VirtualProtect and app crash: exception handling?
...les of 0x1000, each access
throwing an exception, until it hit the last exception at 0x757000, and
then then program ran normally. Probably no coincidence, since the next
writable segment starts at 0x759000.
So apparently the program is designed to throw the exceptions.
Just before the call to VirtualProtect:
0806d398:Call kernel32.SetUnhandledExceptionFilter(0075f447) ret=0075f0cb
0806d398:Ret kernel32.SetUnhandledExceptionFilter() retval=00000000
ret=0075f0cb
This function is this:
0075F447 sub_75F447 proc near
0075F447 call sub_75F047
0075F44C xor eax...
2008 Aug 12
0
[LLVMdev] More llvm-gcc build breakage
...n Wed, Jul 30, 2008 at 03:06:54PM -0700, Julien Lerouge wrote:
> On Wed, Jul 30, 2008 at 11:32:18AM -0700, Bill Wendling wrote:
> > On Jul 30, 2008, at 11:17 AM, Julien Lerouge wrote:
> >> ../../../llvm-gcc4.2-src/gcc/libgcc2.c:2095: error: conflicting types
> >> for 'VirtualProtect'
> >>
> >> c:/cygwin/home/jlerouge/buildbot/llvm/lib/../include/winbase.h:1998:
> >> error: previous declaration of 'VirtualProtect' was here
> >>
> > This is weird. Why is it #including this header during the bootstrap?
>
> Not sure, I...
2001 Dec 12
0
App crashes and exception handling [Was: Re: VirtualProtect and app crash]
This is where that 0x761B10 address must have been coming from:
007605E2 sub_7605E2 proc near ; CODE XREF: start+88^Xp
007605E2 mov eax, large fs:0
007605E8 push ebp
007605E9 mov ebp, esp
007605EB push 0FFFFFFFFh
007605ED push 75A010h
007605F2 push 761B10h
2001 Dec 12
3
Bug in PE_LoadImage/map_image? [Was: VirtualProtect and app crash]
I used WinDbg to show the memory protections that were placed on the
executable image just after it was loaded, and just before the app starts.
Here is what wine shows:
View: 0x400000 - 0x765fff 28
0x400000 - 0x765fff c-rw-
Here is what WinDbg shows (manually edited to look like the wine view):
0x400000 - 0x400fff c-r-- (PAGE_READONLY)
0x401000 - 0x454fff c--W- (PAGE_WRITECOPY)
2012 Jan 07
0
[LLVMdev] [llvm-commits] [PATCH][Compiler-rt] Windows implementation of mmap functionality in clear_cache_test and enable_execute_stack_test
Hi Ruben,
> I see I missed some curly braces. I also modified spacing a tiny bit.
Doesn't seem so. E.g. you have:
+ if ( !VirtualQuery(addr, &b, sizeof(b)) )
+ exit(1);
+ if( !VirtualProtect(b.BaseAddress, b.RegionSize,
PAGE_EXECUTE_READWRITE, &b.Protect) )
Add space after "if". Do not put spaces after "(" and before ")". Same
for other places in the file.
--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg...
2012 Jan 07
3
[LLVMdev] [PATCH][Compiler-rt] Windows implementation of mmap functionality in clear_cache_test and enable_execute_stack_test
...(char*)((uintptr_t)execution_buffer & (-4095));
char* end = (char*)((uintptr_t)(&execution_buffer[128+4096]) & (-4095));
+#if defined(_WIN32)
+ DWORD dummy_oldProt;
+ MEMORY_BASIC_INFORMATION b;
+ if ( !VirtualQuery(start, &b, sizeof(b)) )
+ return 1;
+ if ( !VirtualProtect(b.BaseAddress, b.RegionSize, PAGE_EXECUTE_READWRITE, &b.Protect) )
+#else
if ( mprotect(start, end-start, PROT_READ|PROT_WRITE|PROT_EXEC) != 0 )
+#endif
return 1;
// verify you can copy and execute a function
@@ -53,7 +70,8 @@
__clear_cache(execution_buffer, &execu...
2008 Jul 30
2
[LLVMdev] More llvm-gcc build breakage
...jlerouge/buildbot/llvm-src/include -DL_trampoline -c
../../../llvm-gcc4.2-src/gcc/libgcc2.c -o libgcc/./_trampoline.o
../../../llvm-gcc4.2-src/gcc/libgcc2.c:2086: warning: no previous
prototype for 'getpagesize'
../../../llvm-gcc4.2-src/gcc/libgcc2.c:2095: error: conflicting types
for 'VirtualProtect'
c:/cygwin/home/jlerouge/buildbot/llvm/lib/../include/winbase.h:1998:
error: previous declaration of 'VirtualProtect' was here
../../../llvm-gcc4.2-src/gcc/libgcc2.c:2100: warning: no previous
prototype for 'mprotect'
make[3]: *** [libgcc/./_trampoline.o] Error 1
make[3]: Lea...
2008 Jul 30
0
[LLVMdev] More llvm-gcc build breakage
...rc/gcc/libgcc2.c -o libgcc/./_trampoline.o
> ../../../llvm-gcc4.2-src/gcc/libgcc2.c:2086: warning: no previous
> prototype for 'getpagesize'
>
I think that this was also a temporary situation.
> ../../../llvm-gcc4.2-src/gcc/libgcc2.c:2095: error: conflicting types
> for 'VirtualProtect'
>
> c:/cygwin/home/jlerouge/buildbot/llvm/lib/../include/winbase.h:1998:
> error: previous declaration of 'VirtualProtect' was here
>
This is weird. Why is it #including this header during the bootstrap?
> ../../../llvm-gcc4.2-src/gcc/libgcc2.c:2100: warning: no previou...
2012 Jan 07
1
[LLVMdev] [llvm-commits] [PATCH][Compiler-rt] Windows implementation of mmap functionality in clear_cache_test and enable_execute_stack_test
...(char*)((uintptr_t)execution_buffer & (-4095));
char* end = (char*)((uintptr_t)(&execution_buffer[128+4096]) & (-4095));
+#if defined(_WIN32)
+ DWORD dummy_oldProt;
+ MEMORY_BASIC_INFORMATION b;
+ if ( !VirtualQuery(start, &b, sizeof(b)) )
+ return 1;
+ if ( !VirtualProtect(b.BaseAddress, b.RegionSize, PAGE_EXECUTE_READWRITE, &b.Protect) )
+#else
if ( mprotect(start, end-start, PROT_READ|PROT_WRITE|PROT_EXEC) != 0 )
+#endif
return 1;
// verify you can copy and execute a function
Index: test/Unit/enable_execute_stack_test.c
====================...
2012 Jan 07
2
[LLVMdev] [llvm-commits] [PATCH][Compiler-rt] Windows implementation of mmap functionality in clear_cache_test and enable_execute_stack_test
.../1/7 Anton Korobeynikov <anton at korobeynikov.info>
> Hi Ruben,
>
> > I see I missed some curly braces. I also modified spacing a tiny bit.
> Doesn't seem so. E.g. you have:
>
> + if ( !VirtualQuery(addr, &b, sizeof(b)) )
> + exit(1);
> + if( !VirtualProtect(b.BaseAddress, b.RegionSize,
> PAGE_EXECUTE_READWRITE, &b.Protect) )
> Add space after "if". Do not put spaces after "(" and before ")". Same
> for other places in the file.
>
OK, I followed the rules you set forth here. But the files followed
differen...
2015 May 15
0
Wine release 1.7.43
...):
ws2_32: Fix ai_canonname buffer allocation in addrinfo_AtoW.
Qian Hong (2):
server: Remove useless trailing comma in array.
ntdll/tests: Fixed typo.
Sebastian Lackner (13):
ntdll: Use lockfree implementation for get_cached_fd.
kernel32/tests: Add tests for calling VirtualProtect with NULL as last argument.
kernel32: Do not omit mandatory argument for VirtualProtect.
krnl386.exe16: Do not omit mandatory argument for VirtualProtect.
ntdll: Do not omit mandatory argument for VirtualProtect.
winedevice: Do not omit mandatory argument for VirtualProtect....
2001 Dec 08
1
LoadOEMResource crash [Was: Re: Problem report: SHRINKER.ERR, fix to DEVICE_Open/CreateFileA? ]
...bg, although
it crashes in the same winedbg place under gdb.
I took a closer look at wine --winver nt40 --debugmsg +all.
I found something interesting. If I search for queue_exception, I find
that there is an exception raised before the LoadOEMCall, about
328klines in:
0806d398:Call
kernel32.VirtualProtect(00459000,00000018,00000002,40616e74) ret=0075fd82
0806d398:trace:virtual:VirtualProtect 0x459000 00000018 00000002
0806d398:trace:virtual:VIRTUAL_SetProt 0x459000-0x459fff c-r--
View: 0x400000 - 0x765fff 28
0x400000 - 0x400fff c-r--
0x401000 - 0x458fff c----
0x459000 - 0x459fff...
2008 Jul 30
0
[LLVMdev] More llvm-gcc build breakage
Hi Bill,
This is probably due to the llvm-gcc merge. Please take a look.
Thanks,
Evan
On Jul 30, 2008, at 10:04 AM, Duncan Sands wrote:
> x86-64 linux, during stage3:
>
> xgcc -B/home/duncan/LLVM/gcc-4.2.llvm-objects/./gcc/ -B/usr/local/
> gnat-llvm/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gnat-llvm/
> x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gnat-llvm/x86_64-
2008 Jul 30
2
[LLVMdev] More llvm-gcc build breakage
x86-64 linux, during stage3:
xgcc -B/home/duncan/LLVM/gcc-4.2.llvm-objects/./gcc/ -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gnat-llvm/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/include -isystem /usr/local/gnat-llvm/x86_64-unknown-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I../../../gcc-4.2.llvm/libgomp -I.
2008 Aug 12
0
[LLVMdev] More llvm-gcc build breakage
> Rev 54193 seems to cause that failure doing a non bootstrap build on
> MingW.
> +#ifdef __i386__
> +extern int VirtualProtect (char *, int, int, int *) __attribute__((stdcall));
> +#endif
Do we need this stuff at all? afair, I deleted the whole lines in r47684 to sync libgcc2.c with
mainline gcc.
--
WBR, Anton Korobeynikov
2013 Jun 25
0
[LLVMdev] [PATCH] Windows implementation of enable_execute_stack
...followed by the generic Unix implementation. Neither applies to Win32, so
> I ifdef'ed the whole thing.
>
>
>> > + MEMORY_BASIC_INFORMATION b;
>> > +
>> > + if (!VirtualQuery(addr, &b, sizeof(b)))
>> > + exit(1);
>> > + if (!VirtualProtect(b.BaseAddress, b.RegionSize,
>> PAGE_EXECUTE_READWRITE, &b.Protect))
>> > + exit(1);
>> > +#endif /* _WIN32 */
>> > }
>>
>> Aside from that, patch LGTM.
>>
>
> Great!
>
> Ruben
>
>
>>
>> ~Aaron
>>
>
&...
2008 Aug 14
1
Complete National Geographic For Windows:DOSMEM_MapDosLayout
...M_MapDosLayout(void)
> 500 {
> 501 static int already_mapped;
> 502
> 503 if (!already_mapped)
> 504 {
> 505 HMODULE16 hModule;
> 506 unsigned short sel;
> 507 LDT_ENTRY entry;
> 508
> 509 if (DOSMEM_dosmem || !VirtualProtect( NULL, DOSMEM_SIZE, PAGE_EXECUTE_READWRITE, NULL ))
> 510 {
> 511 ERR( "Need full access to the first megabyte for DOS mode\n" );
> 512 ExitProcess(1);
> 513 }
>
The variable DOSMEM_MapDosLayout at line 499 of the same module and...
2017 Nov 21
2
question about xray tls data initialization
...uf.Data
FunctionRecord pack , __attribute__((packed)) => #pragma
pack(push,1), msvc also requires bitfields to be same type to pack
them together( all types => uint32_t)
FD int => HANDLE, most code logic still valid (-1 as invalid value),
r/w API replaced with windows
mprotect => VirtualProtect
readTSC in xray_x86_64.inc also works for windows
replace read tsc from proc with QueryPerformanceFrequency
msvc can not compile such code
void setupNewBuffer(int (*wall_clock_reader)(clockid_t,
struct timespec *));
must use typedef first . xr...