Function at 0x403c10
Capabilities:
Check if file exists
Create directory
Get file attributes
Write file on windows

Disassembly:
sub esp, 0x42c
mov eax, dword [0x422588]
xor eax, esp
mov dword [esp + 0x428], eax
mov eax, dword [esp + 0x430]
xor ecx, ecx
cmp eax, ecx
mov dword [esp + 0x24], eax
jne 0x403c71
mov eax, dword [esp + 0x438]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x403c58
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [esp + 0x428]
xor ecx, esp
call fcn.0040d432
add esp, 0x42c
ret 0xc
cmp dword [esp + 0x434], ecx
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x24], ecx
jbe 0x40429e
mov ecx, dword [esp + 0x448]
lea eax, [esp + 0x3c]
shr eax, 0x10
add ecx, 0xfffffff0
mov dword [esp + 0x38], eax
mov dword [esp + 0x2c], ecx
jmp 0x403cb0
push 0x1f4
lea edx, [esp + 0x248]
push 0
push edx
call fcn.0040d450
mov ebx, dword [esp + 0x28]
mov ecx, dword [esp + 0x450]
lea edx, [ebx + 0x1f4]
add esp, 0xc
cmp edx, ecx
mov eax, 0x1f4
jbe 0x403ce5
mov eax, ecx
sub eax, ebx
push eax
mov eax, dword [esp + 0x38]
add eax, ebx
push eax
lea ecx, [esp + 0x24c]
push ecx
call fcn.0040cc10
lea edx, [esp + 0x250]
push str.__this_is_tag__
push edx
call fcn.0040c890
push 0x104
mov esi, eax
lea eax, [esp + 0x54]
push 0
push eax
mov dword [esp + 0x48], 0
call fcn.0040d450
push 0x104
lea ecx, [esp + 0x164]
push 0
push ecx
call fcn.0040d450
add esp, 0x2c
test esi, esi
je 0x403dfe
push str.name:
push esi
call fcn.0040c890
mov esi, eax
mov eax, str.name:
add esp, 8
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x403d60
sub eax, edx
add esi, eax
push str.length:
push esi
call fcn.0040c890
mov edi, eax
mov edx, edi
sub edx, esi
sub edx, 1
push edx
lea eax, [esp + 0x48]
push esi
push eax
call fcn.0040cc10
mov eax, str.length:
add esp, 0x14
lea ecx, [eax + 1]
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x403d98
sub eax, ecx
lea esi, [eax + edi]
push str.___this_is_tag__
push esi
call fcn.0040c890
mov edi, eax
mov ecx, edi
sub ecx, esi
push ecx
lea edx, [esp + 0x14c]
push esi
push edx
call fcn.0040cc10
lea eax, [esp + 0x154]
push eax
call fcn.0040db82
mov dword [esp + 0x40], eax
mov eax, str.___this_is_tag__
add esp, 0x18
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x403de2
sub eax, edx
add edi, eax
lea ecx, [esp + 0x244]
sub edi, ecx
add ebx, edi
mov dword [esp + 0x1c], ebx
mov edx, dword [0x423928]
mov eax, dword [edx + 0xc]
mov ecx, 0x423928
call eax
cmp dword [esp + 0x38], 0
lea esi, [eax + 0x10]
mov dword [esp + 0x10], esi
jne 0x403e3f
lea ecx, [esp + 0x3c]
movzx edi, cx
push 0
push edi
call fcn.00401140
add esp, 8
test eax, eax
je 0x403e51
push edi
push eax
lea ecx, [esp + 0x18]
call fcn.00402bb0
jmp 0x403e4d
lea edx, [esp + 0x3c]
push edx
lea ecx, [esp + 0x14]
call fcn.004029e0
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x2c]
mov ecx, dword [eax]
test ecx, ecx
je 0x403e66
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x403e76
mov edx, dword [0x423928]
mov eax, dword [edx + 0x10]
mov ecx, 0x423928
call eax
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
je 0x4042e9
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
mov edx, dword [esp + 0x448]
mov ecx, dword [edx - 0xc]
add eax, 0x10
mov dword [esp + 0x18], eax
mov eax, dword [esi - 0xc]
push eax
push esi
push ecx
push edx
lea ecx, [esp + 0x28]
push ecx
call fcn.00402950
lea eax, [esi - 0x10]
add esp, 0x14
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x403ecf
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [esp + 0x18]
push 0x5c
push esi
call fcn.0040d1fd
add esp, 8
test eax, eax
je 0x403eea
sub eax, esi
sar eax, 1
mov edi, eax
jns 0x403eec
xor edi, edi
cmp edi, dword [esi - 0xc]
lea eax, [esi - 0x10]
mov dword [esp + 0x30], eax
jl 0x403f0c
push eax
call fcn.004018b0
mov ebx, eax
add esp, 4
add ebx, 0x10
mov dword [esp + 0x20], ebx
jmp 0x403f3d
mov ecx, dword [eax]
test ecx, ecx
je 0x403f1d
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x403f2d
mov edx, dword [0x423928]
mov eax, dword [edx + 0x10]
mov ecx, 0x423928
call eax
push eax
push edi
push esi
lea ecx, [esp + 0x2c]
call fcn.00401830
mov ebx, dword [esp + 0x20]
cmp dword [ebx - 0xc], 4
jg 0x403f4c
or ebp, 0xffffffff
mov dword [esp + 0x10], ebp
jmp 0x403f71
lea ecx, [ebx + 8]
push 0x5c
push ecx
call fcn.0040d1db
add esp, 8
test eax, eax
jne 0x403f67
or ebp, 0xffffffff
mov dword [esp + 0x10], ebp
jmp 0x403f71
sub eax, ebx
sar eax, 1
mov ebp, eax
mov dword [esp + 0x10], eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4041f6
mov edx, dword [0x423928]
mov eax, dword [edx + 0xc]
mov ecx, 0x423928
call eax
mov edi, eax
add edi, 0x10
cmp ebp, 0xffffffff
mov dword [esp + 0x14], edi
je 0x404150
test ebp, ebp
mov edi, ebp
jge 0x403fab
xor edi, edi
cmp edi, dword [ebx - 0xc]
jl 0x404019
mov ecx, dword [ebx - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
lea esi, [ebx - 0x10]
call eax
cmp dword [esi + 0xc], 0
lea ecx, [esi + 0xc]
jl 0x403fdd
cmp eax, dword [esi]
jne 0x403fdd
mov edi, esi
mov edx, 1
lock xadd dword [ecx], edx
lea esi, [edi + 0x10]
jmp 0x404082
mov ecx, dword [esi + 4]
mov edx, dword [eax]
mov edx, dword [edx]
push 2
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
je 0x4042f3
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
mov eax, dword [esi + 4]
lea eax, [eax + eax + 2]
push eax
add esi, 0x10
push esi
push eax
lea ecx, [edi + 0x10]
push ecx
call fcn.0040c916
add esp, 0x10
lea esi, [edi + 0x10]
jmp 0x404082
mov ecx, dword [ebx - 0x10]
test ecx, ecx
je 0x40402b
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x404043
mov edx, dword [0x423928]
mov eax, dword [edx + 0x10]
mov ecx, 0x423928
call eax
test eax, eax
je 0x4042e9
mov edx, dword [eax]
push 2
mov ecx, eax
mov eax, dword [edx]
push edi
call eax
test eax, eax
je 0x4042f3
test edi, edi
lea esi, [eax + 0x10]
jl 0x4042f8
cmp edi, dword [esi - 8]
jg 0x4042f8
lea eax, [edi + edi]
push eax
push ebx
push eax
mov dword [esi - 0xc], edi
push esi
mov word [esi + eax], 0
call fcn.0040c916
add esp, 0x10
mov ebp, dword [esp + 0x14]
lea edi, [esi - 0x10]
add ebp, 0xfffffff0
cmp edi, ebp
je 0x4040dd
cmp dword [ebp + 0xc], 0
lea ebx, [ebp + 0xc]
jl 0x4040cb
mov ecx, dword [edi]
cmp ecx, dword [ebp]
jne 0x4040cb
push edi
call fcn.004018b0
add esp, 4
mov esi, eax
or edx, 0xffffffff
lock xadd dword [ebx], edx
dec edx
test edx, edx
jg 0x4040c2
mov ecx, dword [ebp]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebp
call edx
add esi, 0x10
mov dword [esp + 0x14], esi
jmp 0x4040d9
mov eax, dword [esi - 0xc]
push eax
push esi
lea ecx, [esp + 0x1c]
call fcn.00402a80
mov ebx, dword [esp + 0x20]
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4040f6
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push edi
call esi
cmp eax, 0xffffffff
jne 0x40411d
push 0
push edi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x404302
cmp ebp, 0xffffffff
je 0x4041da
lea eax, [ebp + 1]
test eax, eax
jl 0x4041a9
cmp eax, dword [ebx - 0xc]
jge 0x4041a9
lea ecx, [ebx + eax*2]
push 0x5c
push ecx
call fcn.0040d1db
add esp, 8
test eax, eax
je 0x4041a9
sub eax, ebx
sar eax, 1
mov ebp, eax
mov dword [esp + 0x10], eax
jmp 0x4041b0
lea eax, [ebx - 0x10]
lea esi, [edi - 0x10]
cmp eax, esi
je 0x4040fe
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x404196
mov ecx, dword [eax]
cmp ecx, dword [esi]
jne 0x404196
push eax
call fcn.004018b0
add esp, 4
mov ebp, eax
or edx, 0xffffffff
lock xadd dword [edi], edx
dec edx
test edx, edx
jg 0x40418a
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
add ebp, 0x10
mov dword [esp + 0x14], ebp
jmp 0x4040f6
mov eax, dword [ebx - 0xc]
push eax
push ebx
lea ecx, [esp + 0x1c]
call fcn.00402a80
jmp 0x4040fa
or ebp, 0xffffffff
mov dword [esp + 0x10], ebp
lea eax, [edi - 0x10]
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4041cc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push ebx
call esi
cmp eax, 0xffffffff
je 0x403f81
jmp 0x4041f6
lea eax, [edi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4041f6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x18]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x404247
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x34]
push 0
lea edx, [esp + 0x1c]
push edx
mov edx, dword [esp + 0x24]
push eax
add ecx, edx
push ecx
push esi
mov dword [esp + 0x2c], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x1c]
add esi, dword [esp + 0x28]
add dword [esp + 0x24], 1
lea eax, [ebx - 0x10]
mov dword [esp + 0x1c], esi
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x404274
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x30]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x404291
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp esi, dword [esp + 0x444]
jb 0x403cb0
mov eax, dword [esp + 0x448]
xor ecx, ecx
cmp dword [esp + 0x24], ecx
setg cl
add eax, 0xfffffff0
lea edx, [eax + 0xc]
mov esi, ecx
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4042cc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x438]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040d432
add esp, 0x42c
ret 0xc
push 0x80004005
call fcn.00401000
call fcn.004015e0
push 0x80070057
call fcn.00401000
add edi, 0xfffffff0
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40431e
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
add ebx, 0xfffffff0
lea eax, [ebx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40433a
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40435a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x2c]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x404377
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x4042ce