Function at 0x10040430
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x694
mov eax, dword [0x10269114]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x648], ecx
cmp dword [ebp + 0x14], 3
je 0x10040465
cmp dword [ebp + 0x14], 2
je 0x10040465
cmp dword [ebp + 0x14], 1
je 0x10040465
mov eax, 0x10000
jmp 0x10040b95
cmp dword [ebp + 0x14], 3
jne 0x100405c2
mov eax, dword [ebp - 0x648]
mov ecx, dword [ebp + 8]
cmp ecx, dword [eax + 4]
je 0x10040533
mov edx, dword [ebp - 0x648]
cmp dword [edx + 4], 0xffffffff
je 0x1004049e
mov eax, dword [ebp - 0x648]
mov ecx, dword [eax]
push ecx
call fcn.10045e30
add esp, 4
mov edx, dword [ebp - 0x648]
mov dword [edx + 4], 0xffffffff
mov eax, dword [ebp - 0x648]
mov ecx, dword [eax]
mov edx, dword [ebp + 8]
cmp edx, dword [ecx + 4]
jl 0x100404c5
mov eax, 0x10000
jmp 0x10040b95
mov eax, dword [ebp - 0x648]
mov ecx, dword [eax]
mov edx, dword [ebp + 8]
cmp edx, dword [ecx + 0x10]
jge 0x100404e6
mov eax, dword [ebp - 0x648]
mov ecx, dword [eax]
push ecx
call fcn.10045f30
add esp, 4
mov edx, dword [ebp - 0x648]
mov eax, dword [edx]
mov ecx, dword [eax + 0x10]
cmp ecx, dword [ebp + 8]
jge 0x10040509
mov edx, dword [ebp - 0x648]
mov eax, dword [edx]
push eax
call fcn.10045fb0
add esp, 4
jmp 0x100404e6
mov ecx, dword [ebp - 0x648]
mov edx, dword [ecx + 0x23c]
push edx
mov eax, dword [ebp - 0x648]
mov ecx, dword [eax]
push ecx
call fcn.100461e0
add esp, 8
mov edx, dword [ebp - 0x648]
mov eax, dword [ebp + 8]
mov dword [edx + 4], eax
lea ecx, [ebp - 0x64d]
push ecx
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp - 0x648]
mov edx, dword [ecx]
push edx
call fcn.100467f0
add esp, 0x10
mov dword [ebp - 0x670], eax
cmp dword [ebp - 0x670], 0
jg 0x10040580
mov eax, dword [ebp - 0x648]
mov ecx, dword [eax]
push ecx
call fcn.10045e30
add esp, 4
mov edx, dword [ebp - 0x648]
mov dword [edx + 4], 0xffffffff
movzx eax, byte [ebp - 0x64d]
test eax, eax
je 0x10040592
xor eax, eax
jmp 0x10040b95
cmp dword [ebp - 0x670], 0
jle 0x100405a5
mov eax, 0x600
jmp 0x10040b95
cmp dword [ebp - 0x670], 0xffffff96
jne 0x100405b8
mov eax, 0x1000
jmp 0x10040b95
mov eax, 0x5000000
jmp 0x10040b95
mov ecx, dword [ebp - 0x648]
cmp dword [ecx + 4], 0xffffffff
je 0x100405df
mov edx, dword [ebp - 0x648]
mov eax, dword [edx]
push eax
call fcn.10045e30
add esp, 4
mov ecx, dword [ebp - 0x648]
mov dword [ecx + 4], 0xffffffff
mov edx, dword [ebp - 0x648]
mov eax, dword [edx]
mov ecx, dword [ebp + 8]
cmp ecx, dword [eax + 4]
jl 0x10040606
mov eax, 0x10000
jmp 0x10040b95
mov edx, dword [ebp - 0x648]
mov eax, dword [edx]
mov ecx, dword [ebp + 8]
cmp ecx, dword [eax + 0x10]
jge 0x10040627
mov edx, dword [ebp - 0x648]
mov eax, dword [edx]
push eax
call fcn.10045f30
add esp, 4
mov ecx, dword [ebp - 0x648]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
cmp eax, dword [ebp + 8]
jge 0x1004064a
mov ecx, dword [ebp - 0x648]
mov edx, dword [ecx]
push edx
call fcn.10045fb0
add esp, 4
jmp 0x10040627
lea eax, [ebp - 0x644]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov ecx, dword [ebp - 0x648]
call fcn.1003f470
mov edx, dword [ebp - 0x438]
and edx, 0x10
je 0x10040677
mov dword [ebp - 0x674], 1
jmp 0x10040681
mov dword [ebp - 0x674], 0
mov al, byte [ebp - 0x674]
mov byte [ebp - 0x64e], al
movzx ecx, byte [ebp - 0x64e]
test ecx, ecx
je 0x10040770
cmp dword [ebp + 0x14], 1
jne 0x100406a9
xor eax, eax
jmp 0x10040b95
mov edx, dword [ebp + 0xc]
mov dword [ebp - 0x658], edx
mov eax, 2
imul ecx, eax, 0
mov edx, dword [ebp - 0x658]
movzx eax, word [edx + ecx]
cmp eax, 0x2f
je 0x10040719
mov ecx, 2
imul edx, ecx, 0
mov eax, dword [ebp - 0x658]
movzx ecx, word [eax + edx]
cmp ecx, 0x5c
je 0x10040719
mov edx, 2
imul eax, edx, 0
mov ecx, dword [ebp - 0x658]
movzx edx, word [ecx + eax]
test edx, edx
je 0x1004070d
mov eax, 2
shl eax, 0
mov ecx, dword [ebp - 0x658]
movzx edx, word [ecx + eax]
cmp edx, 0x3a
je 0x10040719
mov dword [ebp - 0x678], 0
jmp 0x10040723
mov dword [ebp - 0x678], 1
mov al, byte [ebp - 0x678]
mov byte [ebp - 0x64f], al
movzx ecx, byte [ebp - 0x64f]
test ecx, ecx
je 0x1004074d
mov edx, dword [ebp - 0x658]
push edx
push 0
call fcn.1003eef0
add esp, 8
jmp 0x10040769
mov eax, dword [ebp - 0x658]
push eax
mov ecx, dword [ebp - 0x648]
add ecx, 0x244
push ecx
call fcn.1003eef0
add esp, 8
xor eax, eax
jmp 0x10040b95
mov edx, 2
imul eax, edx, 0
mov dword [ebp - 0x67c], eax
cmp dword [ebp - 0x67c], 0x208
jae 0x1004078c
jmp 0x10040791
call fcn.1004a493
xor ecx, ecx
mov edx, dword [ebp - 0x67c]
mov word [ebp + edx - 0x414], cx
cmp dword [ebp + 0x14], 1
jne 0x100407b5
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x668], eax
jmp 0x100409e5
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x66c], ecx
mov edx, dword [ebp - 0x66c]
mov dword [ebp - 0x660], edx
mov eax, dword [ebp - 0x660]
mov dword [ebp - 0x65c], eax
mov ecx, dword [ebp - 0x65c]
movzx edx, word [ecx]
test edx, edx
je 0x1004081f
mov eax, dword [ebp - 0x65c]
movzx ecx, word [eax]
cmp ecx, 0x2f
je 0x100407ff
mov edx, dword [ebp - 0x65c]
movzx eax, word [edx]
cmp eax, 0x5c
jne 0x1004080e
mov ecx, dword [ebp - 0x65c]
add ecx, 2
mov dword [ebp - 0x660], ecx
mov edx, dword [ebp - 0x65c]
add edx, 2
mov dword [ebp - 0x65c], edx
jmp 0x100407d6
push 0x104
mov eax, dword [ebp - 0x66c]
push eax
lea ecx, [ebp - 0x20c]
push ecx
call fcn.10050780
add esp, 0xc
mov edx, dword [ebp - 0x660]
cmp edx, dword [ebp - 0x66c]
jne 0x1004087b
mov eax, 2
imul ecx, eax, 0
mov dword [ebp - 0x680], ecx
cmp dword [ebp - 0x680], 0x208
jae 0x10040864
jmp 0x10040869
call fcn.1004a493
xor edx, edx
mov eax, dword [ebp - 0x680]
mov word [ebp + eax - 0x20c], dx
jmp 0x100408b4
mov ecx, dword [ebp - 0x660]
sub ecx, dword [ebp - 0x66c]
sar ecx, 1
shl ecx, 1
mov dword [ebp - 0x684], ecx
cmp dword [ebp - 0x684], 0x208
jae 0x1004089f
jmp 0x100408a4
call fcn.1004a493
xor edx, edx
mov eax, dword [ebp - 0x684]
mov word [ebp + eax - 0x20c], dx
mov ecx, 2
imul edx, ecx, 0
movzx eax, word [ebp + edx - 0x20c]
cmp eax, 0x2f
je 0x10040913
mov ecx, 2
imul edx, ecx, 0
movzx eax, word [ebp + edx - 0x20c]
cmp eax, 0x5c
je 0x10040913
mov ecx, 2
imul edx, ecx, 0
movzx eax, word [ebp + edx - 0x20c]
test eax, eax
je 0x10040907
mov ecx, 2
shl ecx, 0
movzx edx, word [ebp + ecx - 0x20c]
cmp edx, 0x3a
je 0x10040913
mov dword [ebp - 0x688], 0
jmp 0x1004091d
mov dword [ebp - 0x688], 1
mov al, byte [ebp - 0x688]
mov byte [ebp - 0x650], al
movzx ecx, byte [ebp - 0x650]
test ecx, ecx
je 0x1004096e
mov edx, dword [ebp - 0x660]
push edx
lea eax, [ebp - 0x20c]
push eax
push 0x101df46c
push 0x104
lea ecx, [ebp - 0x414]
push ecx
call fcn.100477b0
add esp, 0x14
lea edx, [ebp - 0x20c]
push edx
push 0
call fcn.1003eef0
add esp, 8
jmp 0x100409be
mov eax, dword [ebp - 0x660]
push eax
lea ecx, [ebp - 0x20c]
push ecx
mov edx, dword [ebp - 0x648]
add edx, 0x244
push edx
push 0x101df478
push 0x104
lea eax, [ebp - 0x414]
push eax
call fcn.100477b0
add esp, 0x18
lea ecx, [ebp - 0x20c]
push ecx
mov edx, dword [ebp - 0x648]
add edx, 0x244
push edx
call fcn.1003eef0
add esp, 8
push 0
mov eax, dword [ebp - 0x438]
push eax
push 2
push 0
push 0
push 0x40000000
lea ecx, [ebp - 0x414]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x668], eax
cmp dword [ebp - 0x668], 0xffffffff
jne 0x100409f8
mov eax, 0x200
jmp 0x10040b95
mov edx, dword [ebp - 0x648]
mov eax, dword [edx + 0x23c]
push eax
mov ecx, dword [ebp - 0x648]
mov edx, dword [ecx]
push edx
call fcn.100461e0
add esp, 8
mov eax, dword [ebp - 0x648]
cmp dword [eax + 0x240], 0
jne 0x10040a4a
push 0x4000
call fcn.10049474
add esp, 4
mov dword [ebp - 0x68c], eax
mov ecx, dword [ebp - 0x648]
mov edx, dword [ebp - 0x68c]
mov dword [ecx + 0x240], edx
mov dword [ebp - 0x64c], 0
cmp dword [ebp - 0x64c], 0
jne 0x10040b33
lea eax, [ebp - 0x651]
push eax
push 0x4000
mov ecx, dword [ebp - 0x648]
mov edx, dword [ecx + 0x240]
push edx
mov eax, dword [ebp - 0x648]
mov ecx, dword [eax]
push ecx
call fcn.100467f0
add esp, 0x10
mov dword [ebp - 0x664], eax
cmp dword [ebp - 0x664], 0xffffff96
jne 0x10040aa9
mov dword [ebp - 0x64c], 0x1000
jmp 0x10040b33
cmp dword [ebp - 0x664], 0
jge 0x10040abe
mov dword [ebp - 0x64c], 0x5000000
jmp 0x10040b33
cmp dword [ebp - 0x664], 0
jle 0x10040b0c
push 0
lea edx, [ebp - 0x694]
push edx
mov eax, dword [ebp - 0x664]
push eax
mov ecx, dword [ebp - 0x648]
mov edx, dword [ecx + 0x240]
push edx
mov eax, dword [ebp - 0x668]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x690], eax
cmp dword [ebp - 0x690], 0
jne 0x10040b0c
mov dword [ebp - 0x64c], 0x400
jmp 0x10040b33
movzx ecx, byte [ebp - 0x651]
test ecx, ecx
je 0x10040b19
jmp 0x10040b33
cmp dword [ebp - 0x664], 0
jne 0x10040b2e
mov dword [ebp - 0x64c], 0x5000000
jmp 0x10040b33
jmp 0x10040a54
mov edx, dword [ebp - 0x648]
mov eax, dword [edx]
push eax
call fcn.10045e30
add esp, 4
cmp dword [ebp - 0x64c], 0
jne 0x10040b6f
lea ecx, [ebp - 0x424]
push ecx
lea edx, [ebp - 0x434]
push edx
lea eax, [ebp - 0x42c]
push eax
mov ecx, dword [ebp - 0x668]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp dword [ebp + 0x14], 1
je 0x10040b82
mov edx, dword [ebp - 0x668]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x64c], 0
je 0x10040b93
mov eax, dword [ebp - 0x64c]
jmp 0x10040b95
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100499a5
mov esp, ebp
pop ebp
ret 0x10