Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text:00744FB0 _InitUserDirectories proc near ; CODE XREF: $_chdirUserDirp
- .text:00744FB0 ; sub_619060+15p
- .text:00744FB0 ; _psInitialize+50p
- .text:00744FB0
- .text:00744FB0 hKey = dword ptr -0Ch
- .text:00744FB0 cbData = dword ptr -8
- .text:00744FB0 Type = dword ptr -4
- .text:00744FB0
- .text:00744FB0 000 sub esp, 0Ch
- .text:00744FB3 00C lea eax, [esp+0Ch+hKey]
- .text:00744FB7 00C push eax ; phkResult
- .text:00744FB8 010 push KEY_READ ; samDesired
- .text:00744FBD 014 push 0 ; ulOptions
- .text:00744FBF 018 push offset SubKey ; "Software\\Microsoft\\Windows\\CurrentVersi"...
- .text:00744FC4 01C push HKEY_CURRENT_USER ; hKey
- .text:00744FC9 020 mov [esp+20h+hKey], 0
- .text:00744FD1 020 call ds:__imp_RegOpenKeyExA
- .text:00744FD7 00C test eax, eax
- .text:00744FD9 00C jnz loc_745180
- .text:00744FDF 00C lea ecx, [esp+0Ch+cbData]
- .text:00744FE3 00C push ecx ; lpcbData
- .text:00744FE4 010 push offset gta_user_dir_path ; lpData
- .text:00744FE9 014 lea edx, [esp+14h+Type]
- .text:00744FED 014 push edx ; lpType
- .text:00744FEE 018 push eax ; lpReserved
- .text:00744FEF 01C mov eax, [esp+1Ch+hKey]
- .text:00744FF3 01C push offset ValueName ; "Personal"
- .text:00744FF8 020 push eax ; hKey
- .text:00744FF9 024 mov [esp+24h+cbData], 100h
- .text:00745001 024 call ds:__imp_RegQueryValueExA
- .text:00745007 00C test eax, eax
- .text:00745009 00C jnz loc_745175
- .text:0074500F 00C mov ecx, [esp+0Ch+hKey]
- .text:00745013 00C push ebx
- .text:00745014 010 push ebp
- .text:00745015 014 push esi
- .text:00745016 018 push edi
- .text:00745017 01C push ecx ; hKey
- .text:00745018 020 call ds:__imp_RegCloseKey
- .text:0074501E 01C mov edi, offset gta_user_dir_path
- .text:00745023 01C dec edi
- .text:00745024
- .text:00745024 loc_745024: ; CODE XREF: _InitUserDirectories+7Aj
- .text:00745024 01C mov al, [edi+1]
- .text:00745027 01C inc edi
- .text:00745028 01C test al, al
- .text:0074502A 01C jnz short loc_745024
- .text:0074502C 01C push 0 ; hTemplateFile
- .text:0074502E 020 push 2000080h ; dwFlagsAndAttributes
- .text:00745033 024 push OPEN_EXISTING ; dwCreationDisposition
- .text:00745035 028 push 0 ; lpSecurityAttributes
- .text:00745037 02C push FILE_SHARE_READ ; dwShareMode
- .text:00745039 030 mov ecx, 7
- .text:0074503E 030 mov esi, offset aGtaSanAndreasU ; "\\GTA San Andreas User Files"
- .text:00745043 030 push GENERIC_READ ; dwDesiredAccess
- .text:00745048 034 rep movsd
- .text:0074504A 034 mov esi, ds:__imp_CreateFileA
- .text:00745050 034 push offset gta_user_dir_path ; lpFileName
- .text:00745055 038 call esi ; __imp_CreateFileA
- .text:00745057 01C cmp eax, 0FFFFFFFFh
- .text:0074505A 01C mov ebp, ds:__imp_CloseHandle
- .text:00745060 01C mov ebx, ds:__imp_CreateDirectoryA
- .text:00745066 01C jnz short loc_745073
- .text:00745068 01C push 0 ; lpSecurityAttributes
- .text:0074506A 020 push offset gta_user_dir_path ; lpPathName
- .text:0074506F 024 call ebx ; __imp_CreateDirectoryA
- .text:00745071 01C jmp short loc_745076
- .text:00745073 ; ---------------------------------------------------------------------------
- .text:00745073
- .text:00745073 loc_745073: ; CODE XREF: _InitUserDirectories+B6j
- .text:00745073 01C push eax ; hObject
- .text:00745074 020 call ebp ; __imp_CloseHandle
- .text:00745076
- .text:00745076 loc_745076: ; CODE XREF: _InitUserDirectories+C1j
- .text:00745076 01C xor eax, eax
- .text:00745078 01C jmp short loc_745080
- .text:00745078 ; ---------------------------------------------------------------------------
- .text:0074507A 01C align 10h
- .text:00745080
- .text:00745080 loc_745080: ; CODE XREF: _InitUserDirectories+C8j
- .text:00745080 ; _InitUserDirectories+DFj
- .text:00745080 01C mov cl, gta_user_dir_path[eax]
- .text:00745086 01C mov _tmpUserPath[eax], cl
- .text:0074508C 01C inc eax
- .text:0074508D 01C test cl, cl
- .text:0074508F 01C jnz short loc_745080
- .text:00745091 01C mov edi, offset _tmpUserPath
- .text:00745096 01C dec edi
- .text:00745097
- .text:00745097 loc_745097: ; CODE XREF: _InitUserDirectories+EDj
- .text:00745097 01C mov al, [edi+1]
- .text:0074509A 01C inc edi
- .text:0074509B 01C test al, al
- .text:0074509D 01C jnz short loc_745097
- .text:0074509F 01C mov edx, dword ptr ds:aGallery ; "\\Gallery"
- .text:007450A5 01C mov eax, dword ptr ds:aGallery+4
- .text:007450AA 01C mov cl, byte ptr ds:aGallery+8
- .text:007450B0 01C push 0 ; hTemplateFile
- .text:007450B2 020 push 2000080h ; dwFlagsAndAttributes
- .text:007450B7 024 push 3 ; dwCreationDisposition
- .text:007450B9 028 push 0 ; lpSecurityAttributes
- .text:007450BB 02C push 1 ; dwShareMode
- .text:007450BD 030 mov [edi], edx
- .text:007450BF 030 push 80000000h ; dwDesiredAccess
- .text:007450C4 034 mov [edi+4], eax
- .text:007450C7 034 push offset _tmpUserPath ; lpFileName
- .text:007450CC 038 mov [edi+8], cl
- .text:007450CF 038 call esi ; __imp_CreateFileA
- .text:007450D1 01C cmp eax, 0FFFFFFFFh
- .text:007450D4 01C jnz short loc_7450E1
- .text:007450D6 01C push 0 ; lpSecurityAttributes
- .text:007450D8 020 push offset _tmpUserPath ; lpPathName
- .text:007450DD 024 call ebx ; __imp_CreateDirectoryA ; CreateDirectory
- .text:007450DF 01C jmp short loc_7450E4
- .text:007450E1 ; ---------------------------------------------------------------------------
- .text:007450E1
- .text:007450E1 loc_7450E1: ; CODE XREF: _InitUserDirectories+124j
- .text:007450E1 01C push eax ; hObject
- .text:007450E2 020 call ebp ; __imp_CloseHandle
- .text:007450E4
- .text:007450E4 loc_7450E4: ; CODE XREF: _InitUserDirectories+12Fj
- .text:007450E4 01C xor eax, eax
- .text:007450E6 01C jmp short loc_7450F0
- .text:007450E6 ; ---------------------------------------------------------------------------
- .text:007450E8 01C align 10h
- .text:007450F0
- .text:007450F0 loc_7450F0: ; CODE XREF: _InitUserDirectories+136j
- .text:007450F0 ; _InitUserDirectories+14Fj
- .text:007450F0 01C mov cl, gta_user_dir_path[eax]
- .text:007450F6 01C mov byte_C92168[eax], cl
- .text:007450FC 01C inc eax
- .text:007450FD 01C test cl, cl
- .text:007450FF 01C jnz short loc_7450F0
- .text:00745101 01C mov edi, offset byte_C92168
- .text:00745106 01C dec edi
- .text:00745107
- .text:00745107 loc_745107: ; CODE XREF: _InitUserDirectories+15Dj
- .text:00745107 01C mov al, [edi+1]
- .text:0074510A 01C inc edi
- .text:0074510B 01C test al, al
- .text:0074510D 01C jnz short loc_745107
- .text:0074510F 01C mov edx, dword ptr ds:aUserTracks_0 ; "\\User Tracks"
- .text:00745115 01C mov eax, dword ptr ds:aUserTracks_0+4
- .text:0074511A 01C mov ecx, dword ptr ds:aUserTracks_0+8
- .text:00745120 01C push 0 ; hTemplateFile
- .text:00745122 020 push 2000080h ; dwFlagsAndAttributes
- .text:00745127 024 push 3 ; dwCreationDisposition
- .text:00745129 028 mov [edi], edx
- .text:0074512B 028 mov dl, byte ptr ds:aUserTracks_0+0Ch
- .text:00745131 028 push 0 ; lpSecurityAttributes
- .text:00745133 02C push 1 ; dwShareMode
- .text:00745135 030 mov [edi+4], eax
- .text:00745138 030 push 80000000h ; dwDesiredAccess
- .text:0074513D 034 mov [edi+8], ecx
- .text:00745140 034 push offset byte_C92168 ; lpFileName
- .text:00745145 038 mov [edi+0Ch], dl
- .text:00745148 038 call esi ; __imp_CreateFileA
- .text:0074514A 01C cmp eax, 0FFFFFFFFh
- .text:0074514D 01C jnz short loc_745165
- .text:0074514F 01C push 0 ; lpSecurityAttributes
- .text:00745151 020 push offset byte_C92168 ; lpPathName
- .text:00745156 024 call ebx ; __imp_CreateDirectoryA
- .text:00745158 01C pop edi
- .text:00745159 018 pop esi
- .text:0074515A 014 pop ebp
- .text:0074515B 010 pop ebx
- .text:0074515C 00C mov eax, offset gta_user_dir_path
- .text:00745161 00C add esp, 0Ch
- .text:00745164 000 retn
- .text:00745165 ; ---------------------------------------------------------------------------
- .text:00745165
- .text:00745165 loc_745165: ; CODE XREF: _InitUserDirectories+19Dj
- .text:00745165 01C push eax ; hObject
- .text:00745166 020 call ebp ; __imp_CloseHandle
- .text:00745168 01C pop edi
- .text:00745169 018 pop esi
- .text:0074516A 014 pop ebp
- .text:0074516B 010 pop ebx
- .text:0074516C 00C mov eax, offset gta_user_dir_path
- .text:00745171 00C add esp, 0Ch
- .text:00745174 000 retn
- .text:00745175 ; ---------------------------------------------------------------------------
- .text:00745175
- .text:00745175 loc_745175: ; CODE XREF: _InitUserDirectories+59j
- .text:00745175 00C mov eax, [esp+0Ch+hKey]
- .text:00745179 00C push eax ; hKey
- .text:0074517A 010 call ds:__imp_RegCloseKey
- .text:00745180
- .text:00745180 loc_745180: ; CODE XREF: _InitUserDirectories+29j
- .text:00745180 00C mov ecx, dword ptr ds:aData_1 ; "data"
- .text:00745186 00C mov dl, byte ptr ds:aData_1+4
- .text:0074518C 00C mov dword ptr gta_user_dir_path, ecx
- .text:00745192 00C mov gta_user_dir_path+4, dl
- .text:00745198 00C mov eax, offset gta_user_dir_path
- .text:0074519D 00C add esp, 0Ch
- .text:007451A0 000 retn
- .text:007451A0 _InitUserDirectories endp
Advertisement
Add Comment
Please, Sign In to add comment