Skip to content

Commit bdbb70a

Browse files
Florian Gaultieragix
authored andcommitted
up block_service_stopped.asm
1 parent 94f97ab commit bdbb70a

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
;-----------------------------------------------------------------------------;
2+
; Author: agix (florian.gaultier[at]gmail[dot]com)
3+
; Compatible: Windows 7, 2008, Vista, 2003, XP, 2000, NT4
4+
; Size: 448 bytes
5+
;-----------------------------------------------------------------------------;
6+
7+
[BITS 32]
8+
; Input: EBP must be the address of 'api_call'.
9+
10+
call me2
11+
me2:
12+
pop edi
13+
jmp 0x7
14+
pop eax
15+
pop eax
16+
pop eax
17+
pop eax
18+
xor eax,eax
19+
ret
20+
push 0x00464349
21+
push 0x56524553
22+
mov ecx, esp ;SVCNAME
23+
lea eax, [edi+0x3];SvcCtrlHandler
24+
push 0x00000000
25+
push eax
26+
push ecx
27+
push 0x5244AA0B
28+
call ebp ;RegisterServiceCtrlHandlerExA
29+
push 0x00000000
30+
push 0x00000000
31+
push 0x00000000
32+
push 0x00000000
33+
push 0x00000000
34+
push 0x00000000
35+
push 0x00000001
36+
push 0x00000010
37+
mov ecx, esp
38+
push 0x00000000
39+
push ecx
40+
push eax
41+
push 0x7D3755C6
42+
call ebp ;SetServiceStatus RUNNING
43+
push 0x0
44+
push 0x56a2b5f0
45+
call ebp ;ExitProcess

lib/msf/util/exe.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def self.to_winpe_only(framework, code, opts={}, arch="x86")
346346

347347
if (virtualAddress...virtualAddress+sizeOfRawData).include?(addressOfEntryPoint)
348348
importsTable = pe.hdr.opt.DataDirectory[8..(8+4)].unpack('L')[0]
349-
if (importsTable-addressOfEntryPoint)<code.length
349+
if (importsTable - addressOfEntryPoint) < code.length
350350
#shift original entry point to prevent tables overwritting
351351
addressOfEntryPoint = importsTable - (code.length + 4)
352352

0 commit comments

Comments
 (0)