Function at 0x433050
Capabilities:
Check if file exists
Create directory
Get common file path
Get file attributes
Get file size
Get geographical location
Write file on windows

Disassembly:
sub esp, 0x3b4
mov eax, dword [0x45d600]
xor eax, esp
mov dword [esp + 0x3b0], eax
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push ebp
mov ebp, dword [esp + 0x3c0]
push esi
push 0x104
lea eax, [esp + 0x14]
push eax
push 0x400000
mov esi, ecx
call ebx
cmp byte [esp + eax + 0x10], 0x5c
je 0x433098
mov edi, edi
dec eax
cmp byte [esp + eax + 0x10], 0x5c
jne 0x433090
mov ecx, 0x103
push str.TerNoLog.ter
sub ecx, eax
push ecx
lea edx, [esp + eax + 0x19]
push edx
call fcn.00435e29
add esp, 0xc
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x4330c9
xor eax, eax
jmp 0x43346b
push edi
push 0x64
lea ecx, [esp + 0x360]
push ecx
push 0x1001
push 0x400
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoA]
lea edx, [esp + 0x35c]
push edx
push 0
call fcn.00438bf2
mov eax, dword [ebp]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 8
cmp eax, 0xffffffff
je 0x43310e
push eax
call edi
mov dword [ebp], 0xffffffff
test esi, esi
jne 0x43314b
push 0x104
lea eax, [esp + 0x18]
push eax
push 0x400000
call ebx
mov cl, 0x2e
cmp byte [esp + eax + 0x14], cl
je 0x433137
jmp 0x433130
dec eax
cmp byte [esp + eax + 0x14], cl
jne 0x433130
mov ecx, 0x103
push 0x4563bc
sub ecx, eax
push ecx
lea edx, [esp + eax + 0x1d]
push edx
jmp 0x4331a3
cmp byte [esi], 0x5c
je 0x433198
push 0x456164
push esi
call fcn.00436727
add esp, 8
test eax, eax
jne 0x433198
push 0x104
lea eax, [esp + 0x18]
push eax
push 0x400000
call ebx
cmp byte [esp + eax + 0x14], 0x5c
je 0x433188
lea ebx, [ebx]
dec eax
cmp byte [esp + eax + 0x14], 0x5c
jne 0x433180
mov ecx, 0x103
push esi
sub ecx, eax
push ecx
lea edx, [esp + eax + 0x1d]
push edx
jmp 0x4331a3
push esi
push 0x104
lea eax, [esp + 0x1c]
push eax
call fcn.00435e29
add esp, 0xc
push 0
push 0
push 4
push 0
push 3
push 0xc0000000
lea ecx, [esp + 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp], eax
cmp eax, 0xffffffff
jne 0x4332cf
lea edx, [esp + 0x140]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x43345b
lea eax, [esp + 0x140]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4331f6
sub eax, edx
mov ebx, eax
cmp byte [esp + ebx + 0x13f], 0x5c
je 0x433214
mov byte [esp + ebx + 0x13f], 0x5c
inc ebx
lea esi, [esp + 0x14]
lea ecx, [esi + 1]
jmp 0x433220
mov al, byte [esi]
inc esi
test al, al
jne 0x433220
sub esi, ecx
lea esp, [esp]
cmp byte [esp + esi + 0x14], 0x5c
je 0x43323a
dec esi
jmp 0x433230
lea edi, [esi - 1]
lea ecx, [ecx]
mov al, byte [esp + edi + 0x14]
cmp al, 0x5c
je 0x43324f
cmp al, 0x3a
je 0x43324f
dec edi
jmp 0x433240
lea eax, [edi + 1]
cmp eax, esi
jne 0x433258
mov edi, eax
lea eax, [esp + edi + 0x15]
push eax
mov ecx, 0x104
sub ecx, ebx
push ecx
lea edx, [esp + ebx + 0x148]
push edx
call fcn.00435e29
add esp, 0xc
cmp esi, edi
je 0x43329a
sub esi, edi
add esi, ebx
push 0
lea eax, [esp + 0x144]
lea esi, [esp + esi + 0x143]
push eax
mov byte [esi], 0
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov byte [esi], 0x5c
push 0
push 0
push 4
push 0
push 3
push 0xc0000000
lea ecx, [esp + 0x158]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp], eax
cmp eax, 0xffffffff
je 0x43345b
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push edx
call esi
cmp eax, 0x4c4b40
jbe 0x433301
push 0
push 0
push 5
push 0
push 3
push 0xc0000000
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push eax
call edi
mov ecx, dword [ebp]
push 0
push ecx
call esi
test eax, eax
jne 0x433359
mov ecx, 9
mov esi, str.Date_tTime_tTag_tErrorCode_tpid_ttid_tLog_r_n
lea edi, [esp + 0x118]
rep movsd dword es:[edi], dword [esi]
lea eax, [esp + 0x118]
movsw word es:[edi], word [esi]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x433330
mov ecx, dword [ebp]
sub eax, edx
push 0
lea edx, [esp + 0x14]
push edx
push eax
lea eax, [esp + 0x124]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x104
lea esi, [ebp + 0x1c]
push esi
push 0
call ebx
cmp byte [eax + ebp + 0x1c], 0x5c
je 0x433377
lea ecx, [ecx]
dec eax
cmp byte [esi + eax], 0x5c
jne 0x433370
xor ebx, ebx
cmp eax, ebx
je 0x433390
lea edx, [eax + ebp + 0x1d]
push edx
push 0x104
push esi
call fcn.00435e29
add esp, 0xc
lea eax, [esp + 0x14]
push 0x104
push eax
call fcn.00436286
push str.Global_
lea ecx, [esp + 0x250]
push 0x118
push ecx
call fcn.00435e29
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x25c]
push 0x118
push eax
call fcn.00435f19
push str.__HisLog
lea ecx, [esp + 0x268]
push 0x118
push ecx
call fcn.00435f19
add esp, 0x2c
cmp byte [esp + 0x244], 0
je 0x433406
lea eax, [esp + 0x244]
cmp byte [eax], 0x5c
jne 0x433400
mov byte [eax], 0x2f
inc eax
cmp byte [eax], 0
jne 0x4333f8
lea edx, [esp + 0x244]
push edx
push 1
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
mov dword [ebp + 4], eax
cmp eax, ebx
jne 0x433434
mov eax, dword [ebp]
push eax
call edi
mov dword [ebp], 0xffffffff
mov eax, 1
jmp 0x43346a
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp + 0x18], eax
cmp eax, ebx
jne 0x433462
mov ecx, dword [ebp]
push ecx
call edi
mov edx, dword [ebp + 4]
push edx
mov dword [ebp], 0xffffffff
call edi
mov dword [ebp + 4], ebx
mov eax, 1
jmp 0x43346a
mov dword [ebp + 0x10], ebx
mov dword [ebp + 0x14], ebx
xor eax, eax
pop edi
mov ecx, dword [esp + 0x3bc]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0043581d
add esp, 0x3b4
ret 4