Function at 0x402030
Capabilities:
Delete directory
Write file on windows

Disassembly:
sub esp, 0xe44
push ebp
push esi
mov esi, dword [esp + 0xe58]
mov eax, pe_nt_image_headers32
push edi
mov edi, dword [esp + 0xe54]
mov ebp, 0x400
mov word [esp + 0x24], ax
lea eax, [esp + 0x52c]
push esi
push eax
push edi
mov word [esp + 0x134], bp
call sym.get_newer.exe__file_open_read_dir_12
push esi
call sym.get_newer.exe__sys_error_4
test al, al
jne 0x40239b
push ebx
push esi
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x30]
push eax
push 8
lea eax, [esp + 0x540]
push eax
call sym.get_newer.exe__file_read_dir_20
push esi
call sym.get_newer.exe__file_eof_4
mov ebx, dword [esp + 0xe5c]
test al, al
jne 0x4022c7
mov ebp, dword [esp + 0xe64]
push esi
call sym.get_newer.exe__sys_error_4
test al, al
jne 0x40232f
lea eax, [esp + 0x12c]
push eax
lea eax, [esp + 0x2c]
push eax
push edi
call sym.get_newer.exe__string_pathname_join_12
movzx eax, byte [esp + 0x11]
sub eax, 2
je 0x402243
sub eax, 1
je 0x402198
test bl, 2
je 0x402185
push 1
call fcn.0040dc9c
push eax
push 7
push 1
push str._file_
call fcn.0040df31
mov ax, word [esp + 0x142]
mov ecx, 0x400
add esp, 0x14
cmp ax, cx
jle 0x402141
cwde
push 0x434faf
sub eax, ecx
push eax
push 0x42f064
call fcn.00401b30
mov ax, word [esp + 0x13a]
add esp, 0xc
mov ecx, 0x400
test ax, ax
jle 0x402157
cmp ax, cx
jge 0x402150
movsx edi, ax
jmp 0x402159
mov edi, 0x400
jmp 0x402159
xor edi, edi
push 1
call fcn.0040dc9c
push eax
push edi
lea eax, [esp + 0x13c]
push 1
push eax
call fcn.0040df31
push 0x42f068
call fcn.00401b30
mov edi, dword [esp + 0xe70]
add esp, 0x18
push esi
lea eax, [esp + 0x130]
push eax
call sym.get_newer.exe__file_delete_name_8
jmp 0x402267
test bl, 2
je 0x402233
push 1
call fcn.0040dc9c
push eax
push 7
push 1
push str._link_
call fcn.0040df31
mov ax, word [esp + 0x142]
mov ecx, 0x400
add esp, 0x14
cmp ax, cx
jle 0x4021ef
cwde
push 0x434fae
sub eax, ecx
push eax
push 0x42f054
call fcn.00401b30
mov ax, word [esp + 0x13a]
add esp, 0xc
mov ecx, 0x400
test ax, ax
jle 0x402205
cmp ax, cx
jge 0x4021fe
movsx edi, ax
jmp 0x402207
mov edi, 0x400
jmp 0x402207
xor edi, edi
push 1
call fcn.0040dc9c
push eax
push edi
lea eax, [esp + 0x13c]
push 1
push eax
call fcn.0040df31
push 0x42f058
call fcn.00401b30
mov edi, dword [esp + 0xe70]
add esp, 0x18
push esi
lea eax, [esp + 0x130]
push eax
call sym.get_newer.exe__file_link_del_8
jmp 0x402267
lea eax, [esp + 0x12c]
push eax
call sym.get_newer.exe__string_terminate_null_4
push dword [esp + 0xe68]
lea eax, [esp + 0x130]
push ebp
push esi
push ebx
push eax
call fcn.00402030
push esi
call sym.get_newer.exe__sys_error_4
test al, al
je 0x40229a
test bl, 1
je 0x40232f
push 0
push 0x435050
push 0x435000
push 0x435000
push esi
call sym.get_newer.exe__sys_error_print_20
inc dword [ebp]
push esi
call sym.get_newer.exe__sys_error_none_4
push esi
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x30]
push eax
push 8
lea eax, [esp + 0x540]
push eax
call sym.get_newer.exe__file_read_dir_20
push esi
call sym.get_newer.exe__file_eof_4
test al, al
je 0x4020b2
mov ebp, 0x400
lea eax, [esp + 0x530]
push eax
call sym.get_newer.exe__file_close_4
test bl, 2
je 0x40237c
push 1
call fcn.0040dc9c
push eax
push 7
push 1
push str._dir_
call fcn.0040df31
movzx ecx, word [edi + 2]
add esp, 0x14
mov eax, ecx
cmp cx, bp
jle 0x402320
movsx eax, cx
push 0x435054
sub eax, 0x400
push eax
push 0x42f074
call fcn.00401b30
movzx eax, word [edi + 2]
add esp, 0xc
test ax, ax
jle 0x402350
cmp ax, bp
jge 0x402349
movsx edi, ax
jmp 0x402352
lea eax, [esp + 0x530]
push eax
call sym.get_newer.exe__file_close_4
pop ebx
pop edi
pop esi
pop ebp
add esp, 0xe44
ret 0x14
mov edi, 0x400
jmp 0x402352
xor edi, edi
mov ebx, dword [esp + 0xe58]
push 1
add ebx, 4
call fcn.0040dc9c
push eax
push edi
push 1
push ebx
call fcn.0040df31
push 0x42f078
call fcn.00401b30
add esp, 0x18
jmp 0x40237f
lea ebx, [edi + 4]
push ebx
call sub.KERNEL32.dll_RemoveDirectoryA
mov ecx, dword [esp + 0xe68]
mov byte [ecx], al
test al, al
jne 0x40239a
call sub.KERNEL32.dll_GetLastError
mov dword [esi + 0xc], eax
pop ebx
pop edi
pop esi
pop ebp
add esp, 0xe44
ret 0x14