Function at 0x402290
Capabilities:
Get common file path
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41ca81
mov eax, dword fs:[0]
push eax
sub esp, 0x964
mov eax, dword [0x4265dc]
xor eax, esp
mov dword [esp + 0x95c], eax
push esi
push edi
mov eax, dword [0x4265dc]
xor eax, esp
push eax
lea eax, [esp + 0x970]
mov dword fs:[0], eax
push str.STARTING:
call fcn.00406723
add esp, 4
lea eax, [esp + 0x64]
push eax
push 0x100
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea ecx, [esp + 0x64]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x4022f1
mov eax, dword [str.tmpfile.txt]
mov dword [ecx], eax
mov eax, dword [0x4238e0]
mov dword [ecx + 4], eax
mov eax, dword [0x4238e4]
mov dword [ecx + 8], eax
lea eax, [esp + 0x64]
push 0x4238e8
push eax
call fcn.00406896
mov edi, eax
add esp, 8
mov dword [esp + 0x10], edi
test edi, edi
jne 0x402342
push str.Error_open_file_1__n
call fcn.00406723
add esp, 4
jmp 0x402340
jmp 0x402340
push 0x1f400000
call fcn.004068ab
add esp, 4
mov esi, eax
mov dword [esp + 0x18], esi
push 0x423898
call fcn.00406723
add esp, 4
test esi, esi
je 0x4026a4
movdqa xmm1, xmmword [0x4239a0]
xor ecx, ecx
mov edx, esi
jmp 0x402380
movd xmm0, ecx
lea edx, [edx + 0x10]
pshufd xmm0, xmm0, 0
add ecx, 4
paddd xmm0, xmm1
movdqu xmmword [edx - 0x10], xmm0
cmp ecx, 0x7d00000
jl 0x402380
push 0x423898
call fcn.00406723
add esp, 4
push edi
push 0x7d00000
push 4
push esi
call fcn.00406a96
push 0x423898
call fcn.00406723
add esp, 0x14
push 0x1f400000
call fcn.004068ab
add esp, 4
mov edi, eax
mov dword [esp + 0x14], edi
push dword [esp + 0x10]
call fcn.00406b84
add esp, 4
lea eax, [esp + 0x64]
push 0x423910
push eax
call fcn.00406896
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x402412
push str.Error_open_file_2__n
call fcn.00406723
add esp, 4
mov edi, edi
jmp 0x402410
push eax
push 0x7d00000
push 4
push edi
call fcn.00406dc0
push 0x423898
call fcn.00406723
mov ecx, esi
add esp, 0x14
mov edx, edi
mov esi, 0x7cffffc
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x40244b
add ecx, 4
add edx, 4
sub esi, 4
jae 0x402436
xor eax, eax
jmp 0x402470
cmp al, byte [edx]
jne 0x40246b
mov al, byte [ecx + 1]
cmp al, byte [edx + 1]
jne 0x40246b
mov al, byte [ecx + 2]
cmp al, byte [edx + 2]
jne 0x40246b
mov al, byte [ecx + 3]
cmp al, byte [edx + 3]
jne 0x40246b
xor eax, eax
jmp 0x402470
sbb eax, eax
or eax, 1
test eax, eax
jne 0x402694
push 0x423898
call fcn.00406723
add esp, 4
lea eax, [esp + 0x164]
push 0x400
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov dword [esp + 0x30], 0xf
mov dword [esp + 0x2c], 0
mov byte [esp + 0x1c], 0
lea edx, [esp + 0x1c]
mov dword [esp + 0x978], 0
lea ecx, [esp + 0x164]
call fcn.00401f70
cmp dword [esp + 0x30], 0x10
lea eax, [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
cmovae eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov edi, dword [eax + ecx - 9]
lea eax, [esp + 0x1c]
cmovae eax, dword [esp + 0x1c]
mov dword [0x428b8c], edi
push edi
push 0
mov ecx, dword [eax + ecx - 5]
mov eax, dword [edx + ecx*4]
mov dword [0x4275c0], eax
mov eax, dword [edx + ecx*4 + 4]
mov dword [0x4275c4], eax
mov eax, dword [edx + ecx*4 + 8]
mov dword [0x4275c8], eax
mov eax, dword [edx + ecx*4 + 0xc]
lea ecx, [esp + 0x24]
mov dword [0x4275cc], eax
lea eax, [esp + 0x54]
push eax
call fcn.00402820
mov byte [esp + 0x978], 1
mov eax, dword [esp + 0x5c]
mov ecx, dword [esp + 0x2c]
sub ecx, eax
push ecx
push eax
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x28]
call fcn.00402820
mov byte [esp + 0x978], 2
mov esi, dword [esp + 0x44]
push esi
call fcn.0040530b
add esp, 4
xor edx, edx
dec esi
mov edi, eax
js 0x402589
lea esp, [esp]
cmp dword [esp + 0x48], 0x10
lea ecx, [esp + 0x34]
cmovae ecx, dword [esp + 0x34]
mov al, byte [ecx + edx]
mov byte [edx + edi], al
inc edx
cmp edx, esi
jle 0x402570
push 0x423898
call fcn.00406723
mov edx, edi
call fcn.00402210
add esp, 4
push 0x423898
call fcn.00406723
add esp, 4
lea ecx, [esp + 0x164]
mov edx, edi
call fcn.00401d40
cmp dword [esp + 0x48], 0x10
jb 0x4025cb
push dword [esp + 0x34]
call fcn.00405c4f
add esp, 4
cmp dword [esp + 0x60], 0x10
mov dword [esp + 0x48], 0xf
mov dword [esp + 0x44], 0
mov byte [esp + 0x34], 0
jb 0x4025f3
push dword [esp + 0x4c]
call fcn.00405c4f
add esp, 4
cmp dword [esp + 0x30], 0x10
mov dword [esp + 0x60], 0xf
mov dword [esp + 0x5c], 0
mov byte [esp + 0x4c], 0
jb 0x40261b
push dword [esp + 0x1c]
call fcn.00405c4f
add esp, 4
push dword [esp + 0x10]
call fcn.00406b84
add esp, 4
push dword [esp + 0x18]
call fcn.00405ab3
mov edi, dword [esp + 0x18]
add esp, 4
push edi
call fcn.00405ab3
add esp, 4
lea eax, [esp + 0x64]
push eax
call fcn.00406e6c
add esp, 4
test eax, eax
je 0x402662
push str._n_OK_55__n
call fcn.00406723
add esp, 4
mov edi, edi
jmp 0x402660
push str._n_OK_55_3__n
call fcn.00406723
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x970]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [esp + 0x95c]
xor ecx, esp
call fcn.00405aa4
mov esp, ebp
pop ebp
ret
push eax
push str.ERROR___d__n
call fcn.00406723
add esp, 8
jmp 0x4026a2
push str.Error_mallock_1
call fcn.00406723
add esp, 4
jmp 0x4026b1