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

Disassembly:
sub esp, 0x42c
mov eax, dword [0x42a718]
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 0x404bb1
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 0x404b98
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.00412b82
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 0x4051de
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 0x404bf0
push 0x1f4
lea edx, [esp + 0x248]
push 0
push edx
call fcn.00412ba0
mov ebx, dword [esp + 0x28]
mov ecx, dword [esp + 0x450]
lea edx, [ebx + 0x1f4]
add esp, 0xc
cmp edx, ecx
mov eax, 0x1f4
jbe 0x404c25
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.00412360
lea edx, [esp + 0x250]
push str.__this_is_tag__
push edx
call fcn.00411fe0
push 0x104
mov esi, eax
lea eax, [esp + 0x54]
push 0
push eax
mov dword [esp + 0x48], 0
call fcn.00412ba0
push 0x104
lea ecx, [esp + 0x164]
push 0
push ecx
call fcn.00412ba0
add esp, 0x2c
test esi, esi
je 0x404d3e
push str.name:
push esi
call fcn.00411fe0
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 0x404ca0
sub eax, edx
add esi, eax
push str.length:
push esi
call fcn.00411fe0
mov edi, eax
mov edx, edi
sub edx, esi
sub edx, 1
push edx
lea eax, [esp + 0x48]
push esi
push eax
call fcn.00412360
mov eax, str.length:
add esp, 0x14
lea ecx, [eax + 1]
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x404cd8
sub eax, ecx
lea esi, [eax + edi]
push str.___this_is_tag__
push esi
call fcn.00411fe0
mov edi, eax
mov ecx, edi
sub ecx, esi
push ecx
lea edx, [esp + 0x14c]
push esi
push edx
call fcn.00412360
lea eax, [esp + 0x154]
push eax
call fcn.0041340c
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 0x404d22
sub eax, edx
add edi, eax
lea ecx, [esp + 0x244]
sub edi, ecx
add ebx, edi
mov dword [esp + 0x1c], ebx
mov edx, dword [0x42bbe0]
mov eax, dword [edx + 0xc]
mov ecx, 0x42bbe0
call eax
cmp dword [esp + 0x38], 0
lea esi, [eax + 0x10]
mov dword [esp + 0x10], esi
jne 0x404d7f
lea ecx, [esp + 0x3c]
movzx edi, cx
push 0
push edi
call fcn.00401140
add esp, 8
test eax, eax
je 0x404d91
push edi
push eax
lea ecx, [esp + 0x18]
call fcn.004030c0
jmp 0x404d8d
lea edx, [esp + 0x3c]
push edx
lea ecx, [esp + 0x14]
call fcn.00402dd0
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x2c]
mov ecx, dword [eax]
test ecx, ecx
je 0x404da6
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x404db6
mov edx, dword [0x42bbe0]
mov eax, dword [edx + 0x10]
mov ecx, 0x42bbe0
call eax
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
je 0x405229
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.00402d40
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 0x404e0f
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.0041294d
add esp, 8
test eax, eax
je 0x404e2a
sub eax, esi
sar eax, 1
mov edi, eax
jns 0x404e2c
xor edi, edi
cmp edi, dword [esi - 0xc]
lea eax, [esi - 0x10]
mov dword [esp + 0x30], eax
jl 0x404e4c
push eax
call fcn.00401950
mov ebx, eax
add esp, 4
add ebx, 0x10
mov dword [esp + 0x20], ebx
jmp 0x404e7d
mov ecx, dword [eax]
test ecx, ecx
je 0x404e5d
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x404e6d
mov edx, dword [0x42bbe0]
mov eax, dword [edx + 0x10]
mov ecx, 0x42bbe0
call eax
push eax
push edi
push esi
lea ecx, [esp + 0x2c]
call fcn.004018d0
mov ebx, dword [esp + 0x20]
cmp dword [ebx - 0xc], 4
jg 0x404e8c
or ebp, 0xffffffff
mov dword [esp + 0x10], ebp
jmp 0x404eb1
lea ecx, [ebx + 8]
push 0x5c
push ecx
call fcn.0041292b
add esp, 8
test eax, eax
jne 0x404ea7
or ebp, 0xffffffff
mov dword [esp + 0x10], ebp
jmp 0x404eb1
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 0x405136
mov edx, dword [0x42bbe0]
mov eax, dword [edx + 0xc]
mov ecx, 0x42bbe0
call eax
mov edi, eax
add edi, 0x10
cmp ebp, 0xffffffff
mov dword [esp + 0x14], edi
je 0x405090
test ebp, ebp
mov edi, ebp
jge 0x404eeb
xor edi, edi
cmp edi, dword [ebx - 0xc]
jl 0x404f59
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 0x404f1d
cmp eax, dword [esi]
jne 0x404f1d
mov edi, esi
mov edx, 1
lock xadd dword [ecx], edx
lea esi, [edi + 0x10]
jmp 0x404fc2
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 0x405233
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.00412066
add esp, 0x10
lea esi, [edi + 0x10]
jmp 0x404fc2
mov ecx, dword [ebx - 0x10]
test ecx, ecx
je 0x404f6b
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x404f83
mov edx, dword [0x42bbe0]
mov eax, dword [edx + 0x10]
mov ecx, 0x42bbe0
call eax
test eax, eax
je 0x405229
mov edx, dword [eax]
push 2
mov ecx, eax
mov eax, dword [edx]
push edi
call eax
test eax, eax
je 0x405233
test edi, edi
lea esi, [eax + 0x10]
jl 0x405238
cmp edi, dword [esi - 8]
jg 0x405238
lea eax, [edi + edi]
push eax
push ebx
push eax
mov dword [esi - 0xc], edi
push esi
mov word [esi + eax], 0
call fcn.00412066
add esp, 0x10
mov ebp, dword [esp + 0x14]
lea edi, [esi - 0x10]
add ebp, 0xfffffff0
cmp edi, ebp
je 0x40501d
cmp dword [ebp + 0xc], 0
lea ebx, [ebp + 0xc]
jl 0x40500b
mov ecx, dword [edi]
cmp ecx, dword [ebp]
jne 0x40500b
push edi
call fcn.00401950
add esp, 4
mov esi, eax
or edx, 0xffffffff
lock xadd dword [ebx], edx
dec edx
test edx, edx
jg 0x405002
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 0x405019
mov eax, dword [esi - 0xc]
push eax
push esi
lea ecx, [esp + 0x1c]
call fcn.00402e70
mov ebx, dword [esp + 0x20]
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405036
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 0x40505d
push 0
push edi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
je 0x405242
cmp ebp, 0xffffffff
je 0x40511a
lea eax, [ebp + 1]
test eax, eax
jl 0x4050e9
cmp eax, dword [ebx - 0xc]
jge 0x4050e9
lea ecx, [ebx + eax*2]
push 0x5c
push ecx
call fcn.0041292b
add esp, 8
test eax, eax
je 0x4050e9
sub eax, ebx
sar eax, 1
mov ebp, eax
mov dword [esp + 0x10], eax
jmp 0x4050f0
lea eax, [ebx - 0x10]
lea esi, [edi - 0x10]
cmp eax, esi
je 0x40503e
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x4050d6
mov ecx, dword [eax]
cmp ecx, dword [esi]
jne 0x4050d6
push eax
call fcn.00401950
add esp, 4
mov ebp, eax
or edx, 0xffffffff
lock xadd dword [edi], edx
dec edx
test edx, edx
jg 0x4050ca
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 0x405036
mov eax, dword [ebx - 0xc]
push eax
push ebx
lea ecx, [esp + 0x1c]
call fcn.00402e70
jmp 0x40503a
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 0x40510c
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 0x404ec1
jmp 0x405136
lea eax, [edi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405136
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 0x405187
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 0x4051b4
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 0x4051d1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
cmp esi, dword [esp + 0x444]
jb 0x404bf0
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 0x40520c
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.00412b82
add esp, 0x42c
ret 0xc
push 0x80004005
call fcn.00401000
call fcn.004016e0
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 0x40525e
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 0x40527a
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 0x40529a
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 0x4052b7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x40520e