Function at 0x40b960
Capabilities:
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4559cb
mov eax, dword fs:[0]
push eax
sub esp, 0xb0
mov eax, dword [0x46f068]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
xor eax, eax
mov byte [ebp - 0xad], 0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 7
mov word [ebp - 0x44], ax
mov dword [ebp - 4], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], 7
mov word [ebp - 0x5c], ax
mov byte [ebp - 4], 1
mov eax, edi
cmp dword [edi + 0x14], 8
jb 0x40b9cb
mov eax, dword [edi]
lea ecx, [edi + 0x10]
mov dword [ebp - 0x18], 7
mov dword [ecx], 0
mov dword [ebp - 0xb8], ecx
xor ecx, ecx
mov word [eax], cx
xor eax, eax
push 0x10
mov dword [ebp - 0x1c], ecx
lea ecx, [ebp - 0x2c]
push 0x465e7c
mov word [ebp - 0x2c], ax
call fcn.004013d0
lea edx, [ebp - 0x5c]
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x2c]
call fcn.0041e960
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40ba4b
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40ba41
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be0e
push edx
push ecx
call fcn.00434e86
add esp, 8
mov esi, dword [0x46fae8]
mov ebx, dword [esi]
test ebx, ebx
je 0x40bc82
cmp ebx, 0x1fffffc
ja 0x40bc82
cmp ebx, 2
jb 0x40baae
mov al, bl
lea edx, [esi + ebx]
add al, al
mov cl, bl
add cl, al
mov al, 3
sub al, cl
add byte [edx + 3], al
lea edx, [ebx - 2]
test edx, edx
je 0x40baa8
jmp 0x40ba90
movzx eax, dl
lea ecx, [edx + esi]
imul eax, eax, 0xfd
sub al, byte [edx + esi + 5]
add byte [ecx + 4], al
sub edx, 1
jne 0x40ba90
mov al, byte [esi + 5]
sub byte [esi + 4], al
lea eax, [ebp - 0x44]
mov dl, 1
push eax
mov ecx, 1
call fcn.0041f550
add esp, 4
test al, al
jne 0x40bb28
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x2c]
push str.GetServicePath_failed_with__i.
push eax
call fcn.004121b0
add esp, 0xc
mov ecx, edi
push eax
call fcn.00403240
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40bc90
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bb19
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be13
push edx
push ecx
call fcn.00434e86
add esp, 8
jmp 0x40bc90
cmp dword [ebp - 0x30], 8
lea eax, [ebp - 0x44]
jb 0x40bb34
mov eax, dword [ebp - 0x44]
push 0x80
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
cmp dword [ebp - 0x30], 8
lea eax, [ebp - 0x44]
jb 0x40bb4c
mov eax, dword [ebp - 0x44]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, eax
mov dword [ebp - 0xb4], ecx
cmp ecx, 0xffffffff
jne 0x40bbcf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x2c]
push str.CreateFile_failed_with__i.
push eax
call fcn.004121b0
add esp, 0xc
mov ecx, edi
push eax
call fcn.00403240
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40bc90
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bb19
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be18
jmp 0x40bb19
push 0
lea eax, [ebp - 0xbc]
push eax
mov eax, dword [0x46fae8]
push ebx
add eax, 4
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0xb4]
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x40bc56
push ebx
lea eax, [ebp - 0x2c]
push str.WriteFile_failed_with__i.
push eax
call fcn.004121b0
add esp, 0xc
mov ecx, edi
push eax
call fcn.00403240
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40bc90
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bb19
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be1d
jmp 0x40bb19
push edi
lea eax, [ebp - 0x44]
push eax
call fcn.0040be40
test al, al
je 0x40bc90
push edi
lea eax, [ebp - 0x44]
push eax
call fcn.0040c0c0
test eax, eax
mov dword [0x46fafc], eax
setne bl
test eax, eax
jne 0x40bd6c
jmp 0x40bc96
push 0x14
push str.Invalid_binary_size.
mov ecx, edi
call fcn.004013d0
mov bl, byte [ebp - 0xad]
lea ecx, [ebp - 0xac]
call fcn.0040c3d0
mov ecx, eax
mov byte [ebp - 4], 3
cmp dword [edi + 0x14], 8
jb 0x40bcaf
mov edi, dword [edi]
mov eax, dword [ebp - 0xb8]
mov eax, dword [eax]
lea eax, [edi + eax*2]
push eax
push edi
lea eax, [ebp - 0x2c]
push eax
call fcn.0040cb50
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 5
call fcn.0040c2e0
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0x200
jb 0x40bd15
cmp ecx, 0x1ff
jb 0x40bd03
cmp dword [ebp - 0x18], 0x10
lea eax, [ebp - 0x2c]
jb 0x40bcf3
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], 0x1ff
mov byte [eax + 0x1ff], 0
jmp 0x40bd15
mov eax, 0x1ff
sub eax, ecx
lea ecx, [ebp - 0x2c]
push 0
push eax
call fcn.0040ce60
cmp dword [ebp - 0x18], 0x10
lea eax, [ebp - 0x2c]
jb 0x40bd21
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x46fae8]
add eax, 4
push 0x200
push eax
call fcn.0043ca61
mov edx, dword [ebp - 0x18]
add esp, 0xc
cmp edx, 0x10
jb 0x40bd6c
mov ecx, dword [ebp - 0x2c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40bd62
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be22
push edx
push ecx
call fcn.00434e86
add esp, 8
mov eax, dword [0x46fae8]
movzx ecx, bl
mov dword [eax], ecx
push dword [0x46faf4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebp - 0x48]
cmp edx, 8
jb 0x40bdb8
mov ecx, dword [ebp - 0x5c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bdae
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be27
push edx
push ecx
call fcn.00434e86
add esp, 8
mov edx, dword [ebp - 0x30]
cmp edx, 8
jb 0x40bdee
mov ecx, dword [ebp - 0x44]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bde4
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40be2c
push edx
push ecx
call fcn.00434e86
add esp, 8
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00434e45
mov esp, ebp
pop ebp
ret 4
call fcn.00439dba
call fcn.00439dba
call fcn.00439dba
call fcn.00439dba
call fcn.00439dba
call fcn.00439dba
call fcn.00439dba
int3