Function at 0x4039f0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0xb1c
mov eax, dword [0x40d2b4]
xor edx, edx
mov dword [esp + 0x15], edx
mov dword [esp + 0xc], ecx
mov cl, byte [0x40d2b8]
mov byte [esp + 0x19], dl
mov edx, dword [0x40d2ac]
mov dword [esp + 0x10], eax
mov eax, dword [0x40d2a4]
mov byte [esp + 0x14], cl
mov ecx, dword [0x40d2a8]
mov dword [esp + 0x24], edx
xor edx, edx
mov dword [esp + 0x1a], eax
mov ax, word [0x40d2b0]
mov dword [esp + 0x1e], ecx
mov cl, byte [0x40d2b2]
mov word [esp + 0x2b], dx
mov byte [esp + 0x2d], dl
mov word [esp + 0x28], ax
mov eax, dword [0x40d29c]
mov byte [esp + 0x2a], cl
mov cl, byte [0x40d2a0]
mov dword [esp + 0x33], edx
push ebx
push ebp
mov byte [esp + 0x3f], dl
mov dl, byte [0x40e3b8]
push edi
mov dword [esp + 0x3a], eax
mov byte [esp + 0x3e], cl
mov ecx, 0x18
xor eax, eax
lea edi, [esp + 0x2c1]
mov byte [esp + 0x2c0], dl
mov byte [esp + 0x44], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x18
xor eax, eax
lea edi, [esp + 0x45]
mov byte [esp + 0xa8], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x3f
xor eax, eax
lea edi, [esp + 0xa9]
mov dx, word [0x40d298]
rep stosd dword es:[edi], eax
mov bl, byte [0x40d29a]
mov ecx, 0x18
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
lea edi, [esp + 0x1ab]
mov word [esp + 0x1a8], dx
mov byte [esp + 0x1aa], bl
rep stosd dword es:[edi], eax
stosb byte es:[edi], al
mov ecx, 0x18
xor eax, eax
lea edi, [esp + 0x20f]
mov word [esp + 0x20c], dx
mov byte [esp + 0x20e], bl
xor ebp, ebp
rep stosd dword es:[edi], eax
stosb byte es:[edi], al
mov eax, dword [esp + 0xb2c]
push 0x40d294
push eax
mov word [esp + 0x36], bp
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
cmp eax, ebp
mov dword [esp + 0xc], eax
je 0x4042e9
push esi
push eax
lea ecx, [esp + 0x32c]
push 0x800
push ecx
call dword [sym.imp.MSVCRT.dll_fgets]
mov ebx, eax
add esp, 0xc
cmp ebx, ebp
je 0x4042cc
mov esi, dword [sym.imp.MSVCRT.dll_fgets]
mov edi, dword [esp + 0x10]
mov al, byte [esp + 0x328]
cmp al, 0xa
je 0x403b71
cmp al, 0xd
jne 0x403b8c
mov al, byte [esp + 0x1af]
test al, al
jne 0x403c49
mov al, byte [esp + 0x48]
test al, al
jne 0x403c49
push 0
push 0
push 0
push 0
push 0x22
lea edx, [esp + 0x33c]
push 0x40d288
lea eax, [esp + 0x1c6]
push edx
push eax
call fcn.004025e0
add esp, 0x20
test eax, eax
jne 0x403c27
push eax
push eax
push 0x3b
push eax
push 0xa
lea ecx, [esp + 0x33c]
push 0x40d26c
lea edx, [esp + 0x60]
push ecx
push edx
call fcn.004025e0
add esp, 0x20
test eax, eax
jne 0x403c27
push eax
push eax
push 0x3b
push eax
push 0xa
lea eax, [esp + 0x33c]
push 0x40d25c
lea ecx, [esp + 0x2dc]
push eax
push ecx
call fcn.004025e0
add esp, 0x20
test eax, eax
jne 0x403c27
push eax
push eax
push eax
push eax
push 0x22
lea edx, [esp + 0x33c]
push 0x40d250
lea eax, [esp + 0xc4]
push edx
push eax
call fcn.004025e0
add esp, 0x20
push edi
lea ecx, [esp + 0x32c]
push 0x800
push ecx
call esi
mov ebx, eax
add esp, 0xc
test ebx, ebx
jne 0x403b62
jmp 0x4042cc
test ebx, ebx
je 0x4042cc
mov al, byte [esp + 0x1af]
mov dword [esp + 0x14], 0
test al, al
je 0x403d9e
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x328]
push edx
push 0x800
push eax
mov byte [esp + 0x2d0], 0
mov byte [esp + 0xb8], 0
mov byte [esp + 0x54], 0
call dword [sym.imp.MSVCRT.dll_fgets]
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x4042cc
cmp byte [esp + 0x328], 0xa
jne 0x403cd6
mov al, byte [esp + 0x48]
test al, al
jne 0x403d96
mov al, byte [esp + 0x2c4]
test al, al
jne 0x403d96
mov al, byte [esp + 0xac]
test al, al
jne 0x403d96
push 0
push 0
push 0
push 0
push 0x22
lea ecx, [esp + 0x33c]
push 0x40d288
lea edx, [esp + 0x22a]
push ecx
push edx
call fcn.004025e0
push 0
push 0
push 0x3b
push 0
push 0xa
lea eax, [esp + 0x35c]
push 0x40d25c
lea ecx, [esp + 0x2fc]
push eax
push ecx
call fcn.004025e0
add esp, 0x40
lea edx, [esp + 0x328]
lea eax, [esp + 0xac]
push 0
push 0
push 0
push 0
push 0x22
push 0x40d250
push edx
push eax
call fcn.004025e0
push 0
push 0
push 0x3b
push 0
push 0xa
lea ecx, [esp + 0x35c]
push 0x40d26c
lea edx, [esp + 0x80]
push ecx
push edx
call fcn.004025e0
mov eax, dword [esp + 0x50]
add esp, 0x40
lea ecx, [esp + 0x328]
push eax
push 0x800
push ecx
call dword [sym.imp.MSVCRT.dll_fgets]
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x4042cc
jmp 0x403ca2
test ebx, ebx
je 0x4042cc
mov al, byte [esp + 0x48]
xor ebp, ebp
test al, al
je 0x403dce
xor esi, esi
lea edi, [esp + 0x20]
lea edx, [esp + 0x48]
push edi
push edx
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
je 0x403dc5
mov dword [esp + 0x14], esi
inc esi
add edi, 0xa
cmp esi, 4
jl 0x403dae
mov al, byte [esp + 0xac]
test al, al
je 0x403e8e
push 1
push 0
push 0
lea eax, [esp + 0xb8]
push 0x40d248
push eax
call fcn.004024d0
add esp, 0x14
test eax, eax
je 0x403e3b
push 1
push 0
push 0
lea ecx, [esp + 0xb8]
push 0x40d248
push ecx
call fcn.004024d0
mov edx, eax
mov edi, 0x40d240
or ecx, 0xffffffff
xor eax, eax
add esp, 0x14
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0xac]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x328]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
mov edx, dword [esp + 0xb34]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [esp + 0xac]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x328]
push ecx
push edx
push 0x40d238
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x10
jmp 0x403ecc
inc dword [0x40e3b4]
call dword [sym.imp.MSVCRT.dll_rand]
mov ecx, dword [0x40e3b4]
push eax
push ecx
push 0
call dword [sym.imp.MSVCRT.dll_time]
mov edx, dword [esp + 0xb40]
add esp, 4
push eax
push edx
lea eax, [esp + 0xbc]
push 0x40d224
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x18
push 1
push 0
push 0
lea ecx, [esp + 0xb8]
push 0x40d240
push ecx
call fcn.004024d0
add esp, 0x14
test eax, eax
je 0x403f10
push 0
push 0xffffffffffffffff
lea edx, [esp + 0xb4]
push 0
push edx
call fcn.00404e80
add esp, 0x10
test eax, eax
je 0x403f10
push 0x7d0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esp + 0x14]
cmp eax, 3
ja case.default.0x403f1d
jmp dword [eax*4 + 0x4042f8]
lea eax, [esp + 0xac]
push 0x40d15c
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
je 0x4042cc
mov ebp, 1
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x328]
push ecx
push 0x800
push edx
call dword [sym.imp.MSVCRT.dll_fgets]
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x404293
mov esi, dword [sym.imp.MSVCRT.dll_strstr]
lea eax, [esp + 0x1ac]
lea ecx, [esp + 0x328]
push eax
push ecx
call esi
add esp, 8
test eax, eax
jne 0x404293
mov al, byte [esp + 0x213]
test al, al
je 0x403fbb
lea edx, [esp + 0x210]
lea eax, [esp + 0x328]
push edx
push eax
call esi
add esp, 8
test eax, eax
jne 0x404293
mov esi, 0x40d220
lea eax, [esp + 0x328]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x403feb
test cl, cl
je 0x403fe7
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x403feb
add eax, 2
add esi, 2
test cl, cl
jne 0x403fc7
xor eax, eax
jmp 0x403ff0
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40411d
lea edi, [esp + 0x328]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [esp + ecx + 0x327], 0xa
jne 0x4040aa
cmp dword [esp + 0x14], 2
jne 0x4040aa
mov byte [esp + ecx + 0x327], 0
dec ecx
lea edx, [esp + 0x274]
push ecx
lea eax, [esp + 0x32c]
push edx
push eax
call fcn.00402a60
mov esi, eax
add esp, 0xc
test esi, esi
jle 0x404110
lea ecx, [esp + 0x2c4]
push 0x40d214
push ecx
call dword [sym.imp.MSVCRT.dll__stricmp]
add esp, 8
test eax, eax
jne 0x4040ef
xor edx, edx
test esi, esi
jle 0x4040dd
mov cl, byte [esp + edx + 0x274]
cmp cl, 0xd
jne 0x404088
cmp byte [esp + edx + 0x275], 0xa
jne 0x404097
cmp cl, 0xa
jne 0x4040d0
cmp byte [esp + edx + 0x273], 0xd
je 0x4040d0
mov byte [esp + eax + 0x328], 0xd
inc eax
mov byte [esp + eax + 0x328], 0xa
jmp 0x4040d7
cmp dword [esp + 0x14], 1
jne 0x40402b
push ecx
lea eax, [esp + 0x278]
lea ecx, [esp + 0x32c]
push eax
push ecx
call fcn.00402ba0
jmp 0x404041
mov byte [esp + eax + 0x328], cl
inc edx
inc eax
cmp edx, esi
jl 0x404072
mov edx, dword [esp + 0x18]
push edx
push 1
push eax
lea eax, [esp + 0x334]
push eax
jmp 0x4040ff
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x274]
push ecx
push 1
push esi
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ebp, eax
add esp, 0x10
dec ebp
neg ebp
sbb ebp, ebp
inc ebp
test ebp, ebp
jne 0x403f4b
jmp 0x404293
xor ebx, ebx
jmp 0x404293
mov al, byte [esp + 0xac]
test al, al
je 0x404151
lea ecx, [esp + 0xac]
push 0x40d15c
push ecx
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
je 0x4042cc
mov ebp, 1
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x328]
push edx
push 0x800
push eax
call dword [sym.imp.MSVCRT.dll_fgets]
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x404288
mov esi, dword [sym.imp.MSVCRT.dll_strstr]
lea ecx, [esp + 0x1ac]
lea edx, [esp + 0x328]
push ecx
push edx
call esi
add esp, 8
test eax, eax
jne 0x404288
mov al, byte [esp + 0x213]
test al, al
je 0x4041c6
lea eax, [esp + 0x210]
lea ecx, [esp + 0x328]
push eax
push ecx
call esi
add esp, 8
test eax, eax
jne 0x404288
mov esi, 0x40d220
lea eax, [esp + 0x328]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x4041f6
test cl, cl
je 0x4041f2
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x4041f6
add eax, 2
add esi, 2
test cl, cl
jne 0x4041d2
xor eax, eax
jmp 0x4041fb
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x404286
lea edi, [esp + 0x328]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edx, ecx
cmp byte [esp + edx + 0x327], 0xa
jne 0x404250
mov edi, 0x40d160
or ecx, 0xffffffff
xor eax, eax
inc edx
repne scasb al, byte es:[edi]
not ecx
lea esi, [esp + edx + 0x326]
sub edi, ecx
mov eax, ecx
mov dword [esp + 0x14], esi
mov esi, edi
mov edi, dword [esp + 0x14]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov al, byte [esp + 0xac]
test al, al
je 0x40427c
mov ecx, dword [esp + 0x18]
push ecx
push 1
push edx
lea edx, [esp + 0x334]
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ebp, eax
add esp, 0x10
dec ebp
neg ebp
sbb ebp, ebp
inc ebp
test ebp, ebp
jne 0x404156
jmp 0x404288
xor ebx, ebx
mov al, byte [esp + 0xac]
test al, al
je 0x4042a1
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
test ebp, ebp
je case.default.0x403f1d
mov al, byte [esp + 0xac]
test al, al
je case.default.0x403f1d
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0xac]
push ecx
lea ecx, [edx + 4]
call fcn.00401590
test ebx, ebx
jne 0x403c51
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, ebp
pop esi
pop edi
pop ebp
pop ebx
add esp, 0xb1c
ret 8
mov eax, ebp
pop edi
pop ebp
pop ebx
add esp, 0xb1c
ret 8