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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
lea ebx, [ebp - 0x214]
mov edi, dword fs:[0x18]
mov esi, edi
sub esp, 0x258
mov dword [esp + 4], ebx
mov dword [esp], 0x104
call dword [sym.imp.kernel32.dll_GetTempPathA]
lea eax, [ebp - 0x110]
sub esp, 8
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0x59898a
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_GetTempFileNameA]
xor eax, eax
mov dword [ebp - 0x244], 0x59dc00
sub esp, 0x10
mov edi, eax
jmp 0x46db74
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x13fc
xor eax, eax
mov dword [esp + 8], edi
mov dword [esp + 4], str._ld:_CreateFile_should_fail_n
cmp dword [ebp - 0x238], 0xffffffff
sete al
mov dword [esp], eax
call fcn.0045bef0
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x13fd
mov eax, dword [ebx + 0x34]
mov dword [esp + 0x10], eax
mov edx, dword [ebp - 0x234]
xor eax, eax
mov dword [esp + 8], edi
mov dword [esp + 0xc], edx
mov dword [esp + 4], str._ld:_expected__d__got__ld_n
cmp dword [ebx + 0x34], edx
sete al
add edi, 1
mov dword [esp], eax
call fcn.0045bef0
add dword [ebp - 0x244], 0x10
cmp edi, 0xa
je 0x46e184
mov eax, dword [ebp - 0x244]
mov ebx, dword fs:[0x18]
mov dword [ebx + 0x34], 0xdeadbeef
mov ecx, dword [eax]
mov dword [ebp - 0x230], ecx
mov dword [esp + 4], ecx
lea ecx, [ebp - 0x110]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x4000000
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_CreateFileA]
mov edx, dword [ebp - 0x244]
sub esp, 0x1c
mov dword [ebp - 0x238], eax
mov edx, dword [edx + 4]
test edx, edx
mov dword [ebp - 0x234], edx
jne 0x46daf0
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1401
mov eax, dword [ebx + 0x34]
mov dword [esp + 8], edi
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 4], str._ld:_CreateFile_error__ld_n
cmp dword [ebp - 0x238], 0xffffffff
setne al
mov dword [esp], eax
call fcn.0045bef0
mov ebx, dword [ebp - 0x230]
mov dword [ebp - 0x234], 0x59dc00
mov dword [ebp - 0x248], edi
mov eax, ebx
or eax, 0x120089
test ebx, ebx
cmovns eax, ebx
mov edx, eax
or edx, 0x120116
test eax, 0x40000000
cmovne eax, edx
mov edx, eax
or edx, 0x1200a0
test eax, 0x20000000
cmovne eax, edx
mov edx, eax
or edx, 0x1f01ff
test eax, 0x10000000
cmove edx, eax
mov dword [ebp - 0x240], edx
jmp 0x46dcdf
call fcn.0057d110
mov edx, dword [ebp - 0x23c]
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1409
mov eax, dword [edx + 0x34]
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x230]
mov dword [esp + 4], str.DuplicateHandle__x____x__error__ld_n
mov dword [esp + 8], eax
mov dword [esp], ebx
call fcn.0045bef0
test ebx, ebx
jne 0x46dea0
add dword [ebp - 0x234], 0x10
mov eax, dword [ebp - 0x234]
mov ebx, 0x59dca0
cmp ebx, eax
je 0x46dec0
mov eax, dword [ebp - 0x234]
mov edx, dword fs:[0x18]
mov dword [edx + 0x34], 0xdeadbeef
mov edi, dword [eax]
lea eax, [ebp - 0x22c]
mov dword [ebp - 0x23c], edx
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0xffffffff
mov eax, dword [ebp - 0x238]
mov dword [esp], 0xffffffff
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_DuplicateHandle]
mov ebx, eax
mov eax, edi
sub esp, 0x1c
or eax, 0x120089
test edi, edi
cmovns eax, edi
mov ecx, eax
or ecx, 0x120116
test eax, 0x40000000
cmovne eax, ecx
mov ecx, eax
or ecx, 0x1200a0
test eax, 0x20000000
cmovne eax, ecx
mov ecx, eax
or ecx, 0x1f01ff
test eax, 0x10000000
cmovne eax, ecx
mov ecx, dword [ebp - 0x240]
and eax, 0xfffffff
and ecx, eax
cmp ecx, eax
je 0x46dc80
cmp edi, 0x3fffffff
ja 0x46ddd8
test dword [ebp - 0x230], 0x40000002
jne 0x46ddaa
test edi, 2
jne 0x46ddd8
test dword [ebp - 0x230], 0x80000001
jne 0x46ddbe
test edi, 1
jne 0x46ddd8
xor edx, edx
test dword [ebp - 0x230], 0x40000000
jne 0x46dde5
mov edx, edi
and edx, 4
je 0x46dde5
lea esi, [esi]
nop
mov ecx, dword [0x8f0770]
xor edx, edx
test ecx, ecx
setne dl
mov dword [ebp - 0x23c], edx
call fcn.0057d110
mov edx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
lea ecx, [edx + edx]
mov edx, dword [ebp - 0x23c]
or ecx, edx
mov dword [eax + 0x10], ecx
jmp 0x46de81
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1412
mov dword [esp + 0xc], edi
mov eax, dword [ebp - 0x230]
mov dword [esp + 4], str.DuplicateHandle__x____x__should_fail_n
mov dword [esp + 8], eax
xor eax, eax
test ebx, ebx
sete al
mov dword [esp], eax
call fcn.0045bef0
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1413
mov eax, dword [esi + 0x34]
mov dword [esp + 4], 0x59a28c
mov dword [esp + 8], eax
xor eax, eax
cmp dword [esi + 0x34], 5
sete al
mov dword [esp], eax
call fcn.0045bef0
call fcn.0057d110
shr dword [eax + 0x10], 1
call fcn.0057d110
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x46de10
test ebx, ebx
je 0x46dcc5
mov eax, dword [ebp - 0x22c]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
jmp 0x46dcc5
lea eax, [ebp - 0x228]
mov edi, dword [ebp - 0x248]
mov dword [ebp - 0x228], 0xdeadbeef
mov ebx, dword fs:[0x18]
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 2
mov dword [esp + 4], 0x59b441
mov eax, dword [ebp - 0x238]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFile]
mov edx, eax
mov eax, dword [ebp - 0x244]
sub esp, 0x14
mov dword [ebp - 0x230], edx
mov eax, dword [eax + 8]
mov dword [ebp - 0x234], eax
test eax, eax
je 0x46e190
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x141e
xor eax, eax
mov dword [esp + 8], edi
mov dword [esp + 4], str._ld:_WriteFile_should_fail_n
mov edx, dword [ebp - 0x230]
test edx, edx
sete al
mov dword [esp], eax
call fcn.0045bef0
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x141f
mov eax, dword [ebx + 0x34]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x234]
mov dword [esp + 8], edi
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._ld:_expected__d__got__ld_n
cmp dword [ebx + 0x34], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0045bef0
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1420
mov eax, dword [ebp - 0x228]
mov dword [esp + 8], edi
test eax, eax
mov dword [esp + 0xc], eax
sete al
mov dword [esp + 4], str._ld:_expected_0__got__lu_n
movzx eax, al
mov dword [esp], eax
call fcn.0045bef0
mov ebx, dword fs:[0x18]
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x238]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
sub esp, 0x10
mov dword [ebp - 0x230], eax
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x142a
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.SetFilePointer_error__ld_n
mov dword [esp + 8], eax
xor eax, eax
cmp dword [ebp - 0x230], 0xffffffff
setne al
mov dword [esp], eax
call fcn.0045bef0
lea edx, [ebp - 0x228]
lea eax, [ebp - 0x224]
mov dword [ebx + 0x34], 0xdeadbeef
mov dword [ebp - 0x228], 0xdeadbeef
mov dword [esp + 0xc], edx
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x10
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x238]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadFile]
mov ecx, eax
mov eax, dword [ebp - 0x244]
sub esp, 0x14
mov edx, dword [eax + 0xc]
test edx, edx
mov dword [ebp - 0x230], edx
je 0x46e208
mov dword [ebp - 0x234], ecx
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1431
xor eax, eax
mov dword [esp + 8], edi
mov dword [esp + 4], str._ld:_ReadFile_should_fail_n
mov ecx, dword [ebp - 0x234]
test ecx, ecx
sete al
mov dword [esp], eax
call fcn.0045bef0
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1432
mov eax, dword [ebx + 0x34]
mov dword [esp + 0x10], eax
mov edx, dword [ebp - 0x230]
xor eax, eax
mov dword [esp + 8], edi
mov dword [esp + 0xc], edx
mov dword [esp + 4], str._ld:_expected__d__got__ld_n
cmp dword [ebx + 0x34], edx
sete al
mov dword [esp], eax
call fcn.0045bef0
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1433
mov eax, dword [ebp - 0x228]
mov dword [esp + 8], edi
mov dword [esp + 4], str._ld:_expected_0__got__lu_n
test eax, eax
mov dword [esp + 0xc], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.0045bef0
mov eax, dword [ebp - 0x238]
add edi, 1
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_CloseHandle]
add dword [ebp - 0x244], 0x10
sub esp, 4
cmp edi, 0xa
jne 0x46db74
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1424
mov eax, dword [ebx + 0x34]
mov dword [esp + 8], edi
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._ld:_WriteFile_error__ld_n
mov edx, dword [ebp - 0x230]
mov dword [esp], edx
call fcn.0045bef0
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1425
mov eax, dword [ebp - 0x228]
mov dword [esp + 8], edi
cmp eax, 2
mov dword [esp + 0xc], eax
sete al
mov dword [esp + 4], str._ld:_expected_2__got__lu_n
movzx eax, al
mov dword [esp], eax
call fcn.0045bef0
jmp 0x46dfdc
mov dword [ebp - 0x230], ecx
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1437
mov eax, dword [ebx + 0x34]
mov dword [esp + 8], edi
mov dword [esp + 0xc], eax
mov dword [esp + 4], str._ld:_ReadFile_error__ld_n
mov ecx, dword [ebp - 0x230]
mov dword [esp], ecx
call fcn.0045bef0
mov eax, dword [ebp - 0x234]
test eax, eax
je 0x46e262
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x1439
jmp 0x46e139
call fcn.0057d110
mov dword [eax], 0x597dfd
mov dword [eax + 4], 0x143c
mov eax, dword [ebp - 0x228]
mov dword [esp + 8], edi
cmp eax, 2
mov dword [esp + 0xc], eax
sete al
mov dword [esp + 4], str._ld:_expected_2__got__lu_n
movzx eax, al
mov dword [esp], eax
call fcn.0045bef0
call fcn.0057d110
mov dword [eax], 0x597dfd
movzx ecx, byte [ebp - 0x223]
mov dword [eax + 4], 0x143d
movzx eax, byte [ebp - 0x224]
mov edx, ecx
mov dword [esp + 0x10], ecx
cmp dl, 0xa7
movzx ecx, al
mov dword [esp + 8], edi
sete dl
cmp al, 0x5e
mov dword [esp + 0xc], ecx
sete al
mov dword [esp + 4], str._ld:_expected_5ea7__got__02x_02x_n
movzx eax, al
and eax, edx
mov dword [esp], eax
call fcn.0045bef0
jmp 0x46e15f