Function at 0x40d660
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x28
push ebx
mov ebx, dword [esp + 0x30]
mov eax, dword [ebx + 0x194]
push esi
xor esi, esi
cmp eax, esi
mov dword [esp + 8], esi
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], esi
jne 0x40d689
pop esi
xor eax, eax
pop ebx
add esp, 0x28
ret
push esi
push 0x4000000
push 2
push esi
push esi
push 0xc0000000
push str._list_
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x34], eax
jne 0x40d6b6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 8], eax
push ebp
push edi
push 0x200000
call fcn.0042a10c
mov ebp, eax
add esp, 4
cmp ebp, esi
mov dword [esp + 0x2c], ebp
jne 0x40d6d9
mov dword [esp + 0x10], 8
jmp 0x40d6e4
mov ecx, 0x80000
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
push 0x200008
call fcn.0042a10c
mov edx, eax
add esp, 4
cmp edx, esi
mov dword [esp + 0x18], edx
jne 0x40d705
mov dword [esp + 0x10], 8
jmp 0x40d710
mov ecx, 0x80002
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov dword [edx], 0x100008
mov eax, dword [ebx + 0x14c]
mov eax, dword [eax + 0x26]
mov edx, dword [ebx + 0x150]
lea ecx, [eax + eax*2]
lea eax, [edx + ecx*4]
push esi
mov edi, ebp
push ebx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x38], eax
call fcn.0040f170
mov ebp, eax
add esp, 8
test ebp, ebp
mov dword [esp + 0x28], ebp
jne 0x40d753
mov ebp, dword [ebx + 0x150]
mov dword [esp + 0x28], ebp
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40d984
nop
mov ecx, dword [ebp]
cmp ecx, dword [esp + 0x1c]
je 0x40d806
mov eax, dword [ebp + 4]
cmp eax, dword [esp + 0x20]
je 0x40d806
cmp dword [ebp + 8], 0xfffffffe
jae 0x40d806
mov edx, dword [ebx + 0x150]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], eax
mov ecx, ebp
sub ecx, edx
mov eax, 0x2aaaaaab
imul ecx
sar edx, 1
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov edx, dword [ebx + 0x194]
mov eax, dword [edx + ecx*4]
cmp eax, 0xfffffffe
jae 0x40d806
mov ecx, dword [eax + 4]
lea edx, [esi + ecx + 2]
cmp edx, 0x200000
mov dword [esp + 0x24], edx
jbe 0x40d7d1
mov dword [esp + 0x10], 0x7a
jmp 0x40d802
mov edx, ecx
shr ecx, 2
lea esi, [eax + 8]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [eax + 4]
mov ecx, dword [esp + 0x14]
mov byte [ecx + edx], 0xd
mov edx, dword [eax + 4]
mov byte [edx + ecx + 1], 0xa
mov eax, dword [eax + 4]
lea ecx, [ecx + eax + 2]
mov dword [esp + 0x14], ecx
mov edi, ecx
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x30]
add ebp, 0xc
cmp ebp, eax
jb 0x40d817
mov ebp, dword [ebx + 0x150]
cmp ebp, dword [esp + 0x28]
jne 0x40d760
push str._list_
push ebx
call fcn.0040f170
add esp, 8
test eax, eax
jne 0x40d8f4
add esi, 6
cmp esi, 0x200000
jbe 0x40d8d8
mov dword [esp + 0x10], 0x7a
mov esi, dword [esp + 0x18]
mov ebp, dword [esp + 0x3c]
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40d867
push eax
call fcn.0042a11e
add esp, 4
push esi
call fcn.0042a11e
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
jne 0x40d988
mov eax, dword [esp + 0x40]
test eax, eax
je 0x40d964
lea edx, [esp + 0x3c]
push edx
push str._list_
push ebx
call fcn.0040afd0
mov edi, eax
add esp, 0xc
test edi, edi
je 0x40d8ca
mov eax, dword [edi + 0xc]
mov ecx, dword [eax + 0xc]
test ecx, ecx
jbe 0x40d8ca
push 0
push 0
push 0
push SysReAllocString
push str._list_
push edi
push ebp
push ebx
call fcn.0040d020
add esp, 0x20
mov dword [esp + 0x10], eax
push edi
call fcn.0040b330
add esp, 4
jmp 0x40d988
mov eax, dword [str._list_]
mov edx, edi
mov dword [edx], eax
mov cx, word [0x44835c]
mov word [edx + 4], cx
mov byte [edi + 6], 0xd
mov byte [edi + 7], 0xa
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40d84e
mov eax, dword [esp + 0x2c]
push 0
lea edx, [esp + 0x34]
push edx
push esi
mov esi, dword [esp + 0x24]
push eax
lea ecx, [esp + 0x38]
push ecx
lea edx, [esi + 8]
push edx
mov dword [esp + 0x48], 0
call fcn.0040f730
mov eax, dword [esp + 0x40]
mov ebp, dword [esp + 0x54]
add esp, 0x18
push 0
lea ecx, [esp + 0x38]
push ecx
push 0x100008
push esi
push ebp
mov dword [esi + 4], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x34], 0x100008
je 0x40d856
mov dword [esp + 0x10], 0x70
jmp 0x40d856
push 0
push 0
push 0
push SysReAllocString
push str._list_
push ebp
push ebx
call fcn.0040c6c0
add esp, 0x1c
mov dword [esp + 0x10], eax
jmp 0x40d988
mov ebp, dword [esp + 0x3c]
cmp ebp, 0xffffffff
je 0x40d994
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
pop edi
pop ebp
pop esi
pop ebx
add esp, 0x28
ret