emekcagriyerman / Y-axis-sensitivity-fixer-for-gta_sa.exe

A bug fixer for sensitivity error in y axis for SA:MP
0 stars 0 forks source link

A few questions & warnings on compile #1

Open Chaprnks opened 7 years ago

Chaprnks commented 7 years ago

I am not sure weather this should be built into a .dll (& injected), or if its possible to use it as a .ASI (& load with ASI loader)?

Also, when I compile this (simple MingW compiler), I get a few compile warnings.

mousefixer.cpp:14:72: warning: passing NULL to non-pointer argument 2 of 'void* CreateToolhelp32Snapshot(DWORD, DWORD)' [-Wconversion-null]
     HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
mousefixer.cpp:31:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  ReadProcessMemory(hProcess, (void*)addr1, &value, sizeof(value), 0);
mousefixer.cpp:34:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  WriteProcessMemory(hProcess, (void*)addr2, &value, sizeof(value), 0);

nfuvpdg

emekcagriyerman commented 7 years ago

It should be built into an executable. I changed the code. You might replace those lines: HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); DWORD addr1 = 0xB6EC1C; DWORD addr2 = 0xB6EC1C-4; with HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); long long addr1 = 0xB6EC1C; long long addr2 = 0xB6EC1C-4; and you might want to delete this line (33) because it was a customization: value = value*9/16;