Guest User

Untitled

a guest
Oct 9th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .text:00744FB0     _InitUserDirectories proc near          ; CODE XREF: $_chdirUserDirp
  2. .text:00744FB0                                             ; sub_619060+15p
  3. .text:00744FB0                                             ; _psInitialize+50p
  4. .text:00744FB0
  5. .text:00744FB0     hKey            = dword ptr -0Ch
  6. .text:00744FB0     cbData          = dword ptr -8
  7. .text:00744FB0     Type            = dword ptr -4
  8. .text:00744FB0
  9. .text:00744FB0 000                 sub     esp, 0Ch
  10. .text:00744FB3 00C                 lea     eax, [esp+0Ch+hKey]
  11. .text:00744FB7 00C                 push    eax             ; phkResult
  12. .text:00744FB8 010                 push    KEY_READ        ; samDesired
  13. .text:00744FBD 014                 push    0               ; ulOptions
  14. .text:00744FBF 018                 push    offset SubKey   ; "Software\\Microsoft\\Windows\\CurrentVersi"...
  15. .text:00744FC4 01C                 push    HKEY_CURRENT_USER ; hKey
  16. .text:00744FC9 020                 mov     [esp+20h+hKey], 0
  17. .text:00744FD1 020                 call    ds:__imp_RegOpenKeyExA
  18. .text:00744FD7 00C                 test    eax, eax
  19. .text:00744FD9 00C                 jnz     loc_745180
  20. .text:00744FDF 00C                 lea     ecx, [esp+0Ch+cbData]
  21. .text:00744FE3 00C                 push    ecx             ; lpcbData
  22. .text:00744FE4 010                 push    offset gta_user_dir_path ; lpData
  23. .text:00744FE9 014                 lea     edx, [esp+14h+Type]
  24. .text:00744FED 014                 push    edx             ; lpType
  25. .text:00744FEE 018                 push    eax             ; lpReserved
  26. .text:00744FEF 01C                 mov     eax, [esp+1Ch+hKey]
  27. .text:00744FF3 01C                 push    offset ValueName ; "Personal"
  28. .text:00744FF8 020                 push    eax             ; hKey
  29. .text:00744FF9 024                 mov     [esp+24h+cbData], 100h
  30. .text:00745001 024                 call    ds:__imp_RegQueryValueExA
  31. .text:00745007 00C                 test    eax, eax
  32. .text:00745009 00C                 jnz     loc_745175
  33. .text:0074500F 00C                 mov     ecx, [esp+0Ch+hKey]
  34. .text:00745013 00C                 push    ebx
  35. .text:00745014 010                 push    ebp
  36. .text:00745015 014                 push    esi
  37. .text:00745016 018                 push    edi
  38. .text:00745017 01C                 push    ecx             ; hKey
  39. .text:00745018 020                 call    ds:__imp_RegCloseKey
  40. .text:0074501E 01C                 mov     edi, offset gta_user_dir_path
  41. .text:00745023 01C                 dec     edi
  42. .text:00745024
  43. .text:00745024     loc_745024:                             ; CODE XREF: _InitUserDirectories+7Aj
  44. .text:00745024 01C                 mov     al, [edi+1]
  45. .text:00745027 01C                 inc     edi
  46. .text:00745028 01C                 test    al, al
  47. .text:0074502A 01C                 jnz     short loc_745024
  48. .text:0074502C 01C                 push    0               ; hTemplateFile
  49. .text:0074502E 020                 push    2000080h        ; dwFlagsAndAttributes
  50. .text:00745033 024                 push    OPEN_EXISTING   ; dwCreationDisposition
  51. .text:00745035 028                 push    0               ; lpSecurityAttributes
  52. .text:00745037 02C                 push    FILE_SHARE_READ ; dwShareMode
  53. .text:00745039 030                 mov     ecx, 7
  54. .text:0074503E 030                 mov     esi, offset aGtaSanAndreasU ; "\\GTA San Andreas User Files"
  55. .text:00745043 030                 push    GENERIC_READ    ; dwDesiredAccess
  56. .text:00745048 034                 rep movsd
  57. .text:0074504A 034                 mov     esi, ds:__imp_CreateFileA
  58. .text:00745050 034                 push    offset gta_user_dir_path ; lpFileName
  59. .text:00745055 038                 call    esi ; __imp_CreateFileA
  60. .text:00745057 01C                 cmp     eax, 0FFFFFFFFh
  61. .text:0074505A 01C                 mov     ebp, ds:__imp_CloseHandle
  62. .text:00745060 01C                 mov     ebx, ds:__imp_CreateDirectoryA
  63. .text:00745066 01C                 jnz     short loc_745073
  64. .text:00745068 01C                 push    0               ; lpSecurityAttributes
  65. .text:0074506A 020                 push    offset gta_user_dir_path ; lpPathName
  66. .text:0074506F 024                 call    ebx ; __imp_CreateDirectoryA
  67. .text:00745071 01C                 jmp     short loc_745076
  68. .text:00745073     ; ---------------------------------------------------------------------------
  69. .text:00745073
  70. .text:00745073     loc_745073:                             ; CODE XREF: _InitUserDirectories+B6j
  71. .text:00745073 01C                 push    eax             ; hObject
  72. .text:00745074 020                 call    ebp ; __imp_CloseHandle
  73. .text:00745076
  74. .text:00745076     loc_745076:                             ; CODE XREF: _InitUserDirectories+C1j
  75. .text:00745076 01C                 xor     eax, eax
  76. .text:00745078 01C                 jmp     short loc_745080
  77. .text:00745078     ; ---------------------------------------------------------------------------
  78. .text:0074507A 01C                 align 10h
  79. .text:00745080
  80. .text:00745080     loc_745080:                             ; CODE XREF: _InitUserDirectories+C8j
  81. .text:00745080                                             ; _InitUserDirectories+DFj
  82. .text:00745080 01C                 mov     cl, gta_user_dir_path[eax]
  83. .text:00745086 01C                 mov     _tmpUserPath[eax], cl
  84. .text:0074508C 01C                 inc     eax
  85. .text:0074508D 01C                 test    cl, cl
  86. .text:0074508F 01C                 jnz     short loc_745080
  87. .text:00745091 01C                 mov     edi, offset _tmpUserPath
  88. .text:00745096 01C                 dec     edi
  89. .text:00745097
  90. .text:00745097     loc_745097:                             ; CODE XREF: _InitUserDirectories+EDj
  91. .text:00745097 01C                 mov     al, [edi+1]
  92. .text:0074509A 01C                 inc     edi
  93. .text:0074509B 01C                 test    al, al
  94. .text:0074509D 01C                 jnz     short loc_745097
  95. .text:0074509F 01C                 mov     edx, dword ptr ds:aGallery ; "\\Gallery"
  96. .text:007450A5 01C                 mov     eax, dword ptr ds:aGallery+4
  97. .text:007450AA 01C                 mov     cl, byte ptr ds:aGallery+8
  98. .text:007450B0 01C                 push    0               ; hTemplateFile
  99. .text:007450B2 020                 push    2000080h        ; dwFlagsAndAttributes
  100. .text:007450B7 024                 push    3               ; dwCreationDisposition
  101. .text:007450B9 028                 push    0               ; lpSecurityAttributes
  102. .text:007450BB 02C                 push    1               ; dwShareMode
  103. .text:007450BD 030                 mov     [edi], edx
  104. .text:007450BF 030                 push    80000000h       ; dwDesiredAccess
  105. .text:007450C4 034                 mov     [edi+4], eax
  106. .text:007450C7 034                 push    offset _tmpUserPath ; lpFileName
  107. .text:007450CC 038                 mov     [edi+8], cl
  108. .text:007450CF 038                 call    esi ; __imp_CreateFileA
  109. .text:007450D1 01C                 cmp     eax, 0FFFFFFFFh
  110. .text:007450D4 01C                 jnz     short loc_7450E1
  111. .text:007450D6 01C                 push    0               ; lpSecurityAttributes
  112. .text:007450D8 020                 push    offset _tmpUserPath ; lpPathName
  113. .text:007450DD 024                 call    ebx ; __imp_CreateDirectoryA ; CreateDirectory
  114. .text:007450DF 01C                 jmp     short loc_7450E4
  115. .text:007450E1     ; ---------------------------------------------------------------------------
  116. .text:007450E1
  117. .text:007450E1     loc_7450E1:                             ; CODE XREF: _InitUserDirectories+124j
  118. .text:007450E1 01C                 push    eax             ; hObject
  119. .text:007450E2 020                 call    ebp ; __imp_CloseHandle
  120. .text:007450E4
  121. .text:007450E4     loc_7450E4:                             ; CODE XREF: _InitUserDirectories+12Fj
  122. .text:007450E4 01C                 xor     eax, eax
  123. .text:007450E6 01C                 jmp     short loc_7450F0
  124. .text:007450E6     ; ---------------------------------------------------------------------------
  125. .text:007450E8 01C                 align 10h
  126. .text:007450F0
  127. .text:007450F0     loc_7450F0:                             ; CODE XREF: _InitUserDirectories+136j
  128. .text:007450F0                                             ; _InitUserDirectories+14Fj
  129. .text:007450F0 01C                 mov     cl, gta_user_dir_path[eax]
  130. .text:007450F6 01C                 mov     byte_C92168[eax], cl
  131. .text:007450FC 01C                 inc     eax
  132. .text:007450FD 01C                 test    cl, cl
  133. .text:007450FF 01C                 jnz     short loc_7450F0
  134. .text:00745101 01C                 mov     edi, offset byte_C92168
  135. .text:00745106 01C                 dec     edi
  136. .text:00745107
  137. .text:00745107     loc_745107:                             ; CODE XREF: _InitUserDirectories+15Dj
  138. .text:00745107 01C                 mov     al, [edi+1]
  139. .text:0074510A 01C                 inc     edi
  140. .text:0074510B 01C                 test    al, al
  141. .text:0074510D 01C                 jnz     short loc_745107
  142. .text:0074510F 01C                 mov     edx, dword ptr ds:aUserTracks_0 ; "\\User Tracks"
  143. .text:00745115 01C                 mov     eax, dword ptr ds:aUserTracks_0+4
  144. .text:0074511A 01C                 mov     ecx, dword ptr ds:aUserTracks_0+8
  145. .text:00745120 01C                 push    0               ; hTemplateFile
  146. .text:00745122 020                 push    2000080h        ; dwFlagsAndAttributes
  147. .text:00745127 024                 push    3               ; dwCreationDisposition
  148. .text:00745129 028                 mov     [edi], edx
  149. .text:0074512B 028                 mov     dl, byte ptr ds:aUserTracks_0+0Ch
  150. .text:00745131 028                 push    0               ; lpSecurityAttributes
  151. .text:00745133 02C                 push    1               ; dwShareMode
  152. .text:00745135 030                 mov     [edi+4], eax
  153. .text:00745138 030                 push    80000000h       ; dwDesiredAccess
  154. .text:0074513D 034                 mov     [edi+8], ecx
  155. .text:00745140 034                 push    offset byte_C92168 ; lpFileName
  156. .text:00745145 038                 mov     [edi+0Ch], dl
  157. .text:00745148 038                 call    esi ; __imp_CreateFileA
  158. .text:0074514A 01C                 cmp     eax, 0FFFFFFFFh
  159. .text:0074514D 01C                 jnz     short loc_745165
  160. .text:0074514F 01C                 push    0               ; lpSecurityAttributes
  161. .text:00745151 020                 push    offset byte_C92168 ; lpPathName
  162. .text:00745156 024                 call    ebx ; __imp_CreateDirectoryA
  163. .text:00745158 01C                 pop     edi
  164. .text:00745159 018                 pop     esi
  165. .text:0074515A 014                 pop     ebp
  166. .text:0074515B 010                 pop     ebx
  167. .text:0074515C 00C                 mov     eax, offset gta_user_dir_path
  168. .text:00745161 00C                 add     esp, 0Ch
  169. .text:00745164 000                 retn
  170. .text:00745165     ; ---------------------------------------------------------------------------
  171. .text:00745165
  172. .text:00745165     loc_745165:                             ; CODE XREF: _InitUserDirectories+19Dj
  173. .text:00745165 01C                 push    eax             ; hObject
  174. .text:00745166 020                 call    ebp ; __imp_CloseHandle
  175. .text:00745168 01C                 pop     edi
  176. .text:00745169 018                 pop     esi
  177. .text:0074516A 014                 pop     ebp
  178. .text:0074516B 010                 pop     ebx
  179. .text:0074516C 00C                 mov     eax, offset gta_user_dir_path
  180. .text:00745171 00C                 add     esp, 0Ch
  181. .text:00745174 000                 retn
  182. .text:00745175     ; ---------------------------------------------------------------------------
  183. .text:00745175
  184. .text:00745175     loc_745175:                             ; CODE XREF: _InitUserDirectories+59j
  185. .text:00745175 00C                 mov     eax, [esp+0Ch+hKey]
  186. .text:00745179 00C                 push    eax             ; hKey
  187. .text:0074517A 010                 call    ds:__imp_RegCloseKey
  188. .text:00745180
  189. .text:00745180     loc_745180:                             ; CODE XREF: _InitUserDirectories+29j
  190. .text:00745180 00C                 mov     ecx, dword ptr ds:aData_1 ; "data"
  191. .text:00745186 00C                 mov     dl, byte ptr ds:aData_1+4
  192. .text:0074518C 00C                 mov     dword ptr gta_user_dir_path, ecx
  193. .text:00745192 00C                 mov     gta_user_dir_path+4, dl
  194. .text:00745198 00C                 mov     eax, offset gta_user_dir_path
  195. .text:0074519D 00C                 add     esp, 0Ch
  196. .text:007451A0 000                 retn
  197. .text:007451A0     _InitUserDirectories endp
Advertisement
Add Comment
Please, Sign In to add comment