Function at 0x403950
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x314
mov eax, dword [0x407018]
xor eax, esp
mov dword [esp + 0x310], eax
push ebx
push esi
push edi
push 0x103
xor ebx, ebx
lea eax, [esp + 0x215]
mov esi, ecx
mov edi, edx
push ebx
push eax
mov dword [esp + 0x38], esi
mov dword [esp + 0x34], edi
mov byte [esp + 0x21c], 0
call sub.MSVCR100.dll_memset
add esp, 0xc
push 0x104
lea ecx, [esp + 0x10d]
push ebx
push ecx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ebx
mov byte [esp + 0x114], bl
call sub.MSVCR100.dll_memset
add esp, 0xc
push 0x104
lea edx, [esp + 0x10c]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x108]
push 0x5c
push eax
call dword [sym.imp.MSVCR100.dll__mbsrchr]
add esp, 8
cmp eax, ebx
jne 0x4039f2
or eax, 0xffffffff
jmp 0x4039fb
lea ecx, [esp + 0x108]
sub eax, ecx
lea edx, [esp + 0x108]
push edx
push str._sLog_rp.log
lea edx, [esp + 0x218]
mov byte [esp + eax + 0x111], bl
call fcn.00403c20
push 0x4056a8
lea eax, [esp + 0x21c]
push eax
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.MSVCR100.dll_fopen_s]
add esp, 0x14
cmp dword [esp + 0x14], ebx
je 0x403be0
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403a45
sub eax, edx
mov edx, eax
mov eax, edi
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403a55
sub eax, esi
lea edi, [eax + edx + 0x20]
push edi
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new___unsigned_int_]
add esp, 4
push edi
mov esi, eax
push ebx
push esi
call sub.MSVCR100.dll_memset
add esp, 0xc
push ebx
call dword [sym.imp.MSVCR100.dll__time64]
mov ebx, dword [sym.imp.MSVCR100.dll__localtime64_s]
mov dword [esp + 0x14], edx
add esp, 4
lea edx, [esp + 0xc]
mov dword [esp + 0xc], eax
push edx
lea eax, [esp + 0x34]
push eax
call ebx
add esp, 8
test eax, eax
jne 0x403aae
mov ecx, dword [esp + 0x30]
mov dword [esp + 0x1c], ecx
jmp 0x403ab6
mov dword [esp + 0x1c], 0xffffffff
lea edx, [esp + 0xc]
push edx
lea eax, [esp + 0x7c]
push eax
call ebx
add esp, 8
test eax, eax
jne 0x403ad3
mov ecx, dword [esp + 0x7c]
mov dword [esp + 0x20], ecx
jmp 0x403adb
mov dword [esp + 0x20], 0xffffffff
lea edx, [esp + 0xc]
push edx
lea eax, [esp + 0xe8]
push eax
call ebx
add esp, 8
test eax, eax
jne 0x403afe
mov ecx, dword [esp + 0xec]
mov dword [esp + 0x24], ecx
jmp 0x403b06
mov dword [esp + 0x24], 0xffffffff
lea edx, [esp + 0xc]
push edx
lea eax, [esp + 0xc4]
push eax
call ebx
neg eax
sbb ebx, ebx
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x60]
not ebx
and ebx, dword [esp + 0xd8]
push edx
call dword [sym.imp.MSVCR100.dll__localtime64_s]
add esp, 0x10
test eax, eax
jne 0x403b44
mov eax, dword [esp + 0x64]
inc eax
mov dword [esp + 0x18], eax
jmp 0x403b4c
mov dword [esp + 0x18], 0
lea ecx, [esp + 0xc]
push ecx
lea edx, [esp + 0xa0]
push edx
call dword [sym.imp.MSVCR100.dll__localtime64_s]
add esp, 8
test eax, eax
jne 0x403b74
mov eax, dword [esp + 0xb0]
add eax, 0x76c
jmp 0x403b76
xor eax, eax
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
push ecx
mov ecx, dword [esp + 0x20]
push edx
mov edx, dword [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x30]
push edx
mov edx, dword [esp + 0x28]
push ecx
push ebx
push edx
push eax
push str._04i._02i._02i__02i:_02i:_02i__s_s_n
push edi
push esi
call dword [sym.imp.MSVCR100.dll_sprintf_s]
mov eax, esi
add esp, 0x2c
lea ecx, [eax + 1]
jmp 0x403bb0
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x403bb0
sub eax, ecx
mov ecx, dword [esp + 0x14]
push ecx
push 1
push eax
push esi
call dword [sym.imp.MSVCR100.dll_fwrite]
push esi
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
mov edx, dword [esp + 0x28]
add esp, 0x14
push edx
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov ecx, dword [esp + 0x31c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00403d77
mov esp, ebp
pop ebp
ret