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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x455be0
mov eax, dword fs:[0]
push eax
sub esp, 0xb0
mov eax, dword [0x46f008]
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]
mov byte [ebp - 0xad], 0
mov dword [ebp - 0x44], 0
xor eax, eax
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 7
mov word [ebp - 0x44], ax
mov dword [ebp - 4], 1
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], 7
mov word [ebp - 0x5c], ax
cmp dword [edi + 0x14], 8
mov eax, edi
jb 0x40b705
mov eax, dword [edi]
lea ecx, [edi + 0x10]
mov dword [ecx], 0
mov dword [ebp - 0xb8], ecx
xor ecx, ecx
mov word [eax], cx
mov dword [ebp - 0x2c], ecx
push 0x10
mov dword [ebp - 0x1c], ecx
xor eax, eax
push 0x466318
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x18], 7
mov word [ebp - 0x2c], ax
mov byte [ebp - 4], 3
call fcn.00401680
lea edx, [ebp - 0x5c]
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x2c]
call fcn.0041e9f0
mov byte [ebp - 4], 3
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40b78c
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40b782
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40bb87
push edx
push ecx
call fcn.0041fbbf
add esp, 8
mov esi, dword [0x46fa88]
mov ebx, dword [esi]
test ebx, ebx
je 0x40b9c2
cmp ebx, 0x1fffffc
ja 0x40b9c2
cmp ebx, 2
jb 0x40b7ee
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 0x40b7e8
jmp 0x40b7d0
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 0x40b7d0
mov al, byte [esi + 5]
sub byte [esi + 4], al
lea eax, [ebp - 0x44]
mov dl, 1
push eax
mov ecx, 1
call fcn.0041f580
add esp, 4
test al, al
jne 0x40b868
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x2c]
push str.GetServicePath_failed_with__i.
push eax
call fcn.004123f0
add esp, 0xc
mov ecx, edi
push eax
call fcn.00403700
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40b9d0
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40b859
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40bb8c
push edx
push ecx
call fcn.0041fbbf
add esp, 8
jmp 0x40b9d0
cmp dword [ebp - 0x30], 8
lea eax, [ebp - 0x44]
jb 0x40b874
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 0x40b88c
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 0x40b90f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x2c]
push str.CreateFile_failed_with__i.
push eax
call fcn.004123f0
add esp, 0xc
mov ecx, edi
push eax
call fcn.00403700
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40b9d0
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40b859
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40bb91
jmp 0x40b859
push 0
lea eax, [ebp - 0xbc]
push eax
mov eax, dword [0x46fa88]
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 0x40b996
push ebx
lea eax, [ebp - 0x2c]
push str.WriteFile_failed_with__i.
push eax
call fcn.004123f0
add esp, 0xc
mov ecx, edi
push eax
call fcn.00403700
mov edx, dword [ebp - 0x18]
cmp edx, 8
jb 0x40b9d0
mov ecx, dword [ebp - 0x2c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40b859
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40bb96
jmp 0x40b859
push edi
lea eax, [ebp - 0x44]
push eax
call fcn.0040bbb0
test al, al
je 0x40b9d0
push edi
lea eax, [ebp - 0x44]
push eax
call fcn.0040be40
test eax, eax
mov dword [0x46fa9c], eax
setne bl
test bl, bl
jne 0x40bae5
jmp 0x40b9d6
push 0x14
push str.Invalid_binary_size.
mov ecx, edi
call fcn.00401680
mov bl, byte [ebp - 0xad]
lea ecx, [ebp - 0xac]
call fcn.0040c540
mov ecx, eax
mov byte [ebp - 4], 6
cmp dword [edi + 0x14], 8
jb 0x40b9ef
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.0040c8b0
lea ecx, [ebp - 0xac]
mov byte [ebp - 4], 8
call fcn.0040c480
mov ecx, dword [ebp - 0x1c]
cmp ecx, 0x200
jb 0x40ba8e
cmp ecx, 0x1ff
jb 0x40ba43
cmp dword [ebp - 0x18], 0x10
lea eax, [ebp - 0x2c]
jb 0x40ba33
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], 0x1ff
mov byte [eax + 0x1ff], 0
jmp 0x40ba8e
mov edx, dword [ebp - 0x18]
mov edi, 0x1ff
mov eax, edx
sub edi, ecx
sub eax, ecx
cmp edi, eax
ja 0x40ba7c
mov dword [ebp - 0x1c], 0x1ff
lea eax, [ebp - 0x2c]
cmp edx, 0x10
jb 0x40ba67
mov eax, dword [ebp - 0x2c]
push edi
lea esi, [eax + ecx]
push 0
push esi
call fcn.00437130
add esp, 0xc
mov byte [edi + esi], 0
jmp 0x40ba8e
push 0
push edi
push dword [ebp - 0xbc]
lea ecx, [ebp - 0x2c]
push edi
call fcn.0040ccb0
cmp dword [ebp - 0x18], 0x10
lea eax, [ebp - 0x2c]
jb 0x40ba9a
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [0x46fa88]
add eax, 4
push 0x200
push eax
call fcn.0043c9f1
mov edx, dword [ebp - 0x18]
add esp, 0xc
cmp edx, 0x10
jb 0x40bae5
mov ecx, dword [ebp - 0x2c]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x40badb
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40bb9b
push edx
push ecx
call fcn.0041fbbf
add esp, 8
mov eax, dword [0x46fa88]
movzx ecx, bl
mov dword [eax], ecx
push dword [0x46fa94]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebp - 0x48]
cmp edx, 8
jb 0x40bb31
mov ecx, dword [ebp - 0x5c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bb27
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40bba0
push edx
push ecx
call fcn.0041fbbf
add esp, 8
mov edx, dword [ebp - 0x30]
cmp edx, 8
jb 0x40bb67
mov ecx, dword [ebp - 0x44]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40bb5d
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40bba0
push edx
push ecx
call fcn.0041fbbf
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.0041fb7c
mov esp, ebp
pop ebp
ret 4
call fcn.00439d3f
call fcn.00439d3f
call fcn.00439d3f
call fcn.00439d3f
call fcn.00439d3f
call fcn.00439d3f
int3