Function at 0x401d50
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x7c
mov eax, dword [0x420684]
mov dword [esp + 4], 4
mov dword [esp + 0x38], eax
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__access]
test eax, eax
jne 0x402594
mov eax, dword [0x420684]
mov dword [esp], eax
call fcn.004017f0
test eax, eax
mov dword [0x420688], eax
je 0x402510
cmp dword [0x40f1b8], 2
ja 0x402558
mov dword [esp + 0x34], str.AAB_aix_stdio
mov eax, dword [esp + 0x34]
mov esi, dword [0x420684]
test byte [eax + 0x11], 0x80
mov ebx, dword [eax + 4]
jne 0x4021d5
test ebx, ebx
je 0x401e0d
cmp byte [esi], 0x2e
je 0x401dd8
jmp 0x401df5
add esi, 2
cmp byte [esi], 0x2e
jne 0x401df5
cmp byte [esi + 1], 0x2f
je 0x401dd0
jmp 0x401df5
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
lea ebx, [ebx + eax + 1]
cmp byte [ebx], 0
je 0x4021d5
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp], ebx
call fcn.00403220
test eax, eax
jne 0x401de0
mov eax, dword [esp + 0x34]
mov ebx, dword [eax + 0x14]
mov eax, dword [eax + 0xc]
test eax, eax
lea ebp, [eax - 1]
jle 0x401e86
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0
nop
cmp dword [ebx], 4
ja case.default.0x401e37
mov eax, dword [ebx]
jmp dword [eax*4 + 0x410304]
mov edx, dword [0x420688]
mov eax, dword [ebx + 4]
mov dword [esp + 8], edx
mov edx, dword [0x420684]
mov dword [esp], eax
mov dword [esp + 4], edx
call fcn.00402e90
test eax, eax
jne 0x4021d5
sub ebp, 1
add ebx, 0xc
cmp ebp, 0xffffffff
jne 0x401e30
mov esi, dword [esp + 0x24]
test esi, esi
je 0x401e86
mov ebx, dword [esp + 0x20]
test ebx, ebx
je 0x4021d5
cmp dword [0x40f1b8], 1
jbe 0x401ebb
mov eax, dword [esp + 0x34]
mov edx, dword [0x420684]
mov eax, dword [eax]
mov dword [esp + 0xc], edx
mov dword [esp + 4], str.Applying___24s_to__s_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [esp + 0x34]
mov esi, dword [eax + 0x10]
test esi, 8
jne 0x4024f1
mov eax, dword [0x420680]
test esi, 4
mov ebp, dword [0x420684]
mov dword [esp + 0x3c], eax
jne 0x402402
mov eax, dword [esp + 0x34]
mov edi, dword [eax + 0x18]
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
add eax, ebx
lea ebx, [eax + 0x23]
add eax, 0x2a
and esi, 2
cmove eax, ebx
mov edx, eax
mov dword [esp + 0x24], eax
mov eax, dword [edi]
lea esi, [edi + 4]
test eax, eax
je 0x401f4a
mov edi, edx
lea esi, [esi]
mov dword [esp], eax
add esi, 4
call sub.msvcrt.dll_strlen
lea edi, [edi + eax + 0x18]
mov eax, dword [esi - 4]
test eax, eax
jne 0x401f30
mov dword [esp + 0x24], edi
mov edi, dword [esp + 0x24]
mov dword [esp], edi
call fcn.00403150
mov esi, eax
mov eax, edi
mov edi, dword [esp + 0x34]
sub eax, ebx
mov dword [esp + 0x28], eax
mov eax, esi
test byte [edi + 0x10], 2
mov edx, dword [edi + 0x18]
je 0x401f81
mov ecx, 0x2028
add edx, 8
mov word [esi], cx
lea eax, [esi + 2]
mov byte [esi + 2], 0
lea edi, [edx + 4]
mov edx, dword [edx]
mov dword [esp + 0x30], edi
lea ecx, [edx + 1]
movzx edx, byte [edx]
test dl, dl
je 0x401fa5
add eax, 1
add ecx, 1
mov byte [eax - 1], dl
movzx edx, byte [ecx - 1]
test dl, dl
jne 0x401f94
add dword [esp + 0x30], 4
mov edx, dword [esp + 0x30]
mov edx, dword [edx - 4]
test edx, edx
mov dword [esp + 0x2c], edx
je 0x402386
mov byte [eax], 0x20
lea ebp, [eax + 1]
mov eax, esi
sub eax, ebp
add eax, dword [esp + 0x28]
mov dword [esp + 4], edx
mov dword [esp], ebp
mov dword [esp + 8], eax
call fcn.00402b10
test eax, eax
jne 0x4023ed
mov ebx, dword [esp + 0x24]
add ebx, 0x64
mov ecx, ebp
sub ecx, esi
mov dword [esp], esi
mov dword [esp + 4], ebx
mov dword [esp + 0x20], ecx
call fcn.004031d0
mov ecx, dword [esp + 0x20]
mov esi, eax
mov eax, dword [esp + 0x28]
lea ebp, [esi + ecx]
mov dword [esp], ebp
lea edi, [eax + ebx]
sub edi, dword [esp + 0x24]
mov eax, edi
sub eax, ecx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 4], eax
call fcn.00402b10
test eax, eax
je 0x401fe7
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], ebx
jmp 0x401fa5
mov eax, dword [ebx + 8]
mov edx, dword [0x420688]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00409090
test eax, eax
jne case.default.0x401e37
add dword [esp + 0x34], 0x20
cmp dword [esp + 0x34], 0x40cf20
jne 0x401da8
mov eax, dword [0x420680]
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll__open
test eax, eax
mov ebp, eax
js 0x4025ef
mov dword [esp + 4], 0x4100c7
xor ebx, ebx
mov dword [esp], eax
call fcn.00403080
mov esi, dword [0x420688]
mov dword [esp + 0x20], eax
jmp 0x4020d1
mov dword [esp + 4], ebx
mov dword [esp], edi
call sub.msvcrt.dll_putc
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call sub.msvcrt.dll_getc
cmp eax, 0xffffffff
je 0x402649
test ebx, ebx
movzx edi, al
jne 0x4020c5
movzx eax, byte [esi]
cmp edi, eax
je 0x402641
call fcn.00401640
mov ebx, eax
mov eax, dword [0x420688]
cmp esi, eax
je 0x4020c5
mov edx, esi
sub edx, eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_fwrite
jmp 0x4020c5
mov edi, dword [0x420684]
mov dword [esp], edi
call sub.msvcrt.dll_strlen
mov esi, eax
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea eax, [esi + eax + 0x21]
mov dword [esp], eax
call fcn.00403150
mov esi, eax
mov eax, dword [ebx + 4]
mov dword [esp + 8], edi
mov dword [esp + 4], str.file_s__test__s____dev_null_2_1
mov dword [esp], esi
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_sprintf
mov dword [esp], esi
call fcn.00402bf0
mov dword [esp], esi
mov edi, eax
call sub.msvcrt.dll_free
test edi, edi
je case.default.0x401e37
jmp 0x4021d5
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4021f0
mov dword [esp + 0x20], 1
jmp case.default.0x401e37
mov eax, dword [ebx + 8]
mov edx, dword [0x420688]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00409090
test eax, eax
je case.default.0x401e37
add dword [esp + 0x34], 0x20
cmp dword [esp + 0x34], 0x40cf20
jne 0x401da8
jmp 0x402088
mov eax, dword [0x420688]
mov edi, dword [0x420684]
mov esi, eax
mov eax, dword [0x4200c4]
test eax, eax
jne 0x402364
mov dword [esp], edi
mov dword [esp + 4], 0x2f
call sub.msvcrt.dll_strrchr
test eax, eax
lea edx, [eax + 1]
cmovne edi, edx
mov dword [esp + 0x4c], eax
call dword [sym.imp.msvcrt.dll__errno]
lea edx, [esp + 0x4c]
mov dword [eax], 0
mov eax, dword [ebx + 4]
mov dword [esp + 4], edx
mov dword [esp + 8], 0xa
mov dword [esp], eax
call sub.msvcrt.dll_strtoul
mov dword [esp + 0x24], eax
call dword [sym.imp.msvcrt.dll__errno]
mov eax, dword [eax]
test eax, eax
jne 0x402379
mov eax, dword [esp + 0x4c]
lea edx, [eax + 1]
mov dword [esp + 0x4c], edx
movzx ecx, byte [eax]
test byte [ecx + ecx + 0x41ea20], 0x40
je 0x402379
movzx ecx, byte [eax + 1]
test byte [ecx + ecx + 0x41ea20], 0x40
je 0x4022a6
add eax, 2
nop
mov edx, eax
mov dword [esp + 0x4c], eax
movzx ecx, byte [edx]
add eax, 1
test byte [ecx + ecx + 0x41ea20], 0x40
jne 0x402290
lea eax, [edx + 1]
mov dword [esp + 0x4c], eax
movzx ecx, byte [edx]
test byte [ecx + ecx + 0x41ea20], 4
je 0x402379
movzx ecx, byte [edx + 1]
test byte [ecx + ecx + 0x41ea20], 4
je 0x4026bd
lea eax, [edx + 2]
mov edx, eax
mov dword [esp + 0x4c], eax
movzx ecx, byte [edx]
add eax, 1
test byte [ecx + ecx + 0x41ea20], 4
jne 0x4022d3
lea ecx, [edx + 1]
mov dword [esp + 0x4c], ecx
movzx eax, byte [edx]
test byte [eax + eax + 0x41ea20], 0x40
je 0x402379
movzx eax, byte [edx + 1]
test byte [eax + eax + 0x41ea20], 0x40
je 0x402711
lea eax, [edx + 2]
mov edx, eax
mov dword [esp + 0x4c], eax
movzx ecx, byte [edx]
add eax, 1
test byte [ecx + ecx + 0x41ea20], 0x40
jne 0x402312
mov dword [esp + 4], edi
mov dword [esp], edx
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x402379
movsx edx, byte [esi]
xor eax, eax
mov ecx, esi
test dl, dl
je 0x40235e
mov esi, eax
add ecx, 1
shr eax, 1
add eax, edx
movsx edx, byte [ecx]
shl esi, 0xf
movzx esi, si
add eax, esi
test dl, dl
movzx eax, ax
jne 0x402343
cmp eax, dword [esp + 0x24]
jne 0x402379
mov dword [esp + 0x20], 1
mov dword [esp + 0x24], 1
jmp case.default.0x401e37
mov dword [esp + 0x24], 1
jmp case.default.0x401e37
mov edx, dword [esp + 0x34]
test byte [edx + 0x10], 2
je 0x4023a3
mov edx, 0x20
add eax, 5
mov dword [eax - 5], 0x3c202920
mov word [eax - 1], dx
mov edx, dword [esp + 0x3c]
mov dword [esp + 4], str.__s____sX___rm__f__s__mv__f__sX__s
mov dword [esp], eax
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], edx
mov edx, dword [esp + 0x38]
mov dword [esp + 8], edx
call sub.msvcrt.dll_sprintf
mov dword [esp], esi
call fcn.00402bf0
mov dword [esp], esi
call sub.msvcrt.dll_free
mov eax, dword [0x420680]
mov dword [esp + 0x38], eax
jmp 0x4021d5
mov edi, dword [esp + 0x28]
mov ebx, dword [esp + 0x24]
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], ebx
jmp 0x401fa5
mov eax, dword [0x4200bc]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [esp], ebp
mov edi, eax
call sub.msvcrt.dll_strlen
mov esi, eax
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea edx, [edi + esi + 0x3d]
add ebx, edx
add eax, ebx
mov dword [esp], eax
call fcn.00403150
mov ebx, dword [0x4200bc]
mov dword [esp + 4], ebx
mov dword [esp], eax
mov esi, eax
call sub.msvcrt.dll_strcpy
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
lea ebx, [esi + eax]
lea eax, [esp + 0x4c]
mov dword [ebx], 0x2f2e2e2f
mov dword [ebx + 4], 0x69786966
mov dword [ebx + 8], 0x756c636e
mov dword [ebx + 0xc], 0x2f736564
mov dword [ebx + 0x10], 0x6c707061
mov dword [ebx + 0x14], 0x78696679
mov dword [ebx + 0x18], 0x6578652e
mov byte [ebx + 0x1c], 0
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.0040a480
cmp eax, 0xffffffff
je 0x402518
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
mov edx, dword [esp + 0x3c]
mov dword [esp + 0xc], ebp
mov dword [esp + 4], str.__ld__s__s__s
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x38]
add eax, ebx
mov dword [esp], eax
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x34]
sub edx, 0x40b020
sar edx, 5
mov dword [esp + 8], edx
call sub.msvcrt.dll_sprintf
jmp 0x4023cf
mov eax, dword [eax + 0x18]
mov ebx, dword [eax]
test ebx, ebx
je 0x402503
cmp byte [ebx], 0
jne 0x4026c4
mov eax, dword [0x420688]
mov dword [esp], eax
call sub.msvcrt.dll_free
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebx], 0x2e2e2f
mov dword [ebx + 7], 0x69786966
mov dword [ebx + 3], 0x2f2e2e2f
mov dword [ebx + 0xb], 0x756c636e
mov dword [ebx + 0xf], 0x2f736564
mov dword [ebx + 0x13], 0x6c707061
mov dword [ebx + 0x17], 0x78696679
mov dword [ebx + 0x1b], 0x6578652e
mov byte [ebx + 0x1f], 0
jmp 0x4024ad
mov eax, dword [0x420024]
test eax, eax
je 0x401da0
mov eax, dword [0x420684]
mov dword [esp + 4], str._6lu___50s____r
mov dword [esp + 0xc], eax
mov eax, dword [0x42068c]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x401da0
call dword [sym.imp.msvcrt.dll__errno]
mov ebx, dword [eax]
mov dword [esp], ebx
call fcn.004030a0
mov dword [esp + 4], 0x1000
mov dword [esp], 0
mov esi, eax
call sub.msvcrt.dll__getcwd
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], ebx
mov dword [esp + 4], str.Cannot_access__s_from__s_n_terror__d___s__n
mov dword [esp + 0xc], eax
mov eax, dword [0x420684]
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [sym.imp.msvcrt.dll__errno]
call ebx
cmp dword [eax], 2
je 0x402503
mov edi, dword [0x420680]
call ebx
mov eax, dword [eax]
mov dword [esp], eax
call fcn.004030a0
mov esi, eax
call ebx
mov eax, dword [eax]
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], esi
mov dword [esp + 4], str.error__d___s__opening_output___s__for_read_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x402503
add esi, 1
jmp 0x4020d1
test ebx, ebx
nop
lea esi, [esi]
je 0x40268f
mov dword [esp], ebx
call sub.msvcrt.dll_fclose
lea eax, [esp + 0x4c]
mov dword [esp + 0xc], eax
mov eax, dword [0x420688]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 1
mov dword [esp], 0x420660
mov dword [esp + 4], eax
call fcn.00409090
test eax, eax
je 0x402718
mov eax, dword [esp + 0x20]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov dword [esp], ebp
call sub.msvcrt.dll__close
mov dword [esp], ebp
call sub.msvcrt.dll__close
mov eax, dword [0x420680]
mov dword [esp], eax
call sub.msvcrt.dll__unlink
jmp 0x402503
mov edx, eax
jmp 0x4022e9
call fcn.00401640
mov dword [esp], ebx
mov esi, eax
call sub.msvcrt.dll_strlen
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp], ebx
mov edi, eax
mov dword [esp + 4], eax
call sub.msvcrt.dll_fwrite
cmp byte [ebx + edi - 1], 0xa
je 0x402704
mov dword [esp + 4], esi
mov dword [esp], 0xa
call sub.msvcrt.dll_fputc
mov dword [esp], esi
call sub.msvcrt.dll_fclose
jmp 0x402503
mov edx, ecx
jmp 0x402328
mov esi, dword [0x420684]
mov dword [esp + 4], 0x2f
mov ebx, dword [0x420688]
mov dword [esp], esi
call sub.msvcrt.dll_strrchr
cmp dword [0x40f1b8], 1
mov edi, eax
jbe 0x40275b
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], esi
mov dword [esp + 4], str.Quoted_includes_in__s_n
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
test edi, edi
je 0x40285f
mov byte [edi], 0
add ebx, dword [esp + 0x4c]
cmp byte [ebx], 0x22
je 0x402777
add ebx, 1
cmp byte [ebx], 0x22
jne 0x40276f
mov eax, dword [0x4200b8]
mov ecx, ebx
mov edx, esi
call fcn.00401560
test eax, eax
jne 0x4027c0
lea eax, [esp + 0x4c]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], ebx
mov dword [esp], 0x420660
call fcn.00409090
test eax, eax
je 0x402766
jmp 0x40268f
mov eax, dword [0x4200b8]
mov edi, ebx
mov dword [esp + 8], esi
mov dword [esp], str._s___s_
mov dword [esp + 4], eax
call sub.msvcrt.dll_printf
movsx eax, byte [ebx]
cmp al, 0x22
je 0x402801
mov edx, dword [sym.imp.msvcrt.dll__iob]
add edi, 1
mov dword [esp], eax
add edx, 0x20
mov dword [esp + 4], edx
call sub.msvcrt.dll_putc
movsx eax, byte [edi]
cmp al, 0x22
jne 0x4027e2
mov eax, dword [0x4200b0]
mov dword [esp + 8], esi
mov dword [esp], str.___s__s_
mov dword [esp + 4], eax
call sub.msvcrt.dll_printf
movsx eax, byte [ebx]
cmp al, 0x22
je 0x402840
mov edx, dword [sym.imp.msvcrt.dll__iob]
add ebx, 1
mov dword [esp], eax
add edx, 0x20
mov dword [esp + 4], edx
call sub.msvcrt.dll_putc
movsx eax, byte [ebx]
cmp al, 0x22
jne 0x402821
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov ebx, edi
mov dword [esp], 0xa
add eax, 0x20
mov dword [esp + 4], eax
call sub.msvcrt.dll_putc
jmp 0x402789
mov esi, 0x410248
jmp 0x402766