Function at 0x40d277
Capabilities:
Write file on windows

Disassembly:
mov eax, 0x4654
call fcn.0043d3e0
mov eax, dword [0x49353c]
xor eax, esp
mov dword [esp + 0x464c], eax
push ebx
mov ebx, dword [esp + 0x4660]
push ebp
push esi
push edi
mov edi, ecx
cmp dword [edi + 4], 0xffffffff
je 0x40d2a9
mov ecx, dword [edi]
call fcn.0040cbc8
mov eax, dword [edi]
or dword [edi + 4], 0xffffffff
mov esi, dword [esp + 0x4668]
cmp esi, dword [eax + 4]
jl 0x40d2c5
mov eax, 0x10000
jmp 0x40d500
cmp dword [eax + 0x10], esi
jle 0x40d2df
mov ecx, eax
call fcn.0040c625
jmp 0x40d2da
mov ecx, dword [edi]
call fcn.0040c65c
mov eax, dword [edi]
cmp dword [eax + 0x10], esi
jl 0x40d2d3
lea eax, [esp + 0x18]
mov ecx, edi
push eax
push esi
call fcn.0040cd97
test byte [esp + 0x224], 0x10
jne 0x40d4fe
lea ebp, [edi + 0x240]
mov esi, 0x104
push ebp
lea eax, [esp + 0x24c]
push esi
push eax
call fcn.0044aa48
add esp, 0xc
lea eax, [esp + 0x248]
push ebx
push esi
push eax
call fcn.0044aaac
mov ax, word [esp + 0x254]
lea esi, [esp + 0x254]
add esp, 0xc
xor ebx, ebx
mov ecx, esi
test ax, ax
je 0x40d43e
push 0x2f
pop ebp
push 0x5c
movzx edx, ax
pop ebx
cmp dx, bp
je 0x40d35a
cmp dx, bx
jne 0x40d35d
lea esi, [ecx + 2]
add ecx, 2
movzx eax, word [ecx]
mov edx, eax
test ax, ax
jne 0x40d350
lea eax, [esp + 0x248]
push 0
pop ebx
cmp esi, eax
je 0x40d43e
push eax
lea eax, [esp + 0x454]
push 0x104
push eax
call fcn.0044aa48
lea eax, [esp + 0x254]
add esp, 0xc
sub esi, eax
sar esi, 1
lea esi, [esi*2 - 2]
cmp esi, 0x208
jae 0x40d51b
xor eax, eax
xor ecx, ecx
mov word [esp + esi + 0x450], ax
inc ecx
mov ax, word [esp + 0x450]
test ax, ax
je 0x40d3e9
push 0x2f
pop edx
cmp ax, dx
je 0x40d3e9
push 0x5c
pop edx
cmp ax, dx
je 0x40d3e9
cmp word [esp + 0x452], 0x3a
mov byte [esp + 0x13], bl
jne 0x40d3ed
mov byte [esp + 0x13], cl
lea eax, [esp + 0x450]
push 0x480ea0
push eax
call fcn.00440d57
mov esi, eax
lea eax, [esp + 0x458]
push 0x480ea8
push eax
call fcn.00440d57
movzx ecx, byte [esp + 0x23]
add esp, 0x10
test eax, eax
setne dl
test esi, esi
push 1
pop eax
cmovne ecx, eax
or dl, cl
jne 0x40d43e
lea edx, [esp + 0x450]
lea ecx, [edi + 0x240]
call fcn.0040d1ac
push ebx
push dword [esp + 0x228]
lea eax, [esp + 0x250]
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40d46e
mov eax, 0x200
jmp 0x40d500
mov edx, dword [edi + 0x23c]
mov ecx, dword [edi]
call fcn.0040c851
mov ecx, dword [edi]
lea edx, [esp + 0x658]
push 0x4000
call fcn.0040c9a6
pop ecx
cmp eax, 0xffffff96
je 0x40d4e3
test eax, eax
js 0x40d4dc
je 0x40d4bb
push ebx
lea ecx, [esp + 0x18]
push ecx
push eax
lea eax, [esp + 0x664]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40d47b
mov ebx, 0x400
jmp 0x40d4e8
lea eax, [esp + 0x238]
push eax
lea eax, [esp + 0x22c]
push eax
lea eax, [esp + 0x238]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
jmp 0x40d4e8
mov ebx, 0x5000000
jmp 0x40d4e8
mov ebx, 0x1000
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [edi]
call fcn.0040cbc8
test ebx, ebx
je 0x40d4fe
mov eax, ebx
jmp 0x40d500
xor eax, eax
mov ecx, dword [esp + 0x465c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0043caa2
add esp, 0x4654
ret 0x10
call fcn.0043d039
int3