@@ -1704,19 +1704,20 @@ int32_t env_w32_hook_VirtualProtect(struct emu_env *env, struct emu_env_hook *ho
17041704uint32_t oldprotect ;
17051705POP_DWORD (c , & oldprotect );
17061706
1707- uint32_t returnvalue ;
1708- if ( hook -> hook .win -> userhook != NULL )
1709- {
1710- returnvalue = hook -> hook .win -> userhook (env , hook , p_address , size , newprotect , oldprotect );
1711- } else
1712- {
1713- returnvalue = 1 ;
1714- }
1707+ uint32_t returnvalue ;
1708+ if ( hook -> hook .win -> userhook != NULL )
1709+ {
1710+ returnvalue = hook -> hook .win -> userhook (env , hook , p_address , size , newprotect , oldprotect );
1711+ } else
1712+ {
1713+ returnvalue = 1 ;
1714+ }
17151715
1716- if ( env -> profile != NULL )
1716+ if ( env -> profile != NULL )
17171717{
17181718emu_profile_function_add (env -> profile , "VirtualProtect" );
17191719emu_profile_argument_add_ptr (env -> profile , "LPCVOID" , "lpAddress" , p_address );
1720+ emu_profile_argument_add_none (env -> profile );
17201721emu_profile_argument_add_int (env -> profile , "DWORD" , "dwSize" , size );
17211722emu_profile_argument_add_int (env -> profile , "DWORD" , "flNewProtect" , newprotect );
17221723emu_profile_argument_add_int (env -> profile , "PDWORD" , "lpflOldProtectt" , newprotect );
@@ -1729,15 +1730,16 @@ int32_t env_w32_hook_VirtualProtect(struct emu_env *env, struct emu_env_hook *ho
17291730}
17301731
17311732
1733+
17321734int32_t env_w32_hook_VirtualProtectEx (struct emu_env * env , struct emu_env_hook * hook )
17331735{
1734- logDebug (env -> emu , "Hook me Captain Cook!\n" );
1735- logDebug (env -> emu , "%s:%i %s\n" ,__FILE__ ,__LINE__ ,__FUNCTION__ );
1736+ logDebug (env -> emu , "Hook me Captain Cook!\n" );
1737+ logDebug (env -> emu , "%s:%i %s\n" ,__FILE__ ,__LINE__ ,__FUNCTION__ );
17361738
1737- struct emu_cpu * c = emu_cpu_get (env -> emu );
1739+ struct emu_cpu * c = emu_cpu_get (env -> emu );
17381740
1739- uint32_t eip_save ;
1740- POP_DWORD (c , & eip_save );
1741+ uint32_t eip_save ;
1742+ POP_DWORD (c , & eip_save );
17411743
17421744
17431745/*
@@ -1752,40 +1754,42 @@ int32_t env_w32_hook_VirtualProtectEx(struct emu_env *env, struct emu_env_hook *
17521754uint32_t h_process ;
17531755POP_DWORD (c , & h_process );
17541756
1755- uint32_t p_address ;
1756- POP_DWORD (c , & p_address );
1757+ uint32_t p_address ;
1758+ POP_DWORD (c , & p_address );
17571759
1758- uint32_t size ;
1759- POP_DWORD (c , & size );
1760+ uint32_t size ;
1761+ POP_DWORD (c , & size );
17601762
1761- uint32_t newprotect ;
1762- POP_DWORD (c , & newprotect );
1763+ uint32_t newprotect ;
1764+ POP_DWORD (c , & newprotect );
17631765
1764- uint32_t oldprotect ;
1765- POP_DWORD (c , & oldprotect );
1766+ uint32_t oldprotect ;
1767+ POP_DWORD (c , & oldprotect );
17661768
1767- uint32_t returnvalue ;
1768- if ( hook -> hook .win -> userhook != NULL )
1769- {
1770- returnvalue = hook -> hook .win -> userhook (env , hook , p_address , size , newprotect , oldprotect );
1771- } else
1772- {
1773- returnvalue = 1 ;
1774- }
1769+ uint32_t returnvalue ;
1770+ if ( hook -> hook .win -> userhook != NULL )
1771+ {
1772+ returnvalue = hook -> hook .win -> userhook (env , hook , p_address , size , newprotect , oldprotect );
1773+ } else
1774+ {
1775+ returnvalue = 1 ;
1776+ }
17751777
1776- if ( env -> profile != NULL )
1777- {
1778+ if ( env -> profile != NULL )
1779+ {
17781780emu_profile_function_add (env -> profile , "VirtualProtectEx" );
17791781emu_profile_argument_add_ptr (env -> profile , "HANDLE" , "hProcess" , h_process );
1782+ emu_profile_argument_add_none (env -> profile );
17801783emu_profile_argument_add_ptr (env -> profile , "LPCVOID" , "lpAddress" , p_address );
1784+ emu_profile_argument_add_none (env -> profile );
17811785emu_profile_argument_add_int (env -> profile , "DWORD" , "dwSize" , size );
17821786emu_profile_argument_add_int (env -> profile , "DWORD" , "flNewProtect" , newprotect );
17831787emu_profile_argument_add_int (env -> profile , "PDWORD" , "lpflOldProtectt" , newprotect );
17841788emu_profile_function_returnvalue_int_set (env -> profile , "BOOL" , returnvalue );
1785- }
1789+ }
17861790
1787- emu_cpu_reg32_set (c , eax , returnvalue );
1788- emu_cpu_eip_set (c , eip_save );
1789- return 0 ;
1790- }
1791+ emu_cpu_reg32_set (c , eax , returnvalue );
1792+ emu_cpu_eip_set (c , eip_save );
17911793
1794+ return 0 ;
1795+ }
0 commit comments