dword

How could I disable windows effects through batch

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to disable these options shown in the picture below using a batch file. I am making a program that can boost a computers performance can any one help. my OS is windows 7 32bit 回答1: To disable the effects sc stop uxsms To enable the effects sc stop uxsms You have to run it as Admin. Like npocmaka said you have to change the value of the registry key : [HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects] "VisualFXSetting"=dword:00000002" With one of these value : "VisualFXSetting"=dword:00000002

C++ hooking winsock

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to hook winsock send and recv in order to read all traffic of a process. I am injectin the following code as a dll inside the target process #include "dll.h" #include <windows.h> #include <winsock2.h> #include <iostream> #include <fstream> #pragma comment(lib, "ws2_32.lib") using namespace std; DllClass::DllClass() { } DllClass::~DllClass () { } BYTE hook[6]; BYTE hook2[6]; BYTE jmp[6] = { 0xe9,0x00, 0x00, 0x00, 0x00 ,0xc3 }; ofstream myfile; ofstream myfile2; DWORD HookFunction(LPCSTR lpModule, LPCSTR lpFuncName, LPVOID

Writing string (REG_SZ) values to the registry in C++

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got most of the code for writing a value to the windows registry, however when I change the path to a dummy key and value that I've set up for testing it fails. My code is below: HKEY hKey; LPCTSTR sk = TEXT("SOFTWARE\TestSoftware"); LONG openRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, sk, 0, KEY_ALL_ACCESS , &hKey); if (openRes==ERROR_SUCCESS) { printf("Success opening key."); } else { printf("Error opening key."); } LPCTSTR value = TEXT("TestSoftwareKey"); LPCTSTR data = "TestData\0"; LONG setRes = RegSetValueEx (hKey, value, 0, REG_SZ,

Private unique device identifier in iOS

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We're working on a project with my colleagues which involves using a lot of private and non official code. This is not intended for AppStore use. The first and only requirement we have is to not use jailbreak. First of all, UDID or OpenUDID or any other solutions don't work here and they're not expected to. We've done a lot of background research and tests, starting with trying to get the IMEI , ICCID, IMSI and the Serial Number programatically. None of the above methods work with iOS 7 and above without jailbreak. We've also spent a couple

error C2440: &#039;type cast&#039; : cannot convert from &#039;std::_Vector_iterator&lt;_Ty,_Alloc&gt;&#039; to &#039;DWORD&#039;

匿名 (未验证) 提交于 2019-12-03 02:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I get the following error: error C2440: 'type cast' : cannot convert from 'std::_Vector_iterator<_Ty,_Alloc>' to 'DWORD' with [ _Ty=LPCSTR , _Alloc=std::allocator<LPCSTR > ] No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Im using Visual Studio 2005. This worked on older Visual Studio but not on this one. Heres the code causing errors: std::vector<LPCSTR> factions; ... *(DWORD*)(offset+0x571) = (DWORD)factions.begin(); <- error here How can I solve this? 回答1: Is your goal to

Ternary operator is twice as slow as an if-else block?

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I read everywhere that ternary operator is supposed to be faster than, or at least the same as, its equivalent if - else block. However, I did the following test and found out it's not the case: Random r = new Random(); int[] array = new int[20000000]; for(int i = 0; i 0) { value += 2; } else { value += 3; } // if-else block above takes on average 85 ms // OR I can use a ternary operator: // value += i > 0 ? 2 : 3; // takes 157 ms } DateTime end = DateTime.UtcNow; MessageBox.Show("Measured time: " + (end-begin).TotalMilliseconds + " ms.\r

Does gcc really know how to output NASM Assembly

匿名 (未验证) 提交于 2019-12-03 02:22:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So I have a simple C program that loops through the args passed to main then returns: #include <stdio.h> int main(int argc, char *argv[]) { int i; for(i = 0; i < argc; ++i) { fprintf(stdout, "%s\n", argv[i]); } return 0; } I wanted to see how gcc wrote out the assembly in NASM format. I was looking over the output in the .asm file and noticed that the syntax was TASM. Below is the make file and the output from gcc. Am I doing something wrong or is it that gcc does not output true NASM syntax? all: main main: main.o ld -o main main.o main.o :

VC++ 6.0 access violation when run in debugger

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to add enhancements to a 4 year old VC++ 6.0 program. The debug build runs from the command line but not in the debugger: it crashes with an access violation inside printf(). If I skip the printf, then it crashes in malloc() (called from within fopen()) and I can't skip over that. This means I cannot run in the debugger and have to rely on the old printf statements to see what's going on. This obviously makes it a lot harder. Any idea why printf() and malloc() would fail when running under the VC++ debugger? I am no good at this

Does moving variable declaration outside of a loop actually increase performance?

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm writing very processor-intensive cryptography code (C#), so I'm looking for any performance gains, no matter how small. I've heard opinions both ways on this subject. Is there any performance benefit at all to int smallPrime, spGen; for (int i = 0; i over this? for (int i = 0; i Does the compiler do this already? 回答1: There is no performance benefit at all. All local variables are allocated when the stack frame for the method is created, so it doesn't matter where in the method you declare them. It's only the scope of the variables that

How to compare enum and int values?

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: enum MyEnum { Invalid = 0 , Value1 = 1 , Value1 = 2 , } void main () { MyEnum e1 = MyEnum . Value1 ; int i1 = 2 ; // Is there any difference how to compare enumEration values with integers? if ( e1 ==( MyEnum ) i1 )... // 1st if ( ( int ) e1 == i1 )... // 2nd In each of mentioned cases we have convertion of enum to int or int to enum. Is there any difference in these conversions (performance, any other)? Or they are exactly the same? Thanks. P.S. In current example I compare to 'magic number' but in real application I am getting data from