Function at 0x401503
Capabilities:
Set file attributes
Write file on windows

Disassembly:
sub esp, 0x174
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x16c], eax
mov eax, dword [0x432644]
push ebx
push ebp
push esi
mov ebx, ecx
mov dword [esp + 0x24], eax
mov ecx, dword [fcn.00401ca2]
xor ebp, ebp
and dword [esp + 0x44], ebp
push edi
mov dword [esp + 0x24], ecx
mov dword [esp + 0x5c], ecx
push ecx
lea ecx, [esp + 0x80]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x64], eax
call fcn.00401f03
pop ecx
test eax, eax
je 0x401568
mov edx, eax
mov ecx, str.cannot_open_input_file
call fcn.00401405
xor eax, eax
inc eax
jmp 0x401b7c
and dword [esp + 0x80], ebp
lea eax, [esp + 0x24]
mov esi, 0x40000
mov dword [esp + 0x74], 0x401ff4
push esi
push eax
mov dword [esp + 0x80], 0x402016
mov dword [esp + 0x8c], 0x40538f
mov dword [esp + 0x90], 0x4053e1
mov dword [esp + 0x94], 0x4053ef
mov dword [esp + 0x98], 0x40543a
call dword [esp + 0x2c]
mov edi, eax
mov dword [esp + 0xa8], edi
pop ecx
pop ecx
test edi, edi
je 0x4015ec
and dword [esp + 0x9c], ebp
lea eax, [esp + 0x74]
and dword [esp + 0x98], ebp
mov dword [esp + 0xa4], esi
mov dword [esp + 0x94], eax
call fcn.00401d19
lea ecx, [esp + 0xa8]
call fcn.00402d0c
xor eax, eax
test edi, edi
push 2
pop esi
cmovne esi, eax
je 0x401637
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x28]
push eax
lea edx, [esp + 0x8c]
call fcn.00404dfb
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x40163f
lea edx, [esp + 0x24]
lea ecx, [esp + 0xa8]
call fcn.00402d4a
test esi, esi
jne 0x401b48
and dword [esp + 0x30], ebp
xor edi, edi
and dword [esp + 0x34], ebp
push str.ltex
push ebx
mov dword [esp + 0x24], edi
call fcn.00414c40
pop ecx
pop ecx
test eax, eax
jne 0x40171f
mov dword [esp + 0x30], 1
or dword [esp + 0x58], 0xffffffff
xor ebx, ebx
and dword [esp + 0x44], ebp
and dword [esp + 0x54], ebp
mov dword [esp + 0x4c], ebx
cmp dword [esp + 0xf0], ebx
jbe 0x401b39
mov eax, dword [esp + 0xf8]
mov ecx, ebx
and dword [esp + 0x20], 0
and ecx, 7
and dword [esp + 0x38], 0
mov edx, 0x80
sar edx, cl
mov ecx, ebx
shr ecx, 3
push 0
mov dword [esp + 0x1c], edx
mov dword [esp + 0x30], ecx
movzx ebp, byte [ecx + eax]
and ebp, edx
pop eax
setne al
mov dword [esp + 0x50], ebp
cmp dword [esp + 0x30], 0
mov dword [esp + 0x14], eax
jne 0x4016db
test ebp, ebp
je 0x4016db
test edi, edi
je 0x401b04
mov eax, dword [esp + 0x124]
mov esi, dword [eax + ebx*4 + 4]
sub esi, dword [eax + ebx*4]
cmp esi, dword [esp + 0x48]
jbe 0x401781
push dword [esp + 0x10]
call fcn.00414fa6
pop ecx
lea eax, [esi + esi]
mov dword [esp + 0x48], esi
push eax
push 0
call fcn.00401ca2
mov edi, eax
mov dword [esp + 0x18], edi
pop ecx
pop ecx
test edi, edi
jne 0x401785
push 2
jmp 0x401b34
push 0x432434
push ebx
call fcn.00414c40
pop ecx
pop ecx
test eax, eax
jne 0x40173d
mov dword [esp + 0x34], 1
jmp 0x40166a
push 0x432438
push ebx
call fcn.00414c40
pop ecx
pop ecx
test eax, eax
je 0x40166a
push 0x43243c
push ebx
call fcn.00414c40
pop ecx
pop ecx
test eax, eax
jne 0x40176f
xor edi, edi
inc edi
mov dword [esp + 0x1c], edi
jmp 0x40166a
mov ecx, 0x432440
call fcn.004013e6
push 0xb
pop esi
jmp 0x401b48
mov edi, dword [esp + 0x10]
push edi
mov edx, ebx
lea ecx, [esp + 0xac]
call fcn.004052f9
cmp dword [esp + 0x34], 0
pop ecx
je 0x4018b5
mov eax, dword [esp + 0x104]
mov esi, dword [esp + 0x2c]
test eax, eax
je 0x4017c4
mov ecx, dword [esp + 0x18]
test byte [esi + eax], cl
je 0x4017c4
mov eax, dword [esp + 0x108]
mov ecx, dword [eax + ebx*4]
jmp 0x4017c6
xor ecx, ecx
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x134]
push eax
call fcn.004014aa
pop ecx
mov ecx, dword [esp + 0xf4]
mov edx, dword [ecx + ebx*8 + 8]
sub edx, dword [ecx + ebx*8]
mov eax, dword [ecx + ebx*8 + 0xc]
sbb eax, dword [ecx + ebx*8 + 4]
lea ecx, [esp + 0x15c]
push eax
push edx
push 0xa
pop edx
call fcn.004010f9
mov eax, dword [esp + 0x114]
pop ecx
pop ecx
test eax, eax
je 0x40182d
mov ecx, dword [esp + 0x18]
test byte [esi + eax], cl
je 0x40182d
mov eax, dword [esp + 0x110]
lea edx, [esp + 0x13c]
lea ecx, [eax + ebx*8]
call fcn.004011cb
jmp 0x40184c
mov eax, 0x20202020
lea edi, [esp + 0x13c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [esp + 0x10]
mov byte [esp + 0x14f], 0
lea ecx, [esp + 0x13c]
call fcn.00401000
mov esi, 0x432454
mov ecx, esi
call fcn.00401000
lea ecx, [esp + 0x134]
call fcn.00401000
mov ecx, esi
call fcn.00401000
lea ecx, [esp + 0x15c]
call fcn.00401000
mov ecx, 0x432458
call fcn.00401000
mov ecx, edi
call fcn.004010c2
mov esi, eax
test esi, esi
jne 0x401b35
test ebp, ebp
je 0x401af6
mov ecx, 0x43245c
call fcn.00401000
jmp 0x401af6
cmp dword [esp + 0x34], 0
mov eax, 0x432464
mov ecx, 0x432460
cmove ecx, eax
call fcn.00401000
mov ecx, edi
call fcn.004010c2
mov esi, eax
mov dword [esp + 0x14], esi
test esi, esi
jne 0x401b35
test ebp, ebp
je 0x4018f1
mov ecx, 0x43245c
call fcn.00401000
jmp 0x401939
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x40]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x64]
push eax
lea eax, [esp + 0x58]
push eax
lea eax, [esp + 0x70]
push eax
push ebx
lea edx, [esp + 0xa4]
lea ecx, [esp + 0xc8]
call fcn.00405172
mov esi, eax
mov dword [esp + 0x34], eax
add esp, 0x20
test esi, esi
jne 0x401b35
cmp dword [esp + 0x34], 0
jne 0x401af6
movzx eax, word [edi]
mov edx, edi
xor ebp, ebp
mov dword [esp + 0x40], edx
mov ecx, eax
test ax, ax
je 0x40199d
mov ebx, dword [esp + 0x10]
mov esi, dword [esp + 0x1c]
cmp cx, 0x2f
jne 0x401987
test esi, esi
je 0x401980
xor eax, eax
mov ecx, ebx
mov word [edi], ax
call fcn.004010a7
mov edx, dword [esp + 0x40]
push 0x5c
pop eax
mov word [edi], ax
jmp 0x401987
lea edx, [edi + 2]
mov dword [esp + 0x40], edx
inc ebp
lea edi, [ebx + ebp*2]
movzx eax, word [edi]
mov ecx, eax
test ax, ax
jne 0x40195e
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x4c]
cmp dword [esp + 0x50], 0
je 0x4019b0
mov ecx, edx
call fcn.004010a7
jmp 0x401af6
push ecx
lea ecx, [esp + 0x40]
call fcn.00401f3b
pop ecx
test eax, eax
jne 0x401b26
mov edx, dword [esp + 0x20]
add edx, dword [esp + 0x44]
xor ebp, ebp
mov edi, dword [esp + 0x38]
mov dword [esp + 0x14], edx
test edi, edi
jne 0x4019dd
xor eax, eax
jmp 0x401a2b
and dword [esp + 0x20], 0
lea eax, [esp + 0x20]
push 0
push eax
mov ecx, 0x400000
mov eax, edi
cmp edi, ecx
cmova eax, ecx
push eax
push edx
push dword [esp + 0x4c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x20]
sub edi, ecx
mov edx, dword [esp + 0x14]
add ebp, ecx
add edx, ecx
mov dword [esp + 0x14], edx
test eax, eax
je 0x401a1d
test ecx, ecx
je 0x4019d9
jmp 0x4019d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x401b1f
cmp ebp, dword [esp + 0x38]
jne 0x401b1f
mov eax, dword [esp + 0x10c]
xor edx, edx
mov ecx, dword [esp + 0x18]
xor edi, edi
mov ebp, dword [esp + 0x2c]
test eax, eax
je 0x401a6f
test byte [eax + ebp], cl
je 0x401a6f
mov ecx, dword [esp + 0x110]
lea edx, [esp + 0x64]
mov eax, dword [ecx + ebx*8]
mov dword [esp + 0x64], eax
mov eax, dword [ecx + ebx*8 + 4]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x114]
test eax, eax
je 0x401a99
test byte [eax + ebp], cl
je 0x401a99
mov ecx, dword [esp + 0x118]
lea edi, [esp + 0x6c]
mov eax, dword [ecx + ebx*8]
mov dword [esp + 0x6c], eax
mov eax, dword [ecx + ebx*8 + 4]
mov dword [esp + 0x70], eax
test edx, edx
jne 0x401aa1
test edi, edi
je 0x401aaf
push edx
push 0
push edi
push dword [esp + 0x48]
call dword [sym.imp.KERNEL32.dll_SetFileTime]
lea ecx, [esp + 0x3c]
call fcn.00401f6c
test eax, eax
jne 0x401b18
mov eax, dword [esp + 0x104]
test eax, eax
je 0x401af6
mov ecx, dword [esp + 0x18]
test byte [eax + ebp], cl
je 0x401af6
mov eax, dword [esp + 0x108]
mov edx, dword [eax + ebx*4]
mov ecx, edx
and ecx, 0x7fff
test edx, 0xf0000000
cmove ecx, edx
push ecx
push dword [esp + 0x44]
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov ecx, 0x4323f0
call fcn.00401000
mov edi, dword [esp + 0x1c]
inc ebx
mov dword [esp + 0x4c], ebx
cmp ebx, dword [esp + 0xf0]
jb 0x40168a
jmp 0x401b35
mov ecx, str.cannot_close_output_file
jmp 0x401b2b
mov ecx, str.cannot_write_output_file
jmp 0x401b2b
mov ecx, str.cannot_open_output_file
mov edx, eax
call fcn.00401405
push 0xb
pop esi
mov ebp, dword [esp + 0x10]
push dword [esp + 0x44]
lea eax, [esp + 0x28]
push eax
call dword [esp + 0x30]
pop ecx
pop ecx
push ebp
call fcn.00414fa6
pop ecx
lea edx, [esp + 0x24]
lea ecx, [esp + 0xa8]
call fcn.00402d4a
push dword [esp + 0xa0]
lea eax, [esp + 0x28]
push eax
call dword [esp + 0x30]
pop ecx
pop ecx
lea ecx, [esp + 0x7c]
call fcn.00401f6c
mov eax, esi
mov ecx, dword [esp + 0x17c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00410199
add esp, 0x174
ret