

![]() |
![]() |
|
|||||||
![]() |
![]() |
| Code Snippets and Tutorials The place for open source releases, great information, and tutorials written by other members. |
![]() |
|
|
LinkBack | Thread Tools |
![]() |
![]() |
|
|
#21 (permalink) |
|
Ereetu.
Senior Member
Game Hacking Staff ![]() ![]() High Priest Join Date: Oct 2005
Location: xor 1D27,1337
Posts: 1,565
![]() ![]() ![]() ![]() |
You are right, which is why what I had in mind was to remove the function that is actually stopping OpenProcess. Other than that, I didn't even post this method.
00FA is 11111010, So if I were to change it to FFFF, it would allow everything, or do we want only to allow OpenProcess, but I can't seem to find which bit that is..
__________________
![]() ![]()
Last edited by Zephyrix : 08-07-2006 at 11:04 PM. |
|
|
|
![]() |
![]() |
| Sponsored links | |
|
Advertisement
|
|
![]() |
![]() |
|
|
#22 (permalink) |
![]() ![]() ![]() Advocate Join Date: Feb 2005
Posts: 330
![]() |
The function that is stopping OpenProcess is built into Windows. Your process token's access rights are being compared with Starcraft's DACL (discrecionary access control list) and you are being denied.
Carrying out this plan would take a good deal of knowledge about the internal workings of Windows regarding security, and I am certainly no guru on this matter. I know only what my personal research and scouring of MSDN has taught me. I too searched for what that access mask represented, and granted, I only spent about 5 minutes on MSDN searching, but I couldn't find any info either. Anyway, the point is that you don't need to know. Just set SeDebugPrivilege for your process and be done with it. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#23 (permalink) |
![]() ![]() Deviant Join Date: Feb 2005
Posts: 121
![]() |
Code:
Private Const CREATE_SUSPENDED = &H4&
Private Const STARTF_USESHOWWINDOW = &H1
Private Enum enSW
SW_NORMAL = 1
End Enum
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Byte
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
Private Enum enPriority_Class
NORMAL_PRIORITY_CLASS = &H20
End Enum
Private Declare Function ResumeThread Lib "kernel32" (ByVal hThread As Long) As Long
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Function createSC(ByVal App As String, ByVal WorkDir As String, dwMilliseconds As Long, ByVal Start_Size As enSW, ByVal Priority_Class As enPriority_Class) As Boolean
Dim sInfo As STARTUPINFO
Dim pInfo As PROCESS_INFORMATION
'Not used, but needed
Dim Sec1 As SECURITY_ATTRIBUTES
Dim Sec2 As SECURITY_ATTRIBUTES
'Set the structure size
Sec1.nLength = Len(Sec1)
Sec2.nLength = Len(Sec2)
sInfo.cb = Len(sInfo)
'Set the flags
sInfo.dwFlags = STARTF_USESHOWWINDOW
'Set the window's startup position
sInfo.wShowWindow = Start_Size
'Set the priority class
If CreateProcess(vbNullString, App, Sec1, Sec2, False, NORMAL_PRIORITY_CLASS, 0&, WorkDir, sInfo, pInfo) Then
'Wait
WaitForSingleObject pInfo.hProcess, dwMilliseconds
createSC = True
'displays
pHandle = pInfo.hProcess
'WriteProcessMemory pHandle, &H4DF0ED, Chr$(2), 1, 0&
'uncomment to patch for all apps
Call ResumeThread(pHandle)
Else
createSC = False
End If
If Not createSC Then
pHandle = 0
MsgBox "Could not create thread!", vbCritical, "Error"
End If
End Function
Private Sub ExecuteCreation()
Dim sDirectory As String, sFullPath As String
sFullPath = GetINI("Loader", "EXEPath") 'modify this w/ etc. c:\program files\starcraft.exe
sDirectory = Left$(sFullPath, InStr(LCase$(sFullPath), "starcraft.exe") - 1)
createSC sFullPath, sDirectory, 0, SW_NORMAL, CREATE_SUSPENDED
End Sub
VB6 working code. Had to work with some examples, tweak and research a little here and there. And special thanks to Kc for leading us in the right direction with his sample code. You can use this to make a vb6 loader, or to simply grab the phandle for your app. ----- [EDIT] Suddenly noticing, I can't connect to battle.net -- again. Except this time its saying cant connect to server, make sure its a valid ip, modem is connected bla bla. Does this api affect that...
__________________
------------E--1--3--3--7------B--O--R--N------H--A--R--D------------
Last edited by Vague : 08-08-2006 at 12:05 AM. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#34 (permalink) |
![]() ![]() Deviant Join Date: Feb 2005
Posts: 121
![]() |
lazy? i slapped togethor a bunch of code using said methods. and it didn't work. yes it launched bw and was able to obtain the handle, but apparently this method was very well tested as it WONT LET THE GAME CONNECT TO BATTLENET. I don't know but that seems like an issue to me? Maybe im doing something wrong, I supplied the coding already that launches it, how hard is it to look at it, maybe youre the lazy one?
it loads up fine and all but when you try to connect says your net is not connected or invalid server ip.
__________________
------------E--1--3--3--7------B--O--R--N------H--A--R--D------------
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#35 (permalink) | ||
|
The Sexy Penguin
Senior Member
Retired Staff Member ![]() ![]() ![]() Prophet |
I just tested this and it works fine with battle.net, you're probably ****ing up somewhere.
__________________
Quote:
LCS, 707, BELPHEGOR YEEEEEEEH BITCH Quote:
|
||
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#36 (permalink) | |
|
F7 F1EF
Senior Member
Retired Staff Member ![]() ![]() ![]() ![]() Enlightened Join Date: Jun 2004
Location: Torreón, Coah. México
Posts: 3,219
![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
__________________
|
|
|
|
|
![]() |
![]() |